mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #830] MD051: Add support for custom heading anchor IDs #545
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#545
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 @scottamain on GitHub (May 24, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/830
Many MD parsers allow for custom anchor names on headings as follows:
With this markup, I can change the heading but keep the anchor name the same and avoid breaking links.
The problem is that MD051 will now flag this as an invalid link:
It would be great if markdownlint could capture
{#name}as the heading ID to avoid this false positive.(Although some MD parsers also allow you to use this syntax to add IDs on other elements, I believe headings are the most common and would be a great starting point to add this support. Then if there's demand, perhaps add support for custom IDs on other elements such as images or other arbitrary elements.)
@lonix1 commented on GitHub (Aug 15, 2023):
This is a great update, thanks.
There are a number of related repos, so I'm unsure how they all interact... When does it land in the vscode extension?
@DavidAnson commented on GitHub (Aug 15, 2023):
https://github.com/DavidAnson/markdownlint/blob/main/doc/ReleaseProcess.md
@lonix1 commented on GitHub (Aug 15, 2023):
@scottamain Are you using vscode? I just realised that this:
will be rendered verbatim - that ugly suffix is shown in the vscode preview.
So this update is good for github (I hope?) but not vscode.