mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 01:05:55 +03:00
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#1839
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?
📋 Pull Request Information
Original PR: https://github.com/DavidAnson/markdownlint/pull/1973
Author: @rvben
Created: 2/21/2026
Status: ❌ Closed
Base:
next← Head:fix/md012-heading-adjacent-blanks📝 Commits (1)
ccd26cefix(md012): do not flag blank lines adjacent to headings (fixes #990).📊 Changes
7 files changed (+106 additions, -4 deletions)
View changed files
📝
doc-build/md012.md(+4 -0)📝
doc/Rules.md(+4 -0)📝
doc/md012.md(+4 -0)📝
lib/md012.mjs(+23 -4)➕
test/no-multiple-blanks-headings.md(+23 -0)📝
test/snapshots/markdownlint-test-scenarios.mjs.md(+48 -0)📝
test/snapshots/markdownlint-test-scenarios.mjs.snap(+0 -0)📄 Description
Fixes #990.
When
MD022is configured withlines_aboveorlines_belowgreater than 1,the required blank lines are also flagged by
MD012, making the two rulesimpossible to satisfy simultaneously.
This change pre-computes the blank lines immediately adjacent to each heading
and excludes them from
MD012's check. Those blank lines are governed byMD022, soMD012defers to it. The adjacent-blank walk usesisBlankLine()(the same helper
MD022uses) so both rules count heading-adjacent blank linesconsistently.
A new test fixture covers the case, and the rule documentation notes that
heading-adjacent blank lines are governed by
MD022.Note: this PR was developed with AI assistance. I'm disclosing this in line
with the contributing guidelines and leaving it to your discretion whether
to accept it.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.