[GH-ISSUE #1736] Ordered lists should be allowed variable number of spaces after prefixes #2591

Open
opened 2026-03-07 20:09:09 +03:00 by kerem · 5 comments
Owner

Originally created by @gspencergoog on GitHub (Sep 2, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1736

When an ordered list is formatted as so:

1.  one
2.  two
3.  three
4.  four
5.  five
6.  six
7.  seven
8.  eight
9.  nine
10. ten
11. eleven

Where there are two spaces after items 1-9, and only one after 10 and 11, Markdownlint will mark the lines with items 1-9 with the error:

MD030/list-marker-space: Spaces after list markers [Expected: 1; Actual: 2]markdownlintMD030`

This indentation scheme is common, since it aligns the start of the item text in lists with more than nine items. A generalized lint might allow as many spaces as there are digits in the number of max items minus the number of digits in the current item, plus the value of ol_multi.

I think a new style option for MD030 might be in order to allow this, or at least a way to specify a range for allowed number of spaces for ordered lists.

Originally created by @gspencergoog on GitHub (Sep 2, 2025). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1736 When an ordered list is formatted as so: ```md 1. one 2. two 3. three 4. four 5. five 6. six 7. seven 8. eight 9. nine 10. ten 11. eleven ``` Where there are two spaces after items 1-9, and only one after 10 and 11, Markdownlint will mark the lines with items 1-9 with the error: `MD030/list-marker-space: Spaces after list markers [Expected: 1; Actual: 2]markdownlint`[`MD030`](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md030.md)` This indentation scheme is common, since it aligns the start of the item text in lists with more than nine items. A generalized lint might allow as many spaces as there are digits in the number of max items minus the number of digits in the current item, plus the value of `ol_multi`. I think a new style option for MD030 might be in order to allow this, or at least a way to specify a range for allowed number of spaces for ordered lists.
Author
Owner

@DavidAnson commented on GitHub (Sep 3, 2025):

I think I prefer the “leading spaces” style shown here which is already supported: https://github.com/DavidAnson/markdownlint/blob/main/test/list-item-prefix-alignment.md

<!-- gh-comment-id:3247289361 --> @DavidAnson commented on GitHub (Sep 3, 2025): I think I prefer the “leading spaces” style shown here which is already supported: https://github.com/DavidAnson/markdownlint/blob/main/test/list-item-prefix-alignment.md
Author
Owner

@gspencergoog commented on GitHub (Sep 3, 2025):

I think I prefer the “leading spaces” style shown here which is already supported: main/test/list-item-prefix-alignment.md

TBH, so do I, but LLMs (at least Gemini) seem to prefer this output format, and I have to turn off MD030 entirely if I don't want to constantly be fixing them or seeing warnings, and that means I sometimes miss other violations of this lint.

For me, having an auto-fix for MD030 that would fix the number of spaces would be almost as good: I already apply auto-fixes routinely, and the main one that I have to fix manually is this one.

<!-- gh-comment-id:3247332623 --> @gspencergoog commented on GitHub (Sep 3, 2025): > I think I prefer the “leading spaces” style shown here which is already supported: [main/test/list-item-prefix-alignment.md](https://github.com/DavidAnson/markdownlint/blob/main/test/list-item-prefix-alignment.md?rgh-link-date=2025-09-03T00%3A57%3A45.000Z) TBH, so do I, but LLMs (at least Gemini) seem to prefer this output format, and I have to turn off MD030 entirely if I don't want to constantly be fixing them or seeing warnings, and that means I sometimes miss other violations of this lint. For me, having an auto-fix for MD030 that would fix the number of spaces would be almost as good: I already apply auto-fixes routinely, and the main one that I have to fix manually is this one.
Author
Owner

@network-charles commented on GitHub (Oct 1, 2025):

@gspencergoog, you can prompt gemini to produce the output using leading spaces.

Some writers using the extended markdown (MDX) in combination with this linter, type a list manually. Unlike the regular .md format, new numbers aren’t generated for each new lines.

<!-- gh-comment-id:3355146982 --> @network-charles commented on GitHub (Oct 1, 2025): @gspencergoog, you can prompt gemini to produce the output using leading spaces. Some writers using the extended markdown (MDX) in combination with this linter, type a list manually. Unlike the regular .md format, new numbers aren’t generated for each new lines.
Author
Owner

@gspencergoog commented on GitHub (Oct 1, 2025):

you can prompt gemini to produce the output using leading spaces.

I have tried this (even before I filed this issue), and it says it will, and then ignores the instructions. I think it is embedded in the training data too strongly.

<!-- gh-comment-id:3356999828 --> @gspencergoog commented on GitHub (Oct 1, 2025): > you can prompt gemini to produce the output using leading spaces. I have tried this (even before I filed this issue), and it says it will, and then ignores the instructions. I think it is embedded in the training data too strongly.
Author
Owner

@network-charles commented on GitHub (Oct 1, 2025):

I guess so. ChatGPT works.

https://chatgpt.com/s/t_68dd70acebc4819197e1122423012d1d

I don't think this enhancement is scalable. Like I previously mentioned, it’ll affect the extended markdown users.

<!-- gh-comment-id:3357572722 --> @network-charles commented on GitHub (Oct 1, 2025): I guess so. ChatGPT works. https://chatgpt.com/s/t_68dd70acebc4819197e1122423012d1d I don't think this enhancement is scalable. Like I previously mentioned, it’ll affect the extended markdown users.
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#2591
No description provided.