markdownlint
markdownlint copied to clipboard
Question: Is it possible to enforce indent of multiline list item?
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
Not today, but a new rule could do this.
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.
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
👀
@DavidAnson Or perhaps a new parameter for MD005/indentation? 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).