Skip to content
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

link-checker incorrectly says a fragment does not exist #2809

Closed
mcking65 opened this issue Sep 21, 2023 · 1 comment · Fixed by #2812
Closed

link-checker incorrectly says a fragment does not exist #2809

mcking65 opened this issue Sep 21, 2023 · 1 comment · Fixed by #2812
Assignees
Labels
bug Code defects; not for inaccurate prose Infrastructure Related to maintaining task force and repo operations, processes, systems, documentation

Comments

@mcking65
Copy link
Contributor

In #2734, the link-checker is failing on the link:

https://github.com/w3c/aria-practices#code-conformance

It says the fragment #code-conformance was not found. I wonder if it is added dynamically and the link-checker is getting incomplete content?

this test failure is blocking progress on #2734.

@mcking65 mcking65 added bug Code defects; not for inaccurate prose Infrastructure Related to maintaining task force and repo operations, processes, systems, documentation labels Sep 21, 2023
@howard-e
Copy link
Contributor

howard-e commented Sep 25, 2023

Something interesting I noticed after looking through the page ids exposed by this repo's link-checker solution, is that for a GitHub page, almost every element on the page has an id so it can be navigated to and focused. So https://github.com/w3c/aria-practices#issues-tab or https://github.com/w3c/aria-practices#fork-button focuses onto the Issues Tab and the Fork Button respectively.

That would mean the chance of id name clashes increases with those reserved names, so the ids of the heading elements in the README are actually prepended with user-content-. So for example, user-content-code-conformance. This makes it possible to navigate to https://github.com/w3c/aria-practices#user-content-code-conformance as well as https://github.com/w3c/aria-practices#code-conformance. I suppose GH does some intelligent matching in JS when navigating with the stripped version (as long as there's no clashes with their reserved ids?). But the link checker is explicitly checking for code-conformance.

So I think this means that the check for the "hashes" could be relaxed to something like the following or a bit more safe:

ids.some(id => id.includes(hash));

Would we want to explicitly check for this with GitHub links?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Code defects; not for inaccurate prose Infrastructure Related to maintaining task force and repo operations, processes, systems, documentation
Projects
None yet
3 participants