[GH-ISSUE #1645] MD005 & MD007 - Add a configurable value for the number of spaces required for nested lists #2576

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

Originally created by @sulphi-fox on GitHub (Jun 20, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1645

Current State
There is no ability to configure what markdownlint considers valid indentation for a nested list.

Desired Feature
It would be great to have a configurable value for what is considered valid indentation for nested lists.

Reasoning
Some markdown renderers, such as the one I am using with mkdocs accept two spaces as valid indentation for nested lists - I am currently unable to use MD005 or MD007 as it flags almost all of my lists as invalid / along with the CLI --fix option, it breaks most of my lists.

Originally created by @sulphi-fox on GitHub (Jun 20, 2025). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1645 **Current State** There is no ability to configure what `markdownlint` considers valid indentation for a nested list. **Desired Feature** It would be great to have a configurable value for what is considered valid indentation for nested lists. **Reasoning** Some markdown renderers, such as the one I am using with [mkdocs](https://github.com/mkdocs/mkdocs) accept two spaces as valid indentation for nested lists - I am currently unable to use `MD005` or `MD007` as it flags almost all of my lists as invalid / along with the CLI `--fix` option, it breaks most of my lists.
kerem 2026-03-07 20:09:01 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Jun 20, 2025):

The CommonMark specification explains that list item content must be indented at least as much as the first character of content:
https://spec.commonmark.org/0.31.2/#list-items

For unordered list items, this is typically two spaces whereas for ordered list items, this is typically three spaces (though it can be more for double or triple digits).

This requirement is not specific to nested lists and applies to any content for a list item. As such, I'm not sure if there's anything to do for this issue other than abiding by the specification.

<!-- gh-comment-id:2992698424 --> @DavidAnson commented on GitHub (Jun 20, 2025): The CommonMark specification explains that list item content must be indented at least as much as the first character of content: https://spec.commonmark.org/0.31.2/#list-items For unordered list items, this is typically two spaces whereas for ordered list items, this is typically three spaces (though it can be more for double or triple digits). This requirement is not specific to nested lists and applies to any content for a list item. As such, I'm not sure if there's anything to do for this issue other than abiding by the specification.
Author
Owner

@sulphi-fox commented on GitHub (Jun 20, 2025):

Alright, thanks anyway. I'll keep looking for ways of getting this to work with what I'm using.

<!-- gh-comment-id:2992706887 --> @sulphi-fox commented on GitHub (Jun 20, 2025): Alright, thanks anyway. I'll keep looking for ways of getting this to work with what I'm using.
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#2576
No description provided.