fix: fill all empty code lines

closes #3305
pull/3398/head
Divyansh Singh 6 months ago
parent 6c899437c1
commit 563020ba61

@ -147,11 +147,8 @@ export async function highlight(
return s return s
} }
const fillEmptyHighlightedLine = (s: string) => { const fillEmptyLines = (s: string) => {
return s.replace( return s.replace(/(<span class="line[^>]*>)(<\/span>)/g, '$1<wbr>$2')
/(<span class="line highlighted">)(<\/span>)/g,
'$1<wbr>$2'
)
} }
str = removeMustache(str).trimEnd() str = removeMustache(str).trimEnd()
@ -175,6 +172,6 @@ export async function highlight(
: { theme }) : { theme })
}) })
return fillEmptyHighlightedLine(restoreMustache(highlighted)) return fillEmptyLines(restoreMustache(highlighted))
} }
} }

Loading…
Cancel
Save