[GH-ISSUE #930] MD013: Add override for lists #2406

Closed
opened 2026-03-07 20:07:28 +03:00 by kerem · 4 comments
Owner

Originally created by @lonix1 on GitHub (Aug 12, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/930

MD013 has overrides for tables, headings, code blocks, etc.

But not for lists:

- hello
- world
- asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
- foo bar baz

It's common to have a paragraph as a bullet point. (Regrettably github doesn't render it nicely above, but in other tools it would be wrapped.)

That list inherits the 80 char limit. It would be nice to break the rule for lists, without changing the 80 value (which is good, in general).

Originally created by @lonix1 on GitHub (Aug 12, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/930 [MD013](https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md) has overrides for tables, headings, code blocks, etc. But not for lists: ```md - hello - world - asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf - foo bar baz ``` It's common to have a paragraph as a bullet point. (Regrettably github doesn't render it nicely above, but in other tools it would be wrapped.) That list inherits the 80 char limit. It would be nice to break the rule for lists, without changing the 80 value (which is good, in general).
kerem 2026-03-07 20:07:28 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Aug 12, 2023):

The exceptions you list exist mainly because it may not be possible to limit their width. For example, table rows need to be on a single line or else it breaks the table structure. However, that is not the case for list items which behave the same as normal text. If someone wants to limit text to 80 columns, I don't see why they would want to allow list items to extend further when they could be wrapped at 80 columns just as easily. What's the scenario you have in mind here?

<!-- gh-comment-id:1675989854 --> @DavidAnson commented on GitHub (Aug 12, 2023): The exceptions you list exist mainly because it may not be possible to limit their width. For example, table rows need to be on a single line or else it breaks the table structure. However, that is not the case for list items which behave the same as normal text. If someone wants to limit text to 80 columns, I don't see why they would want to allow list items to extend further when they could be wrapped at 80 columns just as easily. What's the scenario you have in mind here?
Author
Owner

@lonix1 commented on GitHub (Aug 13, 2023):

If it's 80 chars then it's a line, whereas if it's x chars then it's a paragraph.

e.g.

- hello
- world
- asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
- foo bar baz

vs

- hello
- world
- asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 
- asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 
- asdf asdf asdf asdf
- foo bar baz

(Which of course is wrong because that should be one bullet point, not three).

I take your point about tables, that makes sense. If out of scope, please close. Thanks for considering it.

<!-- gh-comment-id:1676203746 --> @lonix1 commented on GitHub (Aug 13, 2023): If it's 80 chars then it's a line, whereas if it's x chars then it's a paragraph. e.g. ```md - hello - world - asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf - foo bar baz ``` vs ```md - hello - world - asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf - asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf - asdf asdf asdf asdf - foo bar baz ``` (Which of course is wrong because that should be one bullet point, not three). I take your point about tables, that makes sense. If out of scope, please close. Thanks for considering it.
Author
Owner

@DavidAnson commented on GitHub (Aug 13, 2023):

I don't think I understand. The following produces a three-item list with wrapping at 14 (or so) columns. I expect a similar approach to work for most lists.

- One
- Two two two
  two two two
  two two
- Three
<!-- gh-comment-id:1676221793 --> @DavidAnson commented on GitHub (Aug 13, 2023): I don't think I understand. The following produces a three-item list with wrapping at 14 (or so) columns. I expect a similar approach to work for most lists. ```md - One - Two two two two two two two two - Three ```
Author
Owner

@lonix1 commented on GitHub (Aug 13, 2023):

Thanks, I didn't realise the linter allows that syntax! 😄

<!-- gh-comment-id:1676286336 --> @lonix1 commented on GitHub (Aug 13, 2023): Thanks, I didn't realise the linter allows that syntax! :smile:
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#2406
No description provided.