mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-03-15 14:36:31 +01:00
Blank lines immediately above or below a heading are now excluded from MD012's consecutive-blank-line count. Those blank lines are governed by MD022 (blanks-around-headings), so MD012 defers to it. This means users can set MD022's lines_above/lines_below > 1 without triggering spurious MD012 violations.
42 lines
965 B
Markdown
42 lines
965 B
Markdown
# `MD012` - Multiple consecutive blank lines
|
|
|
|
Tags: `blank_lines`, `whitespace`
|
|
|
|
Aliases: `no-multiple-blanks`
|
|
|
|
Parameters:
|
|
|
|
- `maximum`: Consecutive blank lines (`integer`, default `1`)
|
|
|
|
Fixable: Some violations can be fixed by tooling
|
|
|
|
This rule is triggered when there are multiple consecutive blank lines in the
|
|
document:
|
|
|
|
```markdown
|
|
Some text here
|
|
|
|
|
|
Some more text here
|
|
```
|
|
|
|
To fix this, delete the offending lines:
|
|
|
|
```markdown
|
|
Some text here
|
|
|
|
Some more text here
|
|
```
|
|
|
|
Note: this rule will not be triggered if there are multiple consecutive blank
|
|
lines inside code blocks.
|
|
|
|
Note: Blank lines immediately adjacent to headings are not flagged by this
|
|
rule; the number of blank lines around headings is governed by
|
|
`MD022`/`blanks-around-headings`.
|
|
|
|
Note: The `maximum` parameter can be used to configure the maximum number of
|
|
consecutive blank lines.
|
|
|
|
Rationale: Except in a code block, blank lines serve no purpose and do not
|
|
affect the rendering of content.
|