mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Definition Lists and number of spaces #340
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RickStrahl on GitHub (Jan 3, 2020).
I haven't looked at this in a long while but I notice that definition lists require multiple spaces (3) after the colon to work.
In the following markdown the first block works, the second block does not:
Babelmark seems inconclusive on this with a whole bunch of parsers (including Markdig in that test) failing to render either block:
https://babelmark.github.io/?text=%23+Test+Item%0A%0AFirst+Term%0A%3A+++This+is+the+definition+of+the+first+term.%0A%0ASecond+Term%0A%3A+++This+is+one+definition+of+the+second+term.%0A%3A+++Continues+previous+term%0A%0A---%0A%0AFirst+Term%0A%3A+This+is+the+definition+of+the+first+term.%0A%3A+This+is+the+definition+of+the+first+term.%0A%0ASecond+Term%0A%3A+This+is+one+definition+of+the+second+term.%0A%3A+This+is+another+definition+of+the+second+term.%0A
and quite a few - including PanDoc parsing both blocks.
All parsers seem to recognize the Definition List though because all parsers are generating the headers properly - it's the sub items that are falling through.
Is there a reason that Markdig requires the extra spaces? The parsers that do render the list properly don't require the extra spaces.
@xoofx commented on GitHub (Jan 21, 2020):
I don't remember why. Maybe that was an oversight.
@mlaily commented on GitHub (Apr 27, 2020):
It might just be because this feature seems to have been inspired by pandoc and they do it like that...
@madskristensen commented on GitHub (May 12, 2025):
This website also states that it should work with just a single space character