From f8e34d0a32aacea32f91cfb1b1335fd6e82617b1 Mon Sep 17 00:00:00 2001 From: Dominique Hazael-Massieux Date: Tue, 20 Sep 2022 10:08:04 +0200 Subject: [PATCH] Adjust check on old URL of multipage html spec part of #210 --- src/lib/study-backrefs.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/study-backrefs.js b/src/lib/study-backrefs.js index 24afff5b..c440f334 100644 --- a/src/lib/study-backrefs.js +++ b/src/lib/study-backrefs.js @@ -337,6 +337,7 @@ async function studyBackrefs(edResults, trResults = []) { recordAnomaly(spec, "outdatedSpecs", link); return; } + // Links to WHATWG commit snapshots if (link.match(/spec\.whatwg\.org/) && link.match(/commit-snapshots/)) { recordAnomaly(spec, "outdatedSpecs", link); return; @@ -399,7 +400,10 @@ async function studyBackrefs(edResults, trResults = []) { if ((trSourceSpec.ids || []).includes(fullReleaseLink) && link.match(/w3\.org\/TR\//)) { recordAnomaly(spec, "evolvingLinks", link + "#" + anchor); } else { - // Links to WHATWG commit snapshots + if (link.startsWith("https://html.spec.whatwg.org/C")) { + recordAnomaly(spec, "nonCanonicalRefs", link); + link = link.replace("https://html.spec.whatwg.org/C", "https://html.spec.whatwg.org/multipage"); + } // Links to single-page version of HTML spec if (link === "https://html.spec.whatwg.org/" // is there an equivalent id in the multipage spec?