mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #1533] [MD051/link-fragments] Feature Request: Add support for checking fragments in other files #704
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#704
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 @Cameronsplaze on GitHub (Mar 9, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1533
Checking link fragments is currently working great if you're linking to another place in the same file, but fails to warn if the target is in another file.
Similar to https://github.com/DavidAnson/markdownlint/issues/513#issuecomment-1085283870:
article.md
readme.md
This will fail to warn that the readme
#authors-this-is-a-typoheader is invalid. Is there a way around this I'm missing maybe?Thank you!
@DavidAnson commented on GitHub (Mar 9, 2025):
This is by design and implied by the rule documentation that refers to links within a file. Scanning referenced files as you suggest would be possible, but is out of scope for this rule because it can't be done synchronously (or at all in some scenarios).
https://github.com/DavidAnson/markdownlint/blob/main/doc/md051.md
@Cameronsplaze commented on GitHub (Mar 10, 2025):
Ah that makes sense, thanks!
Would you consider a feature request for adding this as a new rule then? Or is synchronously a blocker for rules?
@DavidAnson commented on GitHub (Mar 10, 2025):
It's a blocker for core rules. Too much unpredictability for scenarios like VS Code in the web, etc.. But it's something someone could implement in a custom rule. Scanning quickly, I think one or two here may do what you want already: https://www.npmjs.com/search?q=keywords:markdownlint-rule
@Cameronsplaze commented on GitHub (Mar 11, 2025):
Got yeah, sounds good. Thank you for the link, I'll check them out!