Skip to content

no-duplicate-heading

Markdownstyleno fixdefault: offmarkdown/markdownlint

Reports a heading whose text is the same as an earlier heading in the document, on the later one, with the first as the related location.

Headings that have the same text get the same anchor (the renderer adds a number to the second), so a link to #usage goes to the first one and a reader of the table of contents cannot tell the two apart.

To fix, make the headings different, for example by adding the name of the section they belong to.

Reported
...
## Install
## Usage
Setext
------
Setext
======
markdown:
lint:
rules:
no-duplicate-heading: warn # off (default), warn, error

Enabled by the presets: markdown/markdownlint.

Suppress one line with sudsy-disable-next-line no-duplicate-heading in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
markdownlint MD024 partial No siblings_only option.