Skip to content

Markdown output format introduces EOL characters mid text. #497

Description

@xuv

Hi.

Current formatting of markdown creates potential unwanted artifacts when using markdown output in other applications.

Let’s take the Neapolitan Pizzak.cook example from the seed. Step 5 is written this way in cooklang:

Place the base on a lightly floured surface and spread @San Marzano tomato sauce{5%tbsp} on it. Add some fresh @basil leaves{} and fresh @mozzarella cheese{100%grams}.

When passing this through cook recipe --format markdown. It will generate:

5. Place the base on a lightly floured surface and spread San Marzano tomato
sauce on it. Add some fresh basil leaves and fresh mozzarella cheese.

As we can see, a EOL character has been introduced right after the word tomato

Depending on the markdown renderers that this text will be used in, it can produce different rendering issues.

I would recommend not to add a EOL character if the initial text does not have them.

Or else, based on the CommonMark specs, for list items, if a paragraph of text in a list item is written over multiple lines, the text must have the same indentation. So step 5 should be written in Markdown like this:

5. Place the base on a lightly floured surface and spread San Marzano tomato
   sauce on it. Add some fresh basil leaves and fresh mozzarella cheese.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions