Skip to content

MD024 - no-duplicate-heading

Description

This rule checks that heading content is unique throughout the document. When siblings_only is enabled, duplicate headings are only flagged if they appear within the same parent section.

Rationale

Some Markdown parsers generate anchors for headings based on the heading text. Having multiple headings with the same content can cause problems with anchor links, making it impossible to navigate to specific sections.

Configuration

siblings_only

When True, only flag duplicate headings within the same section (siblings). When False, all duplicate headings are flagged regardless of their position in the document hierarchy.

  • Default: false

Examples

Invalid

# Some text

## Some text

### Some text

Valid

# Heading 1

## Heading 2

### Heading 3

All headings have unique content.