bikeshed icon indicating copy to clipboard operation
bikeshed copied to clipboard

Allow mixing of <li> and * (and similar for dl)

Open tabatkins opened this issue 3 years ago • 1 comments

Right now, you have to choose ahead of time whether you want a list to be written in Markdown or HTML, and all the items have to be written that way. This means if you're using Markdown syntax for its conciseness, you can't flip back into HTML to, say, put an ID on an li; you'd have to go back and rewrite the entire list into HTML markup.

I'm not interested in adding the Markdown Extra syntax letting you put attributes/etc on list items (it's okay on headings, but weird and hard to read on other elements), so instead I should just let you use literal li inside of Markdown lists (and literal dt/dd inside of dl).

This would be consistent with the existing behavior that allows you to wrap a Markdown list in an HTML ul/ol/dl tag, if you need to apply attributes to it.

Apparently some people are currently using a workaround for this, where an indented li can be used so the Markdown parser treats it as a child of the preceding li, but then the HTML parser triggers auto-close behavior and makes it a sibling. This hack is clever, but shouldn't be needed, especially since it requires some weird additional indentation.

tabatkins avatar Nov 30 '21 21:11 tabatkins

See also #1405.

xfq avatar Dec 09 '21 05:12 xfq