Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Move Markdown list parsing closer to CommonMark #3511
Currently we follow the 4-space rule. It would be good to switch to the CommonMark rule for nested list content, which is a bit more complex but allows more flexibility. Well-formatted 4-space rule lists should still work with no changes, but we'd also be able to handle 2-space indented sublists, for example. (See many closed bug reports relating to this...#3125 #2367 #2575 #2210 #1990 #1137 #744 #172 #137 #128.)
There'd be some danger of breakage of existing documents when indented code blocks are used inside list items. Currently these need to be indented 8 spaces relative to the outer list. With the CommonMark rule, the indentation needed depends on where the list content begins after the list marker. So, if you had a list like
which pandoc currently interprets as
with the CommonMark rules you'd get
with two extra spaces at the beginning of the code. But if you had
you'd be fine, it would render the same.
All in all, I think the risk of breaking some existing documents is outweighed by the benefits of rendering nested lists where people clearly expect them, and reducing unexpected surprises when moving between Markdown implementations.