mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #1308] [Proposal] Rule to disallow links in headings #658
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#658
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 @Arty-chan on GitHub (Jul 26, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1308
A lot of markdown renderers on sites auto-create anchor links to headings.
While if there is a link in a heading, the anchor will still work, clicking on the heading can lead you to the specified link instead of giving you the anchor link. This disrupts the default behaviour of the heading.
It's particularly problematic in something that is generated off the headings. For example, if you have a table of contents generated from the headings, many generators will not strip out the link, so when you click on the heading in the table of contents, it goes to the specified link instead of to the heading on the current page.
I'm creating a custom rule in another linter (vale) so it's not a priority for me, but thought this would be a good idea to include as a rule in markdownlint.
@berot3 commented on GitHub (May 19, 2025):
I think it would be nice to have the option to disallow links in headings. but i als agree with the discussion here #762
@Malix-Labs commented on GitHub (Jul 14, 2025):
Duplicate of #762
@DavidAnson commented on GitHub (Jul 14, 2025):
Agreed, I will close this per the discussion in #762.