[GH-ISSUE #38] MD029 (ol-prefix) and nested unordered lists in ordered lists #1877

Closed
opened 2026-03-07 20:02:21 +03:00 by kerem · 2 comments
Owner

Originally created by @EvgenyOrekhov on GitHub (Dec 5, 2016).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/38

If I use the following rule:

{
    "ol-prefix": {
        "style": "ordered"
    }
}

then markdownlint says "Ordered list item prefix (Expected: 1; Actual: 2)" to the following code:

1. a
- b
2. c
- d

It looks like markdownlint thinks that 2. c is the beginning of a new list, but it's the second item of the single ordered list.

If I indent the unordered lists, markdownlint says "Consider starting bulleted lists at the beginning of the line".

What is the correct way of using nested unordered lists in ordered lists?

Originally created by @EvgenyOrekhov on GitHub (Dec 5, 2016). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/38 If I use the following rule: ```json { "ol-prefix": { "style": "ordered" } } ``` then markdownlint says "Ordered list item prefix (Expected: 1; Actual: 2)" to the following code: ```md 1. a - b 2. c - d ``` It looks like markdownlint thinks that `2. c` is the beginning of a new list, but it's the second item of the single ordered list. If I indent the unordered lists, markdownlint says "Consider starting bulleted lists at the beginning of the line". What is the correct way of using nested unordered lists in ordered lists?
kerem 2026-03-07 20:02:21 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Dec 5, 2016):

When indenting, did you use three spaces? The following should do what you want:

1. a
   - b
2. c
   - d

Markers for nested lists should begin under the text of the previous item - for numbered lists that's typically 3 vs. 2 spaces.

You can play around interactively here to see that markdown-it doesn't recognize the nested lists with just 2 spaces: https://dlaa.me/markdownlint/

<!-- gh-comment-id:264942883 --> @DavidAnson commented on GitHub (Dec 5, 2016): When indenting, did you use three spaces? The following should do what you want: ``` 1. a - b 2. c - d ``` Markers for nested lists should begin under the text of the previous item - for numbered lists that's typically 3 vs. 2 spaces. You can play around interactively here to see that `markdown-it` doesn't recognize the nested lists with just 2 spaces: https://dlaa.me/markdownlint/
Author
Owner

@EvgenyOrekhov commented on GitHub (Dec 6, 2016):

@DavidAnson thanks!

<!-- gh-comment-id:265106706 --> @EvgenyOrekhov commented on GitHub (Dec 6, 2016): @DavidAnson thanks!
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#1877
No description provided.