mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Update MD024/no-duplicate-heading to allow non-sibling duplicates (fixes #136).
This commit is contained in:
parent
4865301ce9
commit
d76ede1c4f
10 changed files with 246 additions and 15 deletions
19
doc/Rules.md
19
doc/Rules.md
|
@ -1,3 +1,4 @@
|
|||
|
||||
# Rules
|
||||
|
||||
This document contains a description of all rules, what they are checking for,
|
||||
|
@ -681,6 +682,8 @@ Tags: headings, headers
|
|||
|
||||
Aliases: no-duplicate-heading, no-duplicate-header
|
||||
|
||||
Parameters: siblings_only, allow_different_nesting (boolean; default `false`)
|
||||
|
||||
This rule is triggered if there are multiple headings in the document that have
|
||||
the same text:
|
||||
|
||||
|
@ -702,6 +705,22 @@ Rationale: Some markdown parses generate anchors for headings based on the
|
|||
heading name, and having headings with the same content can cause problems with
|
||||
this.
|
||||
|
||||
If the parameter `siblings_only` (alternatively `allow_different_nesting`) is
|
||||
set to `true`, heading duplication is allowed for non-sibling headings (common
|
||||
in change logs):
|
||||
|
||||
```markdown
|
||||
# Change log
|
||||
|
||||
## 1.0.0
|
||||
|
||||
### Features
|
||||
|
||||
## 2.0.0
|
||||
|
||||
### Features
|
||||
```
|
||||
|
||||
<a name="md025"></a>
|
||||
|
||||
## MD025 - Multiple top level headings in the same document
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue