2022-10-30 15:13:19 -07:00
|
|
|
# `MD024` - Multiple headings with the same content
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-10-30 15:13:19 -07:00
|
|
|
Tags: `headers`, `headings`
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-10-30 15:13:19 -07:00
|
|
|
Aliases: `no-duplicate-header`, `no-duplicate-heading`
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
* `allow_different_nesting`: Only check sibling headings (`boolean`, default
|
|
|
|
`false`)
|
2022-10-29 23:21:45 -07:00
|
|
|
* `siblings_only`: Only check sibling headings (`boolean`, default `false`)
|
|
|
|
|
|
|
|
This rule is triggered if there are multiple headings in the document that have
|
|
|
|
the same text:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
# Some text
|
|
|
|
|
|
|
|
## Some text
|
|
|
|
```
|
|
|
|
|
|
|
|
To fix this, ensure that the content of each heading is different:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
# Some text
|
|
|
|
|
|
|
|
## Some more text
|
|
|
|
```
|
|
|
|
|
|
|
|
If the parameter `siblings_only` (alternatively `allow_different_nesting`) is
|
|
|
|
set to `true`, heading duplication is allowed for non-sibling headings (common
|
|
|
|
in changelogs):
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
# Change log
|
|
|
|
|
|
|
|
## 1.0.0
|
|
|
|
|
|
|
|
### Features
|
|
|
|
|
|
|
|
## 2.0.0
|
|
|
|
|
|
|
|
### Features
|
|
|
|
```
|
|
|
|
|
|
|
|
Rationale: Some Markdown parsers generate anchors for headings based on the
|
|
|
|
heading name; headings with the same content can cause problems with that.
|