-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check anchor links #91
Comments
I took an an initial stab at it. I got it working locally with just anchors in file system Markdown files. My branches are here: tcort/link-check@master...joelverhagen:check-anchors It met my own needs for a one-time pass of some Markdown files interlinking to each other. Some issues with the implementation that I feel prevent it from being PR-worth:
My output looks like this:
|
@joelverhagen FWIW I think just the inter-link markdown verification is by far the most useful aspect of an anchor link lint. I'd suggest not handling URLs w/ fragments to real html documents any differently in an initial PR (no |
👍 This is exactly what we are using markdown-link-check for, most of the time. Having this feature would be great, since the anchors to local documents break quite often. |
Hi - what did this issue end up doing in term of implementing the checks for the markdown internal links? It doesn't seem to be implemented in the current version of markdown-link-check? Kind regards, Francesco |
I'd also love to see this make it into the library. |
Yeah, at the moment the only workaround I could figure out for this is a dirty hack (ARM-software/acle#104):
|
+1 for this feature |
It would be great to have this in. @tcort how can we help to get this merged? Are there any implementation or design issues? |
Implemented in |
Thanks a lot @tcort for the quick implementation! There's one issue still, linking to anchors in other files doesn't seem to work:
# This is a test
[one](./foo.md) this works
[two](./foo.md#some-anchor) this doesn't
# Foo
no other anchors. ~/markdown-link-check$ ./markdown-link-check ./test.md
FILE: ./test.md
[✓] ./foo.md
[✓] ./foo.md#some-anchor
2 links checked. Here, the second test should have failed. Is that correct or did I bork my update? |
Hmm, upgrading from v3.9.3 to v3.10.0 actually seems to have broken anchor checks for us, see:
|
@sschuberth the bug was reported here: #193 Although very valuable in its own right, the pull request does not serve as a very effective way to track the issue. We would normally expect to find the items for outstanding bugs in the open issues and PRs, but that one has been merged. However, it does not fix the bug since it only provided the unit tests to demonstrate the bug, So it would be best to create a dedicated issue for this bug since it is likely to cause quite some impact on the users. It did for my projects, but I was able to find the PR at that time because it had not yet been merged. |
I've created one at #195. |
* also check relative links and achors using markdown-link-check (we didn't use it before because of the issue below, see: tcort/markdown-link-check#91) * actually check for achor and relative link errors (previously the errors were ignored in the script) * add else statement that logs if nothing was checked due to no changes
* chore: remove unused check-docs.ts * chore: update check-docs script * also check relative links and achors using markdown-link-check (we didn't use it before because of the issue below, see: tcort/markdown-link-check#91) * actually check for achor and relative link errors (previously the errors were ignored in the script) * add else statement that logs if nothing was checked due to no changes * chore: remove remark now we check all the links with markdown-link-check
For example when linking to
https://github.com/#does-not-exist
would be nice to parse returned HTML to detect that the anchordoes-not-exist
does not existThe text was updated successfully, but these errors were encountered: