From 9e6780e6e1bf5808bea6c0a5bfaa5a4e2979dfb8 Mon Sep 17 00:00:00 2001 From: KnightNiwrem Date: Thu, 5 Mar 2026 13:09:57 +0000 Subject: [PATCH] fix: stop escaping HTML in JSDoc strings Remove the while loop in P.tsx that escaped <...> patterns to <...> in JSDoc text. This was breaking intentional HTML tags (like links) in JSDoc strings, causing broken links in the API reference. Fixes #1027 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- site/api/components/P.tsx | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/site/api/components/P.tsx b/site/api/components/P.tsx index b2be4ed3d0..cd00ec06b6 100644 --- a/site/api/components/P.tsx +++ b/site/api/components/P.tsx @@ -11,26 +11,7 @@ export function P( }, ) { if (props.doc && props.children) { - const parts = props.children.split(/(```|```ts)/); - const newParts = new Array(); - let inCodeBlock = false; - for (let part of parts) { - if (part == "```" || part == "```ts" || part == "```ts:no-line-numbers") { - inCodeBlock = !inCodeBlock; - newParts.push(part); - continue; - } - if (!inCodeBlock) { - while (/<.+>/.test(part)) { - part = part.replace(/<(.+)>/, "<$1>"); - } - newParts.push(part); - } else { - newParts.push(part); - } - } - props.children = newParts - .join("") + props.children = props.children .replaceAll("```ts", "```ts:no-line-numbers"); props.children = replaceModuleSymbolLinks( props.children,