xoofx / xoofx/markdig

Definition Lists and number of spaces

Open
#384 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug PR Welcome!
Dominant language
C#
Stars
5.3k
Forks
510
Avg merge
8d 5h
Merged PRs (30d)
5

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two definition-list examples from the issue with Markdig and compare their rendered output with the referenced Babelmark results. Determine the intended spacing behavior, then add regression coverage for the agreed syntax and confirm that the affected definitions render correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, markdown
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.