MD012 - no-multiple-blanks¶
Description¶
This rule detects multiple consecutive blank lines in markdown documents. It triggers when the number of consecutive blank lines exceeds the configured maximum (default: 1). Multiple consecutive blank lines inside code blocks and front matter are excluded and will not trigger this rule.
Rationale¶
Except in a code block, blank lines serve no purpose and do not affect the rendering of content. Multiple consecutive blank lines create unnecessary whitespace in source files and can indicate formatting inconsistencies.
Configuration¶
maximum-
Maximum number of consecutive blank lines allowed. Default is 1, meaning only single blank lines are permitted.
- Default:
1
- Default:
Examples¶
Invalid¶
# Heading
Some text here.
Some more text here.
Valid¶
# Heading
Some text here.
Some more text here.