erusev / parsedown

Better Markdown Parser in PHP
https://parsedown.org
MIT License
14.77k stars 1.12k forks source link

Bullet points shouldn't end in the middle of code blocks #769

Closed skeets23 closed 2 years ago

skeets23 commented 4 years ago

This does not render correctly:

- Here is some code within this bullet point:

Code line #1

skipped one line (but this should still be in the code block)


This should be outside the code block

The li element is getting terminated on the blank line in the fenced code block, which also terminates the code block, which destroys the rendering for everything after that point.

aidantwoods commented 2 years ago

While what you're expecting does match with CommonMark, it requires a different parsing strategy than Parsedown currently uses to detect this case, so this is a won't fix unfortunately: #707.

If you indent your code block by two spaces (to line up with the text in the list), then this will render in the way you're expecting.