mdsmith
Esc
    v0.52.0 GitHub
    MDS044 whitespace ready

    MDS044: horizontal-rule-style

    Thematic breaks must use a consistent delimiter style, exact length, and blank-line spacing.

    CommonMark accepts ---, ***, and ___ with any length ≥ 3 and optional internal spaces. This rule pins one delimiter, enforces an exact length, and requires surrounding blank lines so --- cannot be confused with a setext heading underline.

    # Settings

    SettingTypeDefaultDescription
    stylestring"dash"Delimiter character: "dash" (---), "asterisk" (***), or "underscore" (___).
    lengthint3Exact number of delimiter characters required (minimum 3).
    require-blank-linesbooltrueBlank lines must appear before and after each thematic break.

    # Config

    Enable with defaults:

    rules:
      horizontal-rule-style:
        style: dash
        length: 3
        require-blank-lines: true

    Disable:

    rules:
      horizontal-rule-style: false

    Custom (asterisk style, length 5):

    rules:
      horizontal-rule-style:
        style: asterisk
        length: 5

    # Diagnostics

    horizontal rule uses {actual}; configured style is {expected}
    horizontal rule has internal spaces
    horizontal rule has length {actual}; configured length is {expected}
    horizontal rule needs a blank line above
    horizontal rule needs a blank line below

    # Examples

    # Good (default settings)

    # Test Document
    
    Some text before.
    
    ---
    
    Some text after.

    # Good (asterisk style)

    # Test Document
    
    Some text before.
    
    ***
    
    Some text after.

    # Bad (wrong delimiter)

    # Test Document
    
    Some text before.
    
    ***
    
    Some text after.

    # Bad (internal spaces)

    # Test Document
    
    Some text before.
    
    - - -
    
    Some text after.

    # Bad (wrong length)

    # Test Document
    
    Some text before.
    
    -----
    
    Some text after.

    # Bad (missing blank line above)

    # Test Document
    ---
    
    Text after.

    # Bad (missing blank line below)

    # Test Document
    
    ---
    Text after.

    # Auto-fix

    The rule rewrites each thematic break to the canonical form (style repeated length times). It also inserts any missing blank lines above and below.

    # Meta-Information

    • ID: MDS044
    • Name: horizontal-rule-style
    • Status: ready
    • Default: disabled
    • Fixable: yes
    • Implementation: source
    • Category: whitespace
    • markdownlint: MD035 (hr-style)
    • rumdl: MD035 (hr-style)
    • mado: MD035 (hr-style)