[GH-ISSUE #531] MD029 ordered list items: combining two modes #434

Closed
opened 2026-03-03 01:26:53 +03:00 by kerem · 6 comments
Owner

Originally created by @iamtodor on GitHub (Jun 5, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/531

Following this answer https://github.com/DavidAnson/markdownlint/issues/45#issuecomment-277859620
Does it mean that I am not able to combine both types?
For instance, I have the following project structure

tree -L 2
.
├── README.md
├── task1
│   ├── README.md
├── task2
│   ├── README.md
├── task3
│   ├── README.md
└── task4
    ├── README.md

For some reason I'd like in task1/README.md to follow an unordered list, however in task2/README.md I need to have an ordered list.

Is it possible to combine both checks? I also took a look at https://github.com/DavidAnson/markdownlint/issues/45 but I didn't find

Originally created by @iamtodor on GitHub (Jun 5, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/531 Following this answer https://github.com/DavidAnson/markdownlint/issues/45#issuecomment-277859620 Does it mean that I am not able to combine both types? For instance, I have the following project structure ``` tree -L 2 . ├── README.md ├── task1 │   ├── README.md ├── task2 │   ├── README.md ├── task3 │   ├── README.md └── task4 ├── README.md ``` For some reason I'd like in `task1/README.md` to follow an unordered list, however in `task2/README.md` I need to have an ordered list. Is it possible to combine both checks? I also took a look at https://github.com/DavidAnson/markdownlint/issues/45 but I didn't find
kerem 2026-03-03 01:26:53 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Jun 5, 2022):

You can apply different configuration for each file via --config.

Or you can customize within a file via <!-- markdownlint-configure-file { JSON } -->.

<!-- gh-comment-id:1146849858 --> @DavidAnson commented on GitHub (Jun 5, 2022): You can apply different configuration for each file via `--config`. Or you can customize within a file via `<!-- markdownlint-configure-file { JSON } -->`.
Author
Owner

@iamtodor commented on GitHub (Jun 5, 2022):

@DavidAnson in this case I need to mention each README.md file in the config, right?

<!-- gh-comment-id:1146870901 --> @iamtodor commented on GitHub (Jun 5, 2022): @DavidAnson in this case I need to mention each `README.md` file in the config, right?
Author
Owner

@iamtodor commented on GitHub (Jun 5, 2022):

This example

1. Major point
2. Major point
    - minor point
    - minor point
3. Major point

Would not pass in any case, right?

<!-- gh-comment-id:1146874305 --> @iamtodor commented on GitHub (Jun 5, 2022): This example ``` 1. Major point 2. Major point - minor point - minor point 3. Major point ``` Would not pass in any case, right?
Author
Owner

@DavidAnson commented on GitHub (Jun 5, 2022):

This is an example of configuring within a file: https://raw.githubusercontent.com/DavidAnson/markdownlint/main/test/inline-configure-file-multiple-lines.md

None of the default settings would encourage that extra space in front of the unordered list item markers.

<!-- gh-comment-id:1146879274 --> @DavidAnson commented on GitHub (Jun 5, 2022): This is an example of configuring within a file: https://raw.githubusercontent.com/DavidAnson/markdownlint/main/test/inline-configure-file-multiple-lines.md None of the default settings would encourage that extra space in front of the unordered list item markers.
Author
Owner

@iamtodor commented on GitHub (Jun 5, 2022):

@DavidAnson None of the default settings would encourage that extra space in front of the unordered list item markers I have the feeling that I use this tool in the wrong way, do I?
I found that if I need to create an inner list I should use 4 spaces here https://stackoverflow.com/a/37594372/5151861 and https://www.markdownguide.org/basic-syntax/#ordered-lists ?

<!-- gh-comment-id:1146881209 --> @iamtodor commented on GitHub (Jun 5, 2022): @DavidAnson `None of the default settings would encourage that extra space in front of the unordered list item markers` I have the feeling that I use this tool in the wrong way, do I? I found that if I need to create an inner list I should use 4 spaces here https://stackoverflow.com/a/37594372/5151861 and https://www.markdownguide.org/basic-syntax/#ordered-lists ?
Author
Owner

@DavidAnson commented on GitHub (Jun 5, 2022):

Per the specification, content of a list item should match that of the list item marker and the spaces that follow. Typically, that means aligning everything to match the start of content of the first line. There is no magic number like 3 or 4 because markers can be longer or extra spaces may be used. There are other approaches that can be used, but this is the default and what this tool expects.

https://spec.commonmark.org/0.30/#list-items

<!-- gh-comment-id:1146883271 --> @DavidAnson commented on GitHub (Jun 5, 2022): Per the specification, content of a list item should match that of the list item marker and the spaces that follow. Typically, that means aligning everything to match the start of content of the first line. There is no magic number like 3 or 4 because markers can be longer or extra spaces may be used. There are other approaches that can be used, but this is the default and what this tool expects. https://spec.commonmark.org/0.30/#list-items
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#434
No description provided.