Definition Lists and number of spaces #340

Open
opened 2026-01-29 14:34:14 +00:00 by claunia · 3 comments
Owner

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:

First Term
:   This is the definition of the first term.

Second Term
:   This is one definition of the second term.
:   Continues previous term

---

First Term
: This is the definition of the first term.
: This is the definition of the first term.

Second Term
: This is one definition of the second term.
: This is another definition of the second term.

image

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.

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: ```md First Term : This is the definition of the first term. Second Term : This is one definition of the second term. : Continues previous term --- First Term : This is the definition of the first term. : This is the definition of the first term. Second Term : This is one definition of the second term. : This is another definition of the second term. ``` ![image](https://user-images.githubusercontent.com/1374013/71703073-e33c6b80-2d76-11ea-9d00-cc48ed819bae.png) 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.
claunia added the bugPR Welcome! labels 2026-01-29 14:34:14 +00:00
Author
Owner

@xoofx commented on GitHub (Jan 21, 2020):

Is there a reason that Markdig requires the extra spaces? The parsers that do render the list properly don't require the extra spaces.

I don't remember why. Maybe that was an oversight.

@xoofx commented on GitHub (Jan 21, 2020): > Is there a reason that Markdig requires the extra spaces? The parsers that do render the list properly don't require the extra spaces. I don't remember why. Maybe that was an oversight.
Author
Owner

@mlaily commented on GitHub (Apr 27, 2020):

Is there a reason that Markdig requires the extra spaces? The parsers that do render the list properly don't require the extra spaces.

It might just be because this feature seems to have been inspired by pandoc and they do it like that...

@mlaily commented on GitHub (Apr 27, 2020): > Is there a reason that Markdig requires the extra spaces? The parsers that do render the list properly don't require the extra spaces. It might just be because this feature seems to have been inspired by [pandoc](https://pandoc.org/MANUAL.html#definition-lists) and they do it like that...
Author
Owner

@madskristensen commented on GitHub (May 12, 2025):

This website also states that it should work with just a single space character

@madskristensen commented on GitHub (May 12, 2025): [This website](https://www.markdownguide.org/extended-syntax/#definition-lists) also states that it should work with just a single space character
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#340