Markdown does not have explicit markup, but combines adjacent list items into a common, implicitly defined list. HTML, on the other hand, does have <ul>
, <ol>
and more to hold <li>
s.
Commonmark allows literal HTML blocks to contain Markdown if some provisions (blank lines etc.) are followed.
Should a Markdown list item inside an HTML list generate a nested list or should it become a direct child? Dingus
Variant 1: direct child
Authors may find this useful if they wanted to apply attributes to the whole list, e.g. type=a
.
<ul>
- foo
</ul>
.
<ul>
<li>foo</li>
</ul>
Variant 2: naively nested
This is what the reference implementations currently do.
<ul>
- foo
</ul>
.
<ul>
<ul>
<li>foo</li>
</ul>
</ul>
Variant 3: properly nested
<ul>
- foo
</ul>
.
<ul>
<li>
<ul>
<li>foo</li>
</ul>
</li>
</ul>