Skip to content

Commit

Permalink
Stop using w3c.github.io URL to fetch CSS specs (#949)
Browse files Browse the repository at this point in the history
The `https://w3c.github.io/csswg-drafts/` URLs now redirect to
`https://drafts.csswg.org/css-viewport/`, following:
w3c/csswg-drafts#8798

Using `w3c.github.io` URLs no longer makes sense as a result. On top of adding
a redirection, it prevents build because the w3c.github.io URL for `css-page-4`
is currently broken.
  • Loading branch information
tidoust authored May 9, 2023
1 parent ce33df7 commit 37471e7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/fetch-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,12 @@ async function fetchInfoFromSpecref(specs, options) {
async function fetchInfoFromSpecs(specs, options) {
const info = await Promise.all(specs.map(async spec => {
const url = spec.nightly?.url || spec.url;
// Force use of more stable w3c.github.io address for CSS drafts
let fetchUrl = url;
if (url.match(/\/drafts\.csswg\.org/)) {
const draft = computeShortname(url);
fetchUrl = `https://w3c.github.io/csswg-drafts/${draft.shortname}/`;
}
let dom = null;
try {
dom = await JSDOMFromURL(fetchUrl);
dom = await JSDOMFromURL(url);
}
catch (err) {
throw new Error(`Could not retrieve ${fetchUrl} with JSDOM: ${err.message}`);
throw new Error(`Could not retrieve ${url} with JSDOM: ${err.message}`);
}

if (spec.url.startsWith("https://tc39.es/")) {
Expand Down

0 comments on commit 37471e7

Please sign in to comment.