Skip to content

Commit

Permalink
fix: Link rendering for typescript docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dlhck committed Jun 14, 2024
1 parent 441432a commit dc6b3d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/docs/typescript-docs-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ export class TypescriptDocsRenderer {
.replace(/\n/g, ' ');

for (const [key, val] of knownTypeMap) {
if(typeText.includes('href')) {
// skip when href already exists, as this could cause broken links
continue;
}
const re = new RegExp(`\\b${key}\\b`, 'g');
const strippedIndex = val.replace(/\/_index$/, '');
typeText = typeText.replace(re, `<a href='${docsUrl}/${strippedIndex}'>${key}</a>`);
Expand Down

0 comments on commit dc6b3d9

Please sign in to comment.