Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MD024 - No Duplicate Headings

Multiple headings with the same content.

Why This Rule Exists

Duplicate headings can confuse readers and break anchor links. Each heading generates a URL fragment, and duplicates create ambiguous navigation targets.

Examples

Incorrect

# Guide

## Introduction

Some content.

## Introduction

More content with same heading.

Correct

# Guide

## Introduction

Some content.

## Getting Started

Different heading for different section.

Siblings Only Mode

With siblings_only: true, duplicates are allowed in different sections:

# Chapter 1

## Summary

Chapter 1 summary.

# Chapter 2

## Summary

Chapter 2 summary (allowed - different parent).

Configuration

[MD024]
siblings_only = false  # Only check sibling headings (default: false)
allow_different_nesting = false  # Allow same text at different levels

When to Disable

  • Documents with intentionally repeated section names
  • Auto-generated content with structured repetition

Rule Details

  • Rule ID: MD024
  • Aliases: no-duplicate-heading
  • Category: Content
  • Severity: Warning
  • Auto-fix: No
  • MD025 - Single top-level heading
  • MD051 - Link fragments validation