all repos — h3rald @ 36c66a24de64febaaeaa74147a52cd6863149f4f

The sources of https://h3rald.com

Syntax highlighting fixes.
h3rald h3rald@h3rald.com
Mon, 19 Feb 2024 11:44:16 +0100
commit

36c66a24de64febaaeaa74147a52cd6863149f4f

parent

6c4e935e58e68d02c65e020d1dcdbac2dfbc2478

1 files changed, 6 insertions(+), 4 deletions(-)

jump to
M rules.minrules.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 "(&gt;|&lt;|&quot;|&amp;)" ( :match match 1 get :ntt + (ntt "&gt;" ==) (">") when

@@ -124,9 +126,9 @@ when

(ntt "&amp;" ==) ("&") 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 )