markdown-viewer icon indicating copy to clipboard operation
markdown-viewer copied to clipboard

Blank line in code block breaks rendering

Open wwalker opened this issue 5 years ago • 6 comments
trafficstars

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 avatar Jul 25 '20 03:07 wwalker

This files exhibits the described behavior:

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

wwalker avatar Jul 25 '20 03:07 wwalker

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

wwalker avatar Jul 25 '20 03:07 wwalker

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

simov avatar Jul 26 '20 17:07 simov

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

wwalker avatar Jul 26 '20 19:07 wwalker

  • First support:
Bold
Underline
InvertColors
ClearAttributes
ResetAllAttributes

Red
IntenseRed
OnRed
OnIntenseRed

wwalker avatar Jul 26 '20 19:07 wwalker

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 avatar Jul 27 '20 04:07 simov

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

simov avatar Sep 27 '23 07:09 simov