mirror of
https://github.com/SinTan1729/recipe-box-for-wikijs.git
synced 2024-12-25 17:58:35 -06:00
Deal with empty strings.
This commit is contained in:
parent
24d88449c2
commit
139ed61916
1 changed files with 6 additions and 4 deletions
|
@ -155,10 +155,12 @@ def main():
|
||||||
recipe.write('\n')
|
recipe.write('\n')
|
||||||
recipe.write('## Instructions\n')
|
recipe.write('## Instructions\n')
|
||||||
for instruction in scraper.instructions().split('\n'):
|
for instruction in scraper.instructions().split('\n'):
|
||||||
if instruction.strip()[0].isdigit():
|
instruction = instruction.strip()
|
||||||
recipe.write('{instruction}\n'.format(instruction=instruction))
|
if instruction:
|
||||||
else:
|
if instruction[0].isdigit():
|
||||||
recipe.write('1. {instruction}\n'.format(instruction=instruction))
|
recipe.write('{instruction}\n'.format(instruction=instruction))
|
||||||
|
else:
|
||||||
|
recipe.write('1. {instruction}\n'.format(instruction=instruction))
|
||||||
|
|
||||||
recipe.write('\n')
|
recipe.write('\n')
|
||||||
recipe.write('[{url}]({url})\n'.format(url=url))
|
recipe.write('[{url}]({url})\n'.format(url=url))
|
||||||
|
|
Loading…
Reference in a new issue