Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/broaden-dead-link-stripping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
4 changes: 3 additions & 1 deletion scripts/generate-api-docs/generate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,12 @@ function renderDir(dir) {
);

// Strip links whose href points to dead targets (jQuery, QUnit, pseudo-types, nested namespaces)
htmlFixed = htmlFixed.replace(/<a href="([^"]*)"[^>]*>(<code>[^<]+<\/code>)<\/a>/g, (match, href, content) => {
htmlFixed = htmlFixed.replace(/<a href="([^"]*)"[^>]*>([\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;
});

Expand Down
Loading