cooklang-swift
cooklang-swift copied to clipboard
Any comment after last step leads to empty Step line
Comments at the end of a recipe file lead to an empty line in the recipe, like:
8.
[–]
While testing this, I also discovered that if a comment comes before a metadata line (whether with or without a blank line in between), the metadata line gets treated as an ordinary recipe line and gets added to the list of steps.
Here's a file that illustrates both issues:
-- hello I'm a comment
>> serves: 420
Solve world peace.
Relax.
-- I'm a comment too!
When cook recipe read
is run on it, the output is:
Ingredients:
Steps:
1. >> serves: 420
[–]
2. Solve world peace.
[–]
3. Relax.
[–]
4.
[–]
Thanks for reporting, moving this parser.