mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #400] Feature request: MD012 (Multiple consecutive blank lines) option to ignore them at the end of file #2180
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#2180
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 @orionlee on GitHub (May 24, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/400
For MD012 (Multiple consecutive blank lines), it'd be great if there is an option to ignore consecutive blank line at the end of a file.
Rationale: for a live file (i.e., actively edited),
Note: to complete the use case, such option needs to be exposed in the correspond editor extension as well, vscode-markdownlint in my use case.
@waldyrious commented on GitHub (May 24, 2021):
You might be interested in https://github.com/microsoft/vscode/issues/56174 :)
@DavidAnson commented on GitHub (May 24, 2021):
Thanks, @waldyrious, it sounds like this is best implemented in the editor - and very nearly supported today.
@orionlee, it seems your only interest here is at edit time, so I'm inclined not to change the linter.
@orionlee commented on GitHub (May 24, 2021):
At least for vscode, I don't think it is supported - The issue listed was first submitted in 2018 with no obvious resolution.
The closest vscdoe setting I know of is
editor.cursorSurroundingLines, but it doesn't quite do what I want either. I end up adding extra blank lines at the end of the file to compensateeditor.cursorSurroundingLines.In my current use case, the extra blank lines at the end of file do get saved: I don't want to add blank lines to the file every time I open and edit it.
Now that I think about it more, I guess I have another workaround, by adding non-blank lines to the end of the file. It's uglier but is sufficient for my use case.
@DavidAnson Certainly it can be argued that it should be supported in the editor. Whether
markdownlint(orvscode-markdownlint) does anything to support the use case is largely a judgement call. Thanks for the plugin and listening anyway!@DavidAnson commented on GitHub (May 25, 2021):
Are you aware of this:
@orionlee commented on GitHub (May 25, 2021):
I'm a bit unclear on how
files.trimFinalNewlineswould help in the use case.E.g., if I set
files.trimFinalNewlinestotrue,Right now, I have
files.trimFinalNewlinesset tofalse, so that I don't need to re-pad the file when I open to edit it again.@DavidAnson commented on GitHub (Jun 19, 2021):
Closing this because it seems like more of an editor feature - and something you only want when editing.