Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/site-kit/src/lib/markdown/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 `&#x3C;`.
*
* See {@link https://github.com/sveltejs/svelte.dev/issues/1283}.
*/
html = html.replaceAll('&#x3C;', '<');

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
Expand Down