mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #359] MD041 should trigger if there is at least one heading present #2150
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#2150
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 @Yash-Singh1 on GitHub (Dec 28, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/359
Currently
MD041states that the first line in a file should be a#orh1heading. Some markdown files such as_sidebar.mdindocsify(https://docsify.js.org/#/more-pages?id=sidebar) don't need any heading at all. Here is an example_sidebar.md:The rule should contain an extra rule stating that the top-level heading is required if there is at least one heading. E.g., the linting error should appear on the following file:
But not give an error in:
This is because the first one has at least one heading present while the second one doesn't have any headings present.
@DavidAnson commented on GitHub (Dec 28, 2020):
The rule documentation explains the reasoning: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md041
Specifically:
This is independent of whether or not there are other headers, so I think the current behavior of the rule is appropriate.