all repos — h3rald @ 328f17b4aaf709197aa155d3aaaf7c251b1ed689

The sources of https://h3rald.com

Syntax highlighting.
h3rald h3rald@h3rald.com
Sun, 18 Feb 2024 15:04:02 +0100
commit

328f17b4aaf709197aa155d3aaaf7c251b1ed689

parent

f6ae14f0b4f21f96a22e2fba49bd1c4afd7936ee

2 files changed, 9 insertions(+), 10 deletions(-)

jump to
M assets/styles/chroma.cssassets/styles/chroma.css

@@ -55,9 +55,9 @@ padding: 0 0.4em 0 0.4em;

color: #6e7681 } - .chroma .line { + /*.chroma .line { display: flex; - } + }*/ .chroma .k { color: #ff7b72
M rules.minrules.min

@@ -104,30 +104,29 @@ (

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