mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #786] MD022: Custom space between headers #530
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#530
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 @st-pasha on GitHub (Apr 21, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/786
I'm currently using the following configuration for rule MD022:
Which works nicely, except in situations when an H1 header is immediately followed by an H2 header. Here's an example of a document (the way I'd like it to be formatted):
but instead, rule MD022 forces 2 spaces between the
# Page titleand## First section.So, what I'd like to propose is to introduce a new parameter into the rule MD022, which could perhaps be called
lines_between, and this parameter, if present, will specify the number of blank lines to insert between a header of levelNand a header of levelN+1if it immediately follows.Rationale: two blank lines are useful to clearly separate one section of text from another (a single line is insufficient because then it looks like a regular paragraph break). However, when a header is immediately followed by a sub-header, then there is no "preceding section", and extra whitespace is unnecessary and looks jarring.
@DavidAnson commented on GitHub (Apr 21, 2023):
Related: #546
@DavidAnson commented on GitHub (Aug 5, 2023):
Duplicate of #504.