Skip to content

Commit

Permalink
Fix line highlighting not working on last line of code blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano-ottolenghi committed Feb 12, 2024
1 parent a92114e commit ec1c1f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/vendor/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
// eat away line breaks or they would be doubled by the div
hljs.addPlugin({
'after:highlightElement': ({ el, result, text }) => {
result.value = result.value.replaceAll(/^(\s*)(.+?)\s*<span class="hljs-comment">.*?\bmark-line\b.*?<\/span>\n/mg, '<div class="highlight-line">$1$2</div>')
result.value = result.value.replaceAll(/^(\s*)(.+?)\s*<span class="hljs-comment">.*?\bmark-line\b.*?<\/span>\n?/mg, '<div class="highlight-line">$1$2</div>')
}
});
})()

0 comments on commit ec1c1f5

Please sign in to comment.