simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.05k stars 133 forks source link

Blank line in code block breaks rendering #125

Closed wwalker closed 11 months ago

wwalker commented 4 years ago

Using Github Dark (didn't test with other modes).

If a code block immediately follows a bullet list item, and that code clock has a blank line in it, markdown-viewer closes the code block at the blank line.

If there is a blank line between the bullet list item and the code block, it renders as not belonging to the bullet list item (i.e., the code block is not indented), but the entire code block is properly included in the code block div. Interestingly the "indented code block behavior (which I prefer) does not occur on github.com.

With or without the blank line following the bullet list item, the code block renders correctly on github.com.

wwalker commented 4 years ago

This files exhibits the described behavior:

ThePlan.md.gz github-ThePlan md markdown-viewer-ThePlan md

wwalker commented 4 years ago

Here it is in the default github scheme. markdown-viewer-ThePlan md-light

simov commented 4 years ago

Hi @wwalker, can you paste the raw markdown snippet here?

wwalker commented 4 years ago

https://gist.githubusercontent.com/wwalker/5a2561dc964c153617eb1334748a9cb0/raw/b4113f7759dca447baaceda556b4bab0c375a5e9/ThePlan.md

wwalker commented 4 years ago

Red IntenseRed OnRed OnIntenseRed

simov commented 4 years ago

Got it, thanks. Seems to be working with Remark though. You can switch between two compilers/parsers available using the extension dropdown.

The default one, Marked, fails on the above snippet, at least the version that was bundled with the extension last time.

Remark, however, renders the above snippet correctly. It only fails if you enable the pedantic option for it.

Either way it's a compiler issue, I'll bump the Marked version on next release and see how that goes.

simov commented 11 months ago

Seems to be working in Markdown Viewer v5.2 for all of the supported compilers: marked, remark and markdown-it.