Skip to content
Merged
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
7 changes: 7 additions & 0 deletions packages/site-kit/src/lib/markdown/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,13 @@ async function syntax_highlight({
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

// first, strip out unwanted error lines
html = html.replace(
/<div class="twoslash-meta-line twoslash-error-line">[^]+?<\/div>/g,
'\n'
);

const replacements: Array<{ start: number; end: number; content: string }> = [];

for (const match of html.matchAll(/<div class="twoslash-popup-docs">([^]+?)<\/div>/g)) {
Expand Down
Loading