all repos — h3rald @ 44ebce1545ba7d70d66bf11865d6d7ea7dc69a3a

The sources of https://h3rald.com

Fixed double escaping.
h3rald h3rald@h3rald.com
Sun, 18 Feb 2024 14:44:54 +0100
commit

44ebce1545ba7d70d66bf11865d6d7ea7dc69a3a

parent

c88d4d815569086d4562bf71e172eb5a61bc2dff

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

jump to
M rules.minrules.min

@@ -104,12 +104,28 @@ (

symbol process-code (str :text ==> str :result) ( - "echo \"$#\" | chroma --html --html-only" :cmd + "echo \"$#\" | chroma --html --html-only --html-prevent-surrounding-pre" :cmd text "<pre>\s*<code[^>]*>([\s\S]+?)</code></pre>" ( :match match 1 get escape :code - cmd (code) =% run /output puts ;:out - ;"<code class=\"chroma\">$#</code>" (out) =% + code "&(gt|lt|quot|amp);" ( + :match + match 1 get :ntt + (ntt "gt" ==) + (">") + when + (ntt "lt" ==) + ("<") + when + (ntt "quot" ==) + ("\"") + when + (ntt "amp" ==) + ("&") + when + ) replace-apply @code + cmd (code) =% run /output :out + "<pre class=\"chroma\"><code>$#</code></pre>" (out) =% ) replace-apply @result )

@@ -226,7 +242,6 @@ (

content /id :id (content /content-type "project" ==) (content PROJECTS append @PROJECTS) when content - ;process-tags "." print! process-timestamp process-content