From ec1c1f55c39318a22a3d73cd1540c944ef92999c Mon Sep 17 00:00:00 2001 From: Stefano Ottolenghi Date: Mon, 12 Feb 2024 10:37:32 +0100 Subject: [PATCH] Fix line highlighting not working on last line of code blocks. --- src/js/vendor/highlight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/vendor/highlight.js b/src/js/vendor/highlight.js index bee0fdff..d9599693 100644 --- a/src/js/vendor/highlight.js +++ b/src/js/vendor/highlight.js @@ -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*.*?\bmark-line\b.*?<\/span>\n/mg, '
$1$2
') + result.value = result.value.replaceAll(/^(\s*)(.+?)\s*.*?\bmark-line\b.*?<\/span>\n?/mg, '
$1$2
') } }); })()