Skip to content

Commit e876132

Browse files
committed
Fix escaping of examples in JSDoc
1 parent 14376c3 commit e876132

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/site-kit/src/lib/markdown/renderer.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,14 @@ async function syntax_highlight({
775775

776776
html = html.replace(/ {27,}/g, () => redactions.shift()!);
777777

778+
/**
779+
* @shikijs/twoslash (as of v3.2.1) returns `<` in code blocks
780+
* inside of type tooltip-popups as `&#x3C;`.
781+
*
782+
* See {@link https://github.com/sveltejs/svelte.dev/issues/1283}.
783+
*/
784+
html = html.replaceAll('&#x3C;', '<');
785+
778786
if (check) {
779787
// munge the twoslash output so that it renders sensibly. the order of operations
780788
// here is important — we need to work backwards, to avoid corrupting the offsets

0 commit comments

Comments
 (0)