All rules

Heading level skipped

heading-level-skipon by default (info)Japanese / English

A heading that skips a level, such as "####" right after "##"

Example

Flagged
# Setup guide ## Before you start Gather the tools. #### Safety Wear gloves.
What chaff prints
7:1 Heading "Safety" goes from level 2 to level 4 (expected 3)
Fixed
# Setup guide ## Before you start Gather the tools. ### Safety Wear gloves.
What chaff prints
no finding

How to fix

Make the heading one level deeper than the one before it. If only the size on screen was the point, change the style instead of the level.

Why it matters

A "####" right after a "##" leaves out a level. A table of contents and a screen reader show a document's shape by heading level, so the missing level reads as a section that went missing. It happens when a level is chosen for its size on screen. The first heading may start at any level; only a heading two or more levels deeper than the one before it is reported (as markdownlint's MD001 counts).

What it does not flag

The first heading may start at any level, and a heading that goes back up ("##" after "####") is not reported.

Turning it off or relaxing it

Silence this one spot (in the document)
<!-- stet: heading-level-skip — reason -->
Relax it for the team (the reason is kept as a comment in chaff.yaml)
npx chaffjs relax heading-level-skip --why "reason"
Turn it off for the team (chaff.yaml)
rules: heading-level-skip: off
Technical details
Layer
L1
Status
stable
Severity
info
Languages
Japanese and English
Suited to
business, technical, blog, legal, docs, academic, literature, speech
Reads from the document
markdown

Levels

Set a level for this rule under rules in chaff.yaml. With nothing set, it runs at the level its genre gives it (see By genre below).

strictwarning
normalinfo
relaxedinfo

This rule has no limit to count to. A level sets how a finding is marked: relaxed keeps the finding and marks it a step lower.

By genre

Runs by default in
technical/spec, technical/readme, blog/tech, blog/essay, blog/owned-media, business/proposal, business/report, business/email, business/press-release, business/meeting-notes, legal/contract, legal/statute, legal/judgment, legal/patent, docs/manual, docs/faq, docs/glossary, academic/paper, literature/fiction, literature/essay, literature/poetry, literature/play, speech/address, speech/transcript

Genres

Message

Heading "{heading}" goes from level {from} to level {to} (expected {expected})

This page is built from the rule's definition file:packages/chaff/rules/heading-level-skip.yaml