diff --git a/.changeset/broaden-dead-link-stripping.md b/.changeset/broaden-dead-link-stripping.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/broaden-dead-link-stripping.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/scripts/generate-api-docs/generate.mjs b/scripts/generate-api-docs/generate.mjs index 478c397d6c..dadc0c542e 100644 --- a/scripts/generate-api-docs/generate.mjs +++ b/scripts/generate-api-docs/generate.mjs @@ -593,10 +593,12 @@ function renderDir(dir) { ); // Strip links whose href points to dead targets (jQuery, QUnit, pseudo-types, nested namespaces) - htmlFixed = htmlFixed.replace(/]*>([^<]+<\/code>)<\/a>/g, (match, href, content) => { + htmlFixed = htmlFixed.replace(/]*>([\s\S]*?)<\/a>/g, (match, href, content) => { if (DEAD_LINK_PATTERNS.some((p) => p.test(href))) return content; // Links with nested namespaces/ segments are always dead TypeDoc artifacts if ((href.match(/\/namespaces\//g) || []).length >= 2) return content; + // Single namespaces/sap/README.html — the global namespace index that doesn't exist + if (/\/namespaces\/sap\/README\.html$/.test(href)) return content; return match; });