cooklang-swift icon indicating copy to clipboard operation
cooklang-swift copied to clipboard

Any comment after last step leads to empty Step line

Open digital-carver opened this issue 2 years ago • 1 comments

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.
        [–]

digital-carver avatar Mar 21 '22 15:03 digital-carver

Thanks for reporting, moving this parser.

dubadub avatar Mar 26 '22 09:03 dubadub