#40136·zulip

`MarkdownListPreprocessor` creates the wrong HTML structure when a nested list is of a different type than its parent list.

Author: PieterCKCreated Sep 15, 2026Updated Sep 17, 2026
Labelsarea: markdowncore team candidate

MarkdownListPreprocessor doesn't consider nested list with a different list type. It will insert extraneous blank lines in between nested lists and its parent if they're different types. This doesn't create much visual difference, but the parent list item will be wrapped with unnecessary <p> tag.

text (correct):

1. Parent item\n  1. nested bullet

rendered:

<ol>
<li>Parent item<ul>
<li>nested bullet</li>
</ul>
</li>
</ol>

text (bug):

1. Parent item\n  * nested bullet

rendered:

<ol>
<li>
<p>Parent item</p>
<ul>
<li>nested bullet</li>
</ul>
</li>
</ol>

CommonMark's output: https://spec.commonmark.org/dingus/?text=1.%20Parent%20item%0A%20%20%20*%20nested%20bullet

<ol>
<li>Parent item<ul>
<li>nested bullet</li>
</ul>
</li>
</ol>