heading-style
What it does
Section titled “What it does”Reports a heading written in another style than the document’s: # before the text (ATX) or the text over a line of = or - (setext). The option style is atx, setext or consistent (the style of the first heading, the default). The fix rewrites a one-line heading of level 1 or 2.
Why it matters
Section titled “Why it matters”Two heading styles in one document make it look edited by different hands, and tools that search for headings (outlines, scripts) must know both. Only level 1 and 2 have a setext form, so ATX is the one style that works for every level.
To fix, use the style of the document; the fix does it for level 1 and 2.
Example
Section titled “Example”# Title
Section =======
Sub ---
## Atx
Two lines ---Configuration
Section titled “Configuration”lint: rules: heading-style: level: warn # off (default), warn, error options: style: "consistent" kind: "Heading"| Option | Type | Default | Description |
|---|---|---|---|
style |
string | "consistent" |
atx, setext, or consistent (the first heading’s style).Values: consistent, atx, setext |
kind |
string | "Heading" |
The name of the grammar kind of a heading node. |
Enabled by the presets: markdown/markdownlint.
Suppress one line with sudsy-disable-next-line heading-style in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| markdownlint | MD003 |
partial | consistent only (the first heading’s style); the fix writes a setext heading of one line as atx, the other way is not fixed. No setext_with_atx styles. |