MDS051: single-h1
At most one H1 heading is allowed per file.
A second H1 usually indicates two documents merged into one or a heading-level mistake.
# Settings
| Setting | Type | Default | Description |
|---|---|---|---|
front-matter-title | string | "title" | Front-matter field that counts as an H1. When the field is set and the file also contains an H1, the H1 is flagged. Set to "" to disable. |
# Config
Enable:
rules:
single-h1: trueDisable (default):
rules:
single-h1: falseIgnore front-matter title:
rules:
single-h1:
front-matter-title: ""# Examples
# Bad — two H1 headings
# First
## Section
# Second# Bad — front-matter title conflicts with H1
---
title: My Doc
---# My Doc# Good — single H1
# Title
## Section
### Sub-section# Diagnostics
| Message | Condition |
|---|---|
extra H1 heading; only one H1 is allowed per file | A second or later H1 heading exists in the document |
h1 heading conflicts with front-matter title | An H1 heading exists and the front matter contains the configured field with a non-empty string value |
# See also
- MDS003 — heading hierarchy (no level skips)
- MDS004 — first-line heading
- MDS005 — no duplicate heading text