mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #300] no-duplicate-heading comparing non-sibling headers #256
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#256
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MatthewHerbst on GitHub (Jun 23, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/300
This might be the desired behavior, however, it is not obvious to me that it would be so.
Given the following file:
The second
How it worksheader gives the error (in VSCode)MD024/no-duplicate-heading/no-duplicate-header: Multiple headings with the same content.I feel that this rule should only apply to headers that are siblings. Is the current behavior expected, or is it a bug?
@DavidAnson commented on GitHub (Jun 23, 2020):
What you are seeing is expected behavior. It is the first example in the rule documentation: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md024---multiple-headings-with-the-same-content
There is a
siblings_onlyparameter (also shown there) for the specific scenario of release notes, but it is almost the opposite of what you are asking about.Why would one want to allow duplicates just because they are at different nesting levels?
@MatthewHerbst commented on GitHub (Jun 23, 2020):
My mistake for not seeing that in the docs, apologies. And because we have a document along the lines of:
@DavidAnson commented on GitHub (Jun 23, 2020):
What you show there looks like the scenario for
siblings_only- you may be in luck!@MatthewHerbst commented on GitHub (Jun 23, 2020):
I think so! Thanks again for pointing that out, and for maintaining the package 👍