mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #237] MD013 line length rule checking is not strict enough #2052
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2052
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tjanez on GitHub (Nov 27, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/237
Here is a reproducer:
This is the output:
I would want Markdown to return an error since the offending line is 81 characters long.
Only if I set
MD013'sline_lengthparameter to something like75, it starts to show the error. For example, running:Results in:
@DavidAnson commented on GitHub (Nov 27, 2019):
The behavior you describe seems to be this from the documentation: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md013---line-length
Do you agree?
PS - I suppose I could add a
strictparameter to remove the exception.@tjanez commented on GitHub (Nov 27, 2019):
I'm afraid I have trouble understanding that exception. For example, if I would have ordinary text like the one below:
I would expect to get errors that the lines are too long since there is nothing exceptional about them, i.e. they are not long URLs, and they could be easily broken.
Do you agree that it would be hard to argue that all these 4 lines are to be treated as exceptions to line length limit?
@DavidAnson commented on GitHub (Nov 27, 2019):
I didn’t define the rule originally, but I think the “I don’t want to wrap this last thing onto a new line“ scenario comes up more often then you expect (not just with URL’s). As a rule that is meant to be helpful more often than annoying, I think the current implementation is reasonable. That said, I don’t have a problem adding a “strict“ parameter for scenarios like yours where line length is very important.
@tjanez commented on GitHub (Nov 27, 2019):
Ok, I understand your point.
Agreed, that would be a reasonable compromise.
And the docs should be updated to make it clear that default behavior is not strict and that people should set
strict: trueif they want such behavior.@tjanez commented on GitHub (Feb 7, 2020):
I've just tested and used this. Thanks, @DavidAnson!