List separation #560

Open
opened 2026-01-29 14:39:45 +00:00 by claunia · 0 comments
Owner

Originally created by @pm64 on GitHub (Sep 20, 2022).

I'm likely just misunderstanding the syntax -- but if Markdown text contains lists separated by a blank line, should they not be rendered as separate lists in the HTML? Using the following Markdown, for example:

- List 1, item 1
- List 1, item 2

- List 2, item 1
- List 2, item 2

And rendering as follows:

MarkdownPipeline pipeline = new MarkdownPipelineBuilder()
		.UseAdvancedExtensions()
		.Build();

var md = @"- List 1, item 1
- List 1, item 2

- List 2, item 1
- List 2, item 2";

var html = Markdown.ToHtml(md, pipeline);

Result:

<ul>
<li><p>List 1, item 1</p>
</li>
<li><p>List 1, item 2</p>
</li>
<li><p>List 2, item 1</p>
</li>
<li><p>List 2, item 2</p>
</li>
</ul>

(Expected result:)

<ul>
<li><p>List 1, item 1</p>
</li>
<li><p>List 1, item 2</p>
</li>
</ul>
<ul>
<li><p>List 2, item 1</p>
</li>
<li><p>List 2, item 2</p>
</li>
</ul>
Originally created by @pm64 on GitHub (Sep 20, 2022). I'm likely just misunderstanding the syntax -- but if Markdown text contains lists separated by a blank line, should they not be rendered as separate lists in the HTML? Using the following Markdown, for example: ``` - List 1, item 1 - List 1, item 2 - List 2, item 1 - List 2, item 2 ``` And rendering as follows: ``` MarkdownPipeline pipeline = new MarkdownPipelineBuilder() .UseAdvancedExtensions() .Build(); var md = @"- List 1, item 1 - List 1, item 2 - List 2, item 1 - List 2, item 2"; var html = Markdown.ToHtml(md, pipeline); ``` Result: ``` <ul> <li><p>List 1, item 1</p> </li> <li><p>List 1, item 2</p> </li> <li><p>List 2, item 1</p> </li> <li><p>List 2, item 2</p> </li> </ul> ``` (Expected result:) ``` <ul> <li><p>List 1, item 1</p> </li> <li><p>List 1, item 2</p> </li> </ul> <ul> <li><p>List 2, item 1</p> </li> <li><p>List 2, item 2</p> </li> </ul> ```
claunia added the invalid label 2026-01-29 14:39:45 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#560