Skip to content

Commit ec1c1f5

Browse files
Fix line highlighting not working on last line of code blocks.
1 parent a92114e commit ec1c1f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/vendor/highlight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
// eat away line breaks or they would be doubled by the div
134134
hljs.addPlugin({
135135
'after:highlightElement': ({ el, result, text }) => {
136-
result.value = result.value.replaceAll(/^(\s*)(.+?)\s*<span class="hljs-comment">.*?\bmark-line\b.*?<\/span>\n/mg, '<div class="highlight-line">$1$2</div>')
136+
result.value = result.value.replaceAll(/^(\s*)(.+?)\s*<span class="hljs-comment">.*?\bmark-line\b.*?<\/span>\n?/mg, '<div class="highlight-line">$1$2</div>')
137137
}
138138
});
139139
})()

0 commit comments

Comments
 (0)