mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 01:05:55 +03:00
[GH-ISSUE #1736] Ordered lists should be allowed variable number of spaces after prefixes #743
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#743
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
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.
@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
@gspencergoog commented on GitHub (Sep 3, 2025):
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.
@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.
@gspencergoog commented on GitHub (Oct 1, 2025):
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.
@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.