[GH-ISSUE #158] Erroneously marks 4 space indentations as warning for unordered lists #124

Closed
opened 2026-03-03 01:23:56 +03:00 by kerem · 6 comments
Owner

Originally created by @poshcodebear on GitHub (Sep 26, 2018).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/158

When working with unordered lists, if I'm using 4 space indentations (as per the spec), it marks them as invalid with [markdownlint] MD007/ul-indent: Unordered list indentation [Expected: 2; Actual: 4].

Example:

- Base item
    - Indented item

Ordered lists, on the other hand, don't get warnings for either 2 or 4 space indentations.

Since 4 spaces is what's specified in the official spec, and it's more that many implementations let you do 2 spaces, I feel this should be corrected to allow 4 spaces without warnings.

Originally created by @poshcodebear on GitHub (Sep 26, 2018). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/158 When working with unordered lists, if I'm using 4 space indentations (as per the spec), it marks them as invalid with ```[markdownlint] MD007/ul-indent: Unordered list indentation [Expected: 2; Actual: 4]```. Example: ```markdown - Base item - Indented item ``` Ordered lists, on the other hand, don't get warnings for either 2 or 4 space indentations. Since 4 spaces is what's specified in the official spec, and it's more that many implementations let you do 2 spaces, I feel this should be corrected to allow 4 spaces without warnings.
kerem 2026-03-03 01:23:56 +03:00
Author
Owner

@DavidAnson commented on GitHub (Sep 26, 2018):

I don’t think it’s quite true that the spec calls for 4 spaces. For that and more discussion of this topic, please see https://github.com/DavidAnson/markdownlint/issues/141 and linked issues.

Sent with GitHawk

<!-- gh-comment-id:424858866 --> @DavidAnson commented on GitHub (Sep 26, 2018): I don’t think it’s quite true that the spec calls for 4 spaces. For that and more discussion of this topic, please see https://github.com/DavidAnson/markdownlint/issues/141 and linked issues. <sub>Sent with <a href="http://githawk.com">GitHawk</a></sub>
Author
Owner

@poshcodebear commented on GitHub (Sep 26, 2018):

It occurs to me that, when searching to see if this was open, I should have also looked for MD007.

Anyway, thanks for pointing that out! I thought the original design spec said 4, but I'll be the first to point out that I can make mistakes :)

Anyway, if there's any way for it to support both, that would be great; maybe have the rule, instead of "x number of spaces on indent" be something like "consistent indentation size through the document"? I have no idea how doable that is or how much processing that would add to the extension, though.

You mentioned in the other thread that this behavior is configurable; I hunted that down and set MD007 to 4 spaces in my VSCode user settings and that seems to have done the trick for me. Maybe a solution could be adding to the tool-tip somehow to hint that it's configurable, maybe with a link to instructions for that?

Anyway, thank you for this extension, it has helped me get a lot better in my markdown :)

<!-- gh-comment-id:424887200 --> @poshcodebear commented on GitHub (Sep 26, 2018): It occurs to me that, when searching to see if this was open, I should have also looked for MD007. Anyway, thanks for pointing that out! I thought the original design spec said 4, but I'll be the first to point out that I can make mistakes :) Anyway, if there's any way for it to support both, that would be great; maybe have the rule, instead of "x number of spaces on indent" be something like "consistent indentation size through the document"? I have no idea how doable that is or how much processing that would add to the extension, though. You mentioned in the other thread that this behavior is configurable; I hunted that down and set MD007 to 4 spaces in my VSCode user settings and that seems to have done the trick for me. Maybe a solution could be adding to the tool-tip somehow to hint that it's configurable, maybe with a link to instructions for that? Anyway, thank you for this extension, it has helped me get a lot better in my markdown :)
Author
Owner

@DavidAnson commented on GitHub (Sep 26, 2018):

Cool, thanks!

Sent with GitHawk

<!-- gh-comment-id:424890910 --> @DavidAnson commented on GitHub (Sep 26, 2018): Cool, thanks! <sub>Sent with <a href="http://githawk.com">GitHawk</a></sub>
Author
Owner

@DavidAnson commented on GitHub (Mar 19, 2019):

Please see #141 for an explanation of why I don’t see a good way to make everyone happy here.

<!-- gh-comment-id:474187299 --> @DavidAnson commented on GitHub (Mar 19, 2019): Please see #141 for an explanation of why I don’t see a good way to make everyone happy here.
Author
Owner

@poshcodebear commented on GitHub (Mar 19, 2019):

I still think adding a note to the tooltip that this is configurable could help, but either way, thank you for pointing me down that avenue.

<!-- gh-comment-id:474394745 --> @poshcodebear commented on GitHub (Mar 19, 2019): I still think adding a note to the tooltip that this is configurable could help, but either way, thank you for pointing me down that avenue.
Author
Owner

@DavidAnson commented on GitHub (Apr 6, 2019):

Follow-up: I've done this in github.com/DavidAnson/vscode-markdownlint@33ee19a243

<!-- gh-comment-id:480531168 --> @DavidAnson commented on GitHub (Apr 6, 2019): Follow-up: I've done this in https://github.com/DavidAnson/vscode-markdownlint/commit/33ee19a243cba0cee96f01075a92a524504b465a
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#124
No description provided.