diff --git a/build/flaws/broken-links.ts b/build/flaws/broken-links.ts index 9374a60e4e84..f95ed9a60963 100644 --- a/build/flaws/broken-links.ts +++ b/build/flaws/broken-links.ts @@ -277,7 +277,7 @@ export function getBrokenLinksFlaws( const absoluteURL = new URL(href, "http://www.example.com"); const found = Document.findByURL(hrefNormalized); if (!found) { - // Before we give up, check if it's an image. + // Before we give up, check if it's an attachment. if (!FileAttachment.findByURLWithFallback(hrefNormalized)) { // Even if it's a redirect, it's still a flaw, but it'll be nice to // know what it *should* be. diff --git a/build/utils.ts b/build/utils.ts index 18766bbafe94..f1d6151bfc53 100644 --- a/build/utils.ts +++ b/build/utils.ts @@ -249,9 +249,9 @@ export function postLocalFileLinks($, doc) { const href = element.attribs.href; // This test is merely here to quickly bail if there's no hope to find the - // image as a local file link. There are a LOT of hyperlinks throughout - // the content and this simple if statement means we can skip 99% of the - // links, so it's presumed to be worth it. + // file attachment as a local file link. There are a LOT of hyperlinks + // throughout the content and this simple if statement means we can skip 99% + // of the links, so it's presumed to be worth it. if ( !href || /^(\/|\.\.|http|#|mailto:|about:|ftp:|news:|irc:|ftp:)/i.test(href) @@ -259,11 +259,11 @@ export function postLocalFileLinks($, doc) { return; } // There are a lot of links that don't match. E.g. `` - // So we'll look-up a lot "false positives" that are not images. + // So we'll look-up a lot "false positives" that are not file attachments. // Thankfully, this lookup is fast. const url = `${doc.mdn_url}/${href}`; - const image = FileAttachment.findByURLWithFallback(url); - if (image) { + const fileAttachment = FileAttachment.findByURLWithFallback(url); + if (fileAttachment) { $(element).attr("href", url); } });