Skip to content

Latest commit

 

History

History
147 lines (103 loc) · 2 KB

File metadata and controls

147 lines (103 loc) · 2 KB
id MDS002
name heading-style
status ready
description Heading style must be consistent.

MDS002: heading-style

Heading style must be consistent.

  • ID: MDS002
  • Name: heading-style
  • Status: ready
  • Default: enabled, style: atx
  • Fixable: yes
  • Implementation: source
  • Category: heading

Settings

Setting Type Default Description
style string "atx" "atx" (# Heading) or "setext" (underline with ===/---)

Config

Enable (default):

rules:
  heading-style:
    style: atx

Disable:

rules:
  heading-style: false

Custom (setext style):

rules:
  heading-style:
    style: setext

Examples

Bad (when style is atx)

Setext heading used when ATX is required:

# Title

Section
-------

Setext heading with marker:

# Title

Section
-------

<?allow-empty-section?>

Bad (when style is setext)

ATX heading used when Setext is required:

# Title

## Section

Good (when style is atx)

# Title

## Section

Body text.

Good (when style is setext)

Title
=====

Section
-------

Body text.

Diagnostics

Message Condition
heading style should be atx style: atx and a Setext heading is found
heading style should be setext style: setext and an ATX heading is found