diff --git a/packages/site-kit/src/lib/markdown/renderer.ts b/packages/site-kit/src/lib/markdown/renderer.ts index 20b30d1dd3..4e3402b578 100644 --- a/packages/site-kit/src/lib/markdown/renderer.ts +++ b/packages/site-kit/src/lib/markdown/renderer.ts @@ -775,6 +775,14 @@ async function syntax_highlight({ html = html.replace(/ {27,}/g, () => redactions.shift()!); + /** + * @shikijs/twoslash (as of v3.2.1) returns `<` in code blocks + * inside of type tooltip-popups as `<`. + * + * See {@link https://github.com/sveltejs/svelte.dev/issues/1283}. + */ + html = html.replaceAll('<', '<'); + if (check) { // munge the twoslash output so that it renders sensibly. the order of operations // here is important — we need to work backwards, to avoid corrupting the offsets