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

Loading…
Cancel
Save