MD022 - Blanks Around Headings
Headings should be surrounded by blank lines.
Why This Rule Exists
Blank lines around headings improve readability and ensure consistent rendering across Markdown parsers. Some parsers require blank lines to properly recognize headings.
Examples
Incorrect
Some paragraph text.
## Heading
More text here.
Correct
Some paragraph text.
## Heading
More text here.
Configuration
[MD022]
lines_above = 1 # Blank lines before heading (default: 1)
lines_below = 1 # Blank lines after heading (default: 1)
When to Disable
- Documents with compact formatting requirements
- Content where headings immediately follow other headings
Rule Details
- Rule ID: MD022
- Aliases: blanks-around-headings
- Category: Structure
- Severity: Warning
- Auto-fix: Yes