Syntax highlighting fixes.
h3rald h3rald@h3rald.com
Mon, 19 Feb 2024 11:44:16 +0100
1 files changed,
6 insertions(+),
4 deletions(-)
jump to
M
rules.min
→
rules.min
@@ -105,13 +105,15 @@ symbol process-code
(str :text ==> str :result) ( "temp/highlight" :tmpfile - "chroma $# --html --html-only --html-prevent-surrounding-pre --fail" :cmd + "chroma $# --html --html-only --html-prevent-surrounding-pre" :cmd text "<pre>\s*<code[^>]*>([\s\S]+?)</code></pre>" ( :match - match 1 get escape :code + match 1 get :code + ; Unescape HTML entities code "(>|<|"|&)" ( :match match 1 get :ntt + (ntt ">" ==) (">") when@@ -124,9 +126,9 @@ when
(ntt "&" ==) ("&") when - ) replace-apply "\\\\\"" "\"" replace @code + ) replace-apply @code code tmpfile fwrite - cmd (tmpfile) =% run /output :out + "$#" (cmd) =% (tmpfile) =% run /output :out "<pre class=\"chroma\"><code>$#</code></pre>" (out) =% ) replace-apply @result )