Open bwims opened 4 months ago
I am experiencing the same problem, but it doesn't matter if it is a numbered or bulleted list. The bug is triggered only when there is at least one blank line between at least one adjacent pair of list items, a so-called "loose" list. The bug is not triggered for "tight" lists. So, this tight list markdown will render correctly in MarkdownViewer++:
- first
- second
- third
but this loose list will not:
- first
- second
- third
and neither will this loose list:
- first
- second
- third
The CommonMark list spec seems clear to me:
A list is a sequence of one or more list items of the same type. The list items may be separated by any number of blank lines.
Markdown source is supposed to be relatively human-friendly, which is why loose lists are permitted and used by many people. Nothing in the markdown specs that I've found should ever lead to a line break being inserted between a list marker and its associated text.
Notepad++ v7.9.2 and MarkdownViewer++ v0.8.2.25525
The CommonMark spec Example 306 shows the HTML to be generated for loose lists, which follows. It is the addition of the <p>
tags that are used for loose lists:
<ul>
<li>
<p>foo</p>
</li>
<li>
<p>bar</p>
</li>
<li>
<p>baz</p>
</li>
</ul>
Try that in a mainstream web browser. Courtesy of GitHub markdown support, the following should show the result in whatever browser one happens to be viewing this bug report with:
foo
bar
baz
Then paste that very same block of HTML into a markdown file for MarkdownViewer++ to render and one will see it rendered incorrectly (line break between list markers and text). I think this suggests a bug in the embedded HTML renderer in MarkdownViewer++ rather than in the markdown-to-HTML conversion stage.
Issue description
Numbered lists have line breaks after the numbers
Markdown to reproduce
Screenshot
This is what the VSCode preview shows ( I believe correctly)
This is what MarkdownViewerPlusPlus displays (I believe incorrectly
Environment