all repos — h3rald @ 6c4e935e58e68d02c65e020d1dcdbac2dfbc2478

The sources of https://h3rald.com

Highlighting.
h3rald h3rald@h3rald.com
Sun, 18 Feb 2024 21:42:05 +0000
commit

6c4e935e58e68d02c65e020d1dcdbac2dfbc2478

parent

328f17b4aaf709197aa155d3aaaf7c251b1ed689

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

jump to
M rules.minrules.min

@@ -104,7 +104,8 @@ (

symbol process-code (str :text ==> str :result) ( - "echo '$#' | chroma --html --html-only --html-prevent-surrounding-pre --fail" :cmd + "temp/highlight" :tmpfile + "chroma $# --html --html-only --html-prevent-surrounding-pre --fail" :cmd text "<pre>\s*<code[^>]*>([\s\S]+?)</code></pre>" ( :match match 1 get escape :code

@@ -124,7 +125,8 @@ (ntt "&amp;" ==)

("&") when ) replace-apply "\\\\\"" "\"" replace @code - cmd (code) =% run /output :out + code tmpfile fwrite + cmd (tmpfile) =% run /output :out "<pre class=\"chroma\"><code>$#</code></pre>" (out) =% ) replace-apply @result )