mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #380] MD041 and github templates #319
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#319
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 @hepcat72 on GitHub (Mar 24, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/380
I have a question. I created github templates for issues and pull requests and I'm confused about the default behavior of MD041.
The following github-recognized default-generated templates for github issues do not trigger an MD041 error:
Github handles the
----delimited portion so that issue submitters do not see it. Their default pull request template however, does not include this----delimited section, and if you add one (there is no MD041 error but), submitters will see this section. If I remove this section, the MD041 error occurs.I feel that an
h1is too big for the PR template. Is there a work-around so that other docs require anh1, but the PR template doesn't have to have one?@DavidAnson commented on GitHub (Mar 24, 2021):
My suggestion might be to use an inline comment to customize the exceptional file: https://github.com/DavidAnson/markdownlint#configuration
Something like this at the bottom of the template should do what you want without getting in the way:
<!-- markdownlint-disable-file MD041 -->@QuAzI commented on GitHub (Sep 10, 2022):
MD041 looks wrong because all note software (QOwnNotes, Obsidian, Foam...) use
---to split title (HEAD) of document and h1...5 just for sectioning BODY@DavidAnson commented on GitHub (Sep 10, 2022):
That syntax creates a second-level/H2 heading. Rule MD041 advocates for a top-level/H1 heading as the first line of the document. As such, I believe it is correct to report your example as a violation.
https://spec.commonmark.org/0.30/#setext-headings
https://cirosantilli.com/markdown-style-guide/#top-level-header
http://markdown-it.github.io/#md3=%7B%22source%22%3A%22Some%20title%5Cn---%5Cn%5CnFile%20content%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22src%22%7D%7D