mdsmith
Esc
    v0.52.0 GitHub
    MDS051 heading ready

    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

    SettingTypeDefaultDescription
    front-matter-titlestring"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: true

    Disable (default):

    rules:
      single-h1: false

    Ignore 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

    MessageCondition
    extra H1 heading; only one H1 is allowed per fileA second or later H1 heading exists in the document
    h1 heading conflicts with front-matter titleAn 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

    # Meta-Information

    • ID: MDS051
    • Name: single-h1
    • Status: ready
    • Default: disabled (opt-in)
    • Fixable: yes — extra H1s are demoted to H2; front-matter conflicts are not auto-fixed
    • Implementation: source
    • Category: heading
    • markdownlint: MD025 (single-h1)
    • rumdl: MD025 (single-title)
    • mado: MD025 (single-h1)
    • gomarklint: single-h1