# MD023 - Headings Must Start at the Beginning of the Line
## Description
This rule ensures that all headings start at the beginning of the line, without any indentation.
Indented headings can cause inconsistent rendering across different Markdown processors.
## Examples
### Valid
```markdown
# Heading 1
## Heading 2
### Heading 3
```
### Invalid
```markdown
# Heading 1
## Heading 2
### Heading 3
```
### Fixed
```markdown
# Heading 1
## Heading 2
### Heading 3
```
## Special Cases
- This rule applies to both ATX-style headings (with hash signs) and setext-style headings (underlined with = or -)
- It does not apply to headings in code blocks
- The rule checks for any whitespace (spaces or tabs) at the beginning of the line
- Indentation within the heading text after the hash signs is not affected by this rule
## Related Rules
- [MD001 - Heading increment](md001.md): Ensures heading levels increment by one level at a time
- [MD003 - Heading style](md003.md): Ensures consistent heading style
- [MD022 - Headings should be surrounded by blank lines](md022.md): Ensures proper spacing around headings