Skip to content

fix: broaden dead-link stripping to cover plain-text links#605

Merged
akudev merged 2 commits into
mainfrom
fix/apidoc
Jun 22, 2026
Merged

fix: broaden dead-link stripping to cover plain-text links#605
akudev merged 2 commits into
mainfrom
fix/apidoc

Conversation

@akudev

@akudev akudev commented Jun 22, 2026

Copy link
Copy Markdown
Member

Problem

After the previous broken-link fixes were merged and the site regenerated, 26 links remained broken on openui5/1.149. All were plain-text links from JSDoc {@link sap.ui.view view factory}-style references.

The dead-link stripping regex only matched <a> tags wrapping <code> content:

/<a href="([^"]*)"[^>]*>(<code>[^<]+<\/code>)<\/a>/g

Fix

  • Widen the content match from (<code>[^<]+</code>) to ([\s\S]*?) — catches any link content
  • Add /namespaces/sap/README.html to the dead-link patterns — the global sap namespace index page doesn't exist and all its members (sap.ui.define, sap.ui.require, plus 28 deprecated functions) are either irrelevant for TypeScript users or deprecated

Result

Reduces broken links from 26 → 1 (the trivial ../ parent escape from index.html).

The regex previously only matched <a> tags wrapping <code> content.
Links from JSDoc {@link} references render as plain text and were
missed — 26 broken links remained on openui5/1.149 after regeneration.

Changes:
- Widen the regex from (<code>[^<]+</code>) to ([\s\S]*?) so it
  catches any link content (plain text, code, or mixed).
- Add pattern for namespaces/sap/README.html — the non-existent
  global sap namespace index page that some pages link to.

All sap.ui.* global functions documented there are either deprecated
or irrelevant for TypeScript users (sap.ui.define/require), so
stripping these links is correct.
codeworrior
codeworrior previously approved these changes Jun 22, 2026
@akudev akudev merged commit dc82050 into main Jun 22, 2026
7 checks passed
@akudev akudev deleted the fix/apidoc branch June 22, 2026 15:42
@akudev

akudev commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

Resulting changes: c934bbb#diff-d549aadcb80a84247500f29547856dc1d65ca3876694573769ba5aa87ad332d7

The other versions were unlinked because I deleted the version files... will come back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants