mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #253] Warn against dead links within the document #217
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#217
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 @ben-clayton on GitHub (Feb 12, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/253
It would be fantastic if bad anchor-style links were detected and warned.
I wouldn't expect bad external URL links to be caught.
@koppor commented on GitHub (Apr 29, 2020):
Dead external links can be discovered with markdown-link-check:
One file:
npx markdown-link-check README.md.Multiple files outputting the result into a text file:
Note that I used npx to avoid explicit global installation of the markdown-link-check package.
@nichtich commented on GitHub (Jun 29, 2020):
Thanks for the pointer to markdown-link-check, but I'd prefer to have basic support as part of markdownlint instead of having to use yet another tool with different usage and a lot of functionality I don't need anyway. The dead-links use case in this issue is anchor-style links, so implementation would be:
#and check whether a matching id exists.Note this would not catch link targets within inline HTML but this is discouraged by MD033 anyway.
@DavidAnson commented on GitHub (Jun 29, 2020):
@nichtich Is the anchor ID algorithm part of a specification anywhere, or are you suggesting making this specific to GitHub?
@nichtich commented on GitHub (Jun 29, 2020):
Anchor links from header titles have been discussed in CommonMark but it's not part of CommonMark. Popular implementations that create anchor ids from header titles include Pandoc and GitHub. Pandoc also supports GitHub algorithm (see feature
gfm_auto_identifiers), so GitHub algorithm seems the best choice:-)-and_are removedsectionFor a more extensive comparison of algorithms see https://babelmark.github.io/
@DavidAnson commented on GitHub (Jun 29, 2020):
Great info, thank you!
$ commandin a group #2033