Extra space after list item is placing contents in code block #680

Closed
opened 2026-01-29 14:42:51 +00:00 by claunia · 1 comment
Owner

Originally created by @Matt-Scheetz on GitHub (Jun 5, 2024).

Rendering LLM output (gpt-4o) and I've observed the contents after the header for a numbered list item is getting placed in a code block (See content after 10):
image

Looking at the raw text and I see that there is an extra space between the Numbered header and the content
image

As the images states there are 4 spaces after 10 and 3 spaces after all other numbered headers.

When I pasted the raw text to have it rendered and remove the extra space, the text renders without the code block:
image

Using Markdig v 0.36.2

Originally created by @Matt-Scheetz on GitHub (Jun 5, 2024). Rendering LLM output (gpt-4o) and I've observed the contents after the header for a numbered list item is getting placed in a code block (See content after 10): ![image](https://github.com/xoofx/markdig/assets/120581026/922a237d-136c-4da9-944c-0740276bfe1b) Looking at the raw text and I see that there is an extra space between the Numbered header and the content ![image](https://github.com/xoofx/markdig/assets/120581026/8acf838c-6fb9-40b4-bd3a-7cce8b741c1d) As the images states there are 4 spaces after 10 and 3 spaces after all other numbered headers. When I pasted the raw text to have it rendered and remove the extra space, the text renders without the code block: ![image](https://github.com/xoofx/markdig/assets/120581026/b52beae0-2980-46ff-9fd9-0ebdb2508eb0) Using Markdig v 0.36.2
claunia added the wontfix label 2026-01-29 14:42:51 +00:00
Author
Owner

@xoofx commented on GitHub (Jun 6, 2024):

There is not much we can do. Their Markdown output is invalid CommonMark, as 4 spaces will always result in a code block as per the spec here.

You can try it here on GitHub and it will be the same:

    - *Description*: too bad
    - Hello world

Will give you this, similar to markdig:

- *Description*: too bad
- Hello world
@xoofx commented on GitHub (Jun 6, 2024): There is not much we can do. Their Markdown output is invalid CommonMark, as 4 spaces will always result in a code block as per the spec [here](https://spec.commonmark.org/0.31.2/#indented-chunk). You can try it here on GitHub and it will be the same: ```md - *Description*: too bad - Hello world ``` Will give you this, similar to markdig: - *Description*: too bad - Hello world
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#680