[GH-ISSUE #480] MD029/ol-prefix - Ordered list item prefix not detected in sublist #394

Closed
opened 2026-03-03 01:26:33 +03:00 by kerem · 3 comments
Owner

Originally created by @ogmios-voice on GitHub (Jan 17, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/480

In the following example instead of MD029/ol-prefix MD037/no-space-in-emphasis is reported (for every other line):

# text

* text
    2. text
        * text
        * text
        * text
        * text
Originally created by @ogmios-voice on GitHub (Jan 17, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/480 In the following example instead of MD029/ol-prefix MD037/no-space-in-emphasis is reported (for every other line): ``` # text * text 2. text * text * text * text * text ```
kerem 2026-03-03 01:26:33 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Jan 17, 2022):

(The list items are indented more than necessary, but that is not the issue.)

CommonMark does not allow an ordered list to interrupt a paragraph unless it begins with the number 1. There is an example here in the specification and the explanation is just above: https://spec.commonmark.org/0.30/#example-304

Your example is therefore interpreted as a single unordered list item with asterisk characters embedded and so the errors you see reported are legitimate: https://dlaa.me/markdownlint/#%25m%23%20Issue%20480%0A%0A*%20text%0A%20%20%20%202.%20text%0A%20%20%20%20%20%20%20%20*%20text%0A%20%20%20%20%20%20%20%20*%20text%0A%20%20%20%20%20%20%20%20*%20text%0A%20%20%20%20%20%20%20%20*%20text%0A

Changing the 2 to a 1 in your example renders as expected and reports no errors.

<!-- gh-comment-id:1014818825 --> @DavidAnson commented on GitHub (Jan 17, 2022): (The list items are indented more than necessary, but that is not the issue.) CommonMark does not allow an ordered list to interrupt a paragraph unless it begins with the number 1. There is an example here in the specification and the explanation is just above: https://spec.commonmark.org/0.30/#example-304 Your example is therefore interpreted as a single unordered list item with asterisk characters embedded and so the errors you see reported are legitimate: https://dlaa.me/markdownlint/#%25m%23%20Issue%20480%0A%0A*%20text%0A%20%20%20%202.%20text%0A%20%20%20%20%20%20%20%20*%20text%0A%20%20%20%20%20%20%20%20*%20text%0A%20%20%20%20%20%20%20%20*%20text%0A%20%20%20%20%20%20%20%20*%20text%0A Changing the 2 to a 1 in your example renders as expected and reports no errors.
Author
Owner

@ogmios-voice commented on GitHub (Jan 19, 2022):

Yes, changing 2 to 1 fixes the issue, but the reported errors basically do not state anything about this.
Also is there a way to continue an ordered list from a given number (>1)? (e.g. using some html tags / comments)

<!-- gh-comment-id:1016005468 --> @ogmios-voice commented on GitHub (Jan 19, 2022): Yes, changing 2 to 1 fixes the issue, but the reported errors basically do not state anything about this. Also is there a way to continue an ordered list from a given number (>1)? (e.g. using some html tags / comments)
Author
Owner

@DavidAnson commented on GitHub (Jan 19, 2022):

I agree it would be nice if the tool could figure out all of the ways that Markdown might not do what the author intended, but in this case viewing the rendered output is a good clue about what's going wrong with the list definition.

For your question, please have a look at the discussion in #340 regarding starting a list at a different number.

<!-- gh-comment-id:1016018031 --> @DavidAnson commented on GitHub (Jan 19, 2022): I agree it would be nice if the tool could figure out all of the ways that Markdown might not do what the author intended, but in this case viewing the rendered output is a good clue about what's going wrong with the list definition. For your question, please have a look at the discussion in #340 regarding starting a list at a different number.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#394
No description provided.