MD023 - heading-start-left¶
Description¶
This rule is triggered when a heading is preceded by one or more spaces. Headings must start at the very beginning of the line without any leading whitespace. Headings inside list items and blockquotes are not flagged, as their indentation is structural.
Rationale¶
Headings that don't start at the beginning of the line will not be parsed as headings and will instead appear as regular text. This can cause the document structure to break and the heading to not render properly.
Examples¶
Invalid¶
# Indented Heading 1
## Indented Heading 2
### Indented Heading 3
Indented Setext Heading 1
===========================
Indented Setext Heading 2
---------------------------
Headings with leading spaces.
Valid¶
# Heading 1
## Heading 2
### Heading 3
Headings starting at the beginning of the line.