Skip to content

Commit

Permalink
Include clarifying comment
Browse files Browse the repository at this point in the history
  • Loading branch information
howard-e committed Sep 25, 2023
1 parent 8125707 commit 56d93db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/link-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,15 @@ async function checkLinks() {

let matchesHash = true;
if (hash) {
// On some websites, the ids may not exactly match the hash included
// in the link.
// For e.g. GitHub will prepend client facing ids with their own
// calculated value. A heading in a README for example could be
// Foo bar, navigated to with https://github.com/foo/bar#foo-bar,
// but GitHub calculates the actual markup id included in the document
// as being user-content-foo-bar for its own page processing purposes.
//
// See https://github.com/w3c/aria-practices/issues/2809
matchesHash = !!matchingPage?.ids.some((id) => id.includes(hash));
}

Expand Down

0 comments on commit 56d93db

Please sign in to comment.