Skip to content

Commit 563020b

Browse files
committed
fix: fill all empty code lines
closes #3305
1 parent 6c89943 commit 563020b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/node/markdown/plugins/highlight.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,8 @@ export async function highlight(
147147
return s
148148
}
149149

150-
const fillEmptyHighlightedLine = (s: string) => {
151-
return s.replace(
152-
/(<span class="line highlighted">)(<\/span>)/g,
153-
'$1<wbr>$2'
154-
)
150+
const fillEmptyLines = (s: string) => {
151+
return s.replace(/(<span class="line[^>]*>)(<\/span>)/g, '$1<wbr>$2')
155152
}
156153

157154
str = removeMustache(str).trimEnd()
@@ -175,6 +172,6 @@ export async function highlight(
175172
: { theme })
176173
})
177174

178-
return fillEmptyHighlightedLine(restoreMustache(highlighted))
175+
return fillEmptyLines(restoreMustache(highlighted))
179176
}
180177
}

0 commit comments

Comments
 (0)