2022-10-30 15:13:19 -07:00
|
|
|
# `MD012` - Multiple consecutive blank lines
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-10-30 15:13:19 -07:00
|
|
|
Tags: `blank_lines`, `whitespace`
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-10-30 15:13:19 -07:00
|
|
|
Aliases: `no-multiple-blanks`
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
2022-11-13 20:53:10 -08:00
|
|
|
- `maximum`: Consecutive blank lines (`integer`, default `1`)
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-12-16 13:53:03 -08:00
|
|
|
Fixable: Some violations can be fixed by tooling
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2026-02-21 13:05:05 +01:00
|
|
|
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`.
|
|
|
|
|
|
2022-10-29 23:21:45 -07:00
|
|
|
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.
|