diff --git a/packages/site-kit/src/lib/markdown/renderer.ts b/packages/site-kit/src/lib/markdown/renderer.ts index aaafcdfbe3..71bc47f47a 100644 --- a/packages/site-kit/src/lib/markdown/renderer.ts +++ b/packages/site-kit/src/lib/markdown/renderer.ts @@ -785,6 +785,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