Skip to content

Commit 8a52f97

Browse files
authored
fix #354 (#416)
1 parent ca4da1f commit 8a52f97

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,13 @@ async function syntax_highlight({
680680
if (check) {
681681
// munge the twoslash output so that it renders sensibly. the order of operations
682682
// here is important — we need to work backwards, to avoid corrupting the offsets
683+
684+
// first, strip out unwanted error lines
685+
html = html.replace(
686+
/<div class="twoslash-meta-line twoslash-error-line">[^]+?<\/div>/g,
687+
'\n'
688+
);
689+
683690
const replacements: Array<{ start: number; end: number; content: string }> = [];
684691

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

0 commit comments

Comments
 (0)