From 2b7d2a7b38d965725b08dffba19cd9426ed958ff Mon Sep 17 00:00:00 2001 From: Allo Date: Fri, 4 Aug 2023 21:08:11 +0800 Subject: [PATCH] fix: add missing broken link reports --- build/flaws/broken-links.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/flaws/broken-links.ts b/build/flaws/broken-links.ts index f00e38dd0a53..6fa6b923aa7e 100644 --- a/build/flaws/broken-links.ts +++ b/build/flaws/broken-links.ts @@ -312,8 +312,10 @@ export function getBrokenLinksFlaws( `/${DEFAULT_LOCALE}/` ); const enUSFound = Document.findByURL(enUSHrefNormalized); + // Note, we still recommend that contributors use localized links, + // even if the target document is still not localized. if (enUSFound) { - // Only the en-US document exists + // Found the en-US version of the document. Just link to that. mutateLink(a, null, enUSFound.url); } else { const enUSResolved = Redirect.resolve(enUSHrefNormalized); @@ -338,6 +340,9 @@ export function getBrokenLinksFlaws( enUSFallbackURL ); } + } else { + // The link is broken and we don't have a suggestion. + addBrokenLink(a, checked.get(href), href); } } }