mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #216] Trailing whitespace that could produce a hard break but won't due to context should also be flagged by MD009 #2034
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#2034
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 @TheJaredWilcurt on GitHub (Aug 25, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/216
There are two spaces on the 3rd line that should be flagged as trailing whitespace.
Here are the rules I'm using, in case I have something set wrong:
Here it is again, but with the spaces replaced by hearts to make it easier to see
@DavidAnson commented on GitHub (Aug 25, 2019):
Exactly 2 trailing spaces has a special meaning in Markdown. If you change your example to just one space or three+, MD009 will fire as expected. You can use the
br_spacesperimeter to report issues for two spaces as well. More detail is available in the documentation here: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md009---trailing-spaces@TheJaredWilcurt commented on GitHub (Aug 26, 2019):
I understand the 2 spaces being a
<br>, but that should only be at the end of a line with content.In this context, it is obvious that it is an indentation placed by the editor and would not be interpreted to produce a
<br>. It is continuing the indentation of the previous line.When it's an empty line, with nothing but spaces, in the middle of a list, it should let you auto-flag that.
@DavidAnson commented on GitHub (Aug 26, 2019):
Using the
br_spacesparameter I reference above should report for your original example.MD009 could also be enhanced to understand scenarios where trailing spaces do not insert a hard break and report on that in the default configuration. Is that what you are looking for?
Context: https://spec.commonmark.org/0.29/#hard-line-breaks
@TheJaredWilcurt commented on GitHub (Aug 27, 2019):
Yes, that is what I want. I'd like it to flag where trailing spaces are used but do not produce a
<br>.