MD076 - List item spacing should be consistent¶
Aliases: list-item-spacing
What this rule does¶
Enforces consistent blank-line spacing between consecutive items in a list. Within each list, every inter-item gap must follow the same style: either all gaps have a blank line (loose) or none do (tight).
Why this matters¶
- Visual consistency: Mixing tight and loose gaps in a single list looks accidental and is harder to read.
- Rendered output: Many renderers apply extra
<p>wrapping around list items that have blank lines between them. Inconsistency causes some items to render as paragraphs and others not, producing an uneven result.
Examples¶
Tight list (no blank lines between items)¶
Correct¶
Incorrect (mixed spacing)¶
Loose list (blank line between every item)¶
Correct¶
Incorrect (mixed spacing)¶
Ordered lists¶
The rule applies equally to ordered lists:
Configuration¶
| Value | Description |
|---|---|
"consistent" |
Within each list the majority style wins; on a tie, loose is preferred |
"loose" |
Every inter-item gap must contain a blank line |
"tight" |
No inter-item gap may contain a blank line |
Automatic fixes¶
This rule can automatically fix violations:
- Missing blank lines (tight gap when loose is required): a blank line is inserted before the next list item.
- Unexpected blank lines (loose gap when tight is required): the blank line is removed.
Fixes preserve blockquote prefixes (e.g., > characters) when list items
appear inside a blockquote.
Nested lists¶
Nested lists are analysed independently from their parent list. A tight parent with a loose nested list (or vice versa) triggers no warning on the parent level; only the spacing at each nesting level's own items is checked.