mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #143] MD022 - Headings should be surrounded by blank lines #1971
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#1971
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 @walles on GitHub (Aug 31, 2018).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/143
I'd like to configure this warning to:
So this should be OK:
But this should not be OK:
The docs explain why you must have an empty line before the heading (kramdown), but only cites aesthetics for why you should have an empty line after the heading.
And as a lot of our markdown has no empty line after headings, and I actually like it this way, I'd like to be able to inform Markdownlint about this.
Regards /Johan
@DavidAnson commented on GitHub (Aug 31, 2018):
I feel like I have seen parsers have problems with this, so I won’t default it on - but it seems okay to add as an option. Thanks!
@vukanac commented on GitHub (Dec 20, 2018):
Is it possible to configure markdownlinter to force usage of 2 empty lines before headings and 1 after?
@DavidAnson commented on GitHub (Dec 20, 2018):
Not currently, but that seems like a reasonable thing to enable as part of addressing this issue.
@vukanac commented on GitHub (Mar 31, 2019):
Thank you for new feature!
But new problem show up. Applying this new rule will force to change other rule (multiple empty lines), and that will allow breaking its desired default value 1. As in
.markdownlint.json:Desired would be only to override multiple-empty-line validation on validating heading lines.
Any way, thank you for the work on this feature.
@DavidAnson commented on GitHub (Mar 31, 2019):
Yes, I mention that consequence here: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md022
Because rules are independent, I don’t see a good way to avoid this.
@merqrial commented on GitHub (Mar 12, 2023):
Related question, can we have heading-level rules for this? Probably makes sense to have a blank line after the H1, not necessarily headings lower than H4.
@DavidAnson commented on GitHub (Mar 12, 2023):
See #504