[GH-ISSUE #514] Possible to disable line length for normal lines but enforce for headers/code blocks? #422

Closed
opened 2026-03-03 01:26:46 +03:00 by kerem · 4 comments
Owner

Originally created by @wgehring-ml on GitHub (Mar 31, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/514

Title says it all, really. I see ways to disable enforcing MD013/line_length on headers/headings, code blocks, and tables but no way to enforce on headers/code blocks and ignore elsewhere.

Is there a way to do this already, and if not could it be added?

Originally created by @wgehring-ml on GitHub (Mar 31, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/514 Title says it all, really. I see ways to disable enforcing `MD013/line_length` on headers/headings, code blocks, and tables but no way to enforce on headers/code blocks and ignore elsewhere. Is there a way to do this already, and if not could it be added?
kerem 2026-03-03 01:26:46 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Mar 31, 2022):

See the docs: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md013

heading_line_length lets you set the length for headings

headings let's you disable for headings

Similar for code and tables (though you can't control table length, just disable).

<!-- gh-comment-id:1085181032 --> @DavidAnson commented on GitHub (Mar 31, 2022): See the docs: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md013 heading_line_length lets you set the length for headings headings let's you disable for headings Similar for code and tables (though you can't control table length, just disable).
Author
Owner

@wgehring-ml commented on GitHub (Apr 1, 2022):

Yes, I saw that, but there's no way to disable the check for normal lines and enforce it on others. As far as I can tell, the closest I can get to actually disabling it is to guess how long my general content lines may become and set the line_length property inside of MD013 to be larger than that.

If that's the answer, that's all well and good but since the rule is using Regex to enforce line length I worry about increasing that value to the point where the rule slows down or freezes.

<!-- gh-comment-id:1085926896 --> @wgehring-ml commented on GitHub (Apr 1, 2022): Yes, I saw that, but there's no way to disable the check for normal lines and enforce it on others. As far as I can tell, the closest I can get to actually disabling it is to guess how long my general content lines may become and set the `line_length` property inside of `MD013` to be larger than that. If that's the answer, that's all well and good but since the rule is using Regex to enforce line length I worry about increasing that value to the point where the rule slows down or freezes.
Author
Owner

@DavidAnson commented on GitHub (Apr 1, 2022):

I've never heard of the RegExp being a problem here. As long as your lines are reasonable lengths, it should bail out when they end anyway.

<!-- gh-comment-id:1086172826 --> @DavidAnson commented on GitHub (Apr 1, 2022): I've never heard of the RegExp being a problem here. As long as your lines are reasonable lengths, it should bail out when they end anyway.
Author
Owner

@wgehring-ml commented on GitHub (Apr 1, 2022):

Alright, thanks for your help.

<!-- gh-comment-id:1086211688 --> @wgehring-ml commented on GitHub (Apr 1, 2022): Alright, thanks for your help.
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#422
No description provided.