[GH-ISSUE #344] Question: Is it possible to enforce indent of multiline list item? #296

Open
opened 2026-03-03 01:25:30 +03:00 by kerem · 5 comments
Owner

Originally created by @ozkriff on GitHub (Nov 5, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/344

Is it possible to enforce the indentation of subsequent list item lines?

Like this

- text
  text
  text
- text
  text
  text

instead of

- text
text
text
- text
text
text
Originally created by @ozkriff on GitHub (Nov 5, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/344 Is it possible to enforce the indentation of subsequent list item lines? Like this ```markdown - text text text - text text text ``` instead of ```markdown - text text text - text text text ```
Author
Owner

@DavidAnson commented on GitHub (Nov 5, 2020):

Not today, but a new rule could do this.

<!-- gh-comment-id:722491347 --> @DavidAnson commented on GitHub (Nov 5, 2020): Not today, but a new rule could do this.
Author
Owner

@scottamain commented on GitHub (Dec 22, 2022):

Yes, making multiline list indentations consistent would be great, including over-indented lines.

This is an exaggeration, but it would be great if markdownlint could spot this inconsistency:

* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquam,
est nec feugiat
  pharetra, arcu neque mattis turpis, a egestas nibh quam sit amet mi.
   Suspendisse et nulla mauris. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. 
<!-- gh-comment-id:1363220751 --> @scottamain commented on GitHub (Dec 22, 2022): Yes, making multiline list indentations consistent would be great, including over-indented lines. This is an exaggeration, but it would be great if markdownlint could spot this inconsistency: ``` * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquam, est nec feugiat pharetra, arcu neque mattis turpis, a egestas nibh quam sit amet mi. Suspendisse et nulla mauris. Lorem ipsum dolor sit amet, consectetur adipiscing elit. ```
Author
Owner

@scottamain commented on GitHub (Dec 22, 2022):

FYI, I now realize that the auto-fix for MD007 actually causes this problem a bit, because a list item goes from this (extra list indentation):

  * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquam,
    est nec feugiat

To this:

* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquam,
    est nec feugiat
<!-- gh-comment-id:1363228042 --> @scottamain commented on GitHub (Dec 22, 2022): FYI, I now realize that the auto-fix for MD007 actually causes this problem a bit, because a list item goes from this (extra list indentation): ``` * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquam, est nec feugiat ``` To this: ``` * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquam, est nec feugiat ```
Author
Owner

@pwalleni commented on GitHub (Jan 5, 2023):

👀

<!-- gh-comment-id:1372513572 --> @pwalleni commented on GitHub (Jan 5, 2023): 👀
Author
Owner

@Ravlen commented on GitHub (Jan 15, 2024):

@DavidAnson Or perhaps a new parameter for MD005/indentation (Edit: or MD007/ul-indent) ? Something like multiline: true/false, which defaults to false so that it's not a breaking change?

indentation:
  multiline: true

I recently ran into a doc with a lot of inconsistency, so I did a search on the full docs set. Unfortunately, due to the number of contributors, I found that we had 1000+ examples of list items where the first line (both unordered and ordered) were aligned properly thanks to MD005, but the subsequent lines had no consistency. For example: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140956/diffs (work not finished, see https://gitlab.com/gitlab-org/gitlab/-/issues/437118).

<!-- gh-comment-id:1891542874 --> @Ravlen commented on GitHub (Jan 15, 2024): @DavidAnson Or perhaps a new parameter for [`MD005/indentation`](https://github.com/DavidAnson/markdownlint/blob/main/doc/md005.md) (Edit: or [`MD007/ul-indent`](https://github.com/DavidAnson/markdownlint/blob/main/doc/md007.md)) ? Something like `multiline: true/false`, which defaults to false so that it's not a breaking change? ```yaml indentation: multiline: true ``` I recently ran into a doc with a lot of inconsistency, so I did a search on the full docs set. Unfortunately, due to the number of contributors, I found that we had 1000+ examples of list items where the first line (both unordered and ordered) were aligned properly thanks to MD005, but the subsequent lines had no consistency. For example: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140956/diffs (work not finished, see https://gitlab.com/gitlab-org/gitlab/-/issues/437118).
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#296
No description provided.