summaryrefslogtreecommitdiff
path: root/layouts/_markup
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-09-09 14:05:02 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-09-09 14:05:02 +0800
commit073191903c305db0c977b8d3e01b96c80805ab3e (patch)
treef5018143067339cd977007ea3b44fc6cdbcda847 /layouts/_markup
parentf060932e61855f4948e9a87097382af2d24c9d07 (diff)
Add build-time MathML rendering
Diffstat (limited to 'layouts/_markup')
-rw-r--r--layouts/_markup/render-passthrough.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/layouts/_markup/render-passthrough.html b/layouts/_markup/render-passthrough.html
new file mode 100644
index 0000000..4e4e779
--- /dev/null
+++ b/layouts/_markup/render-passthrough.html
@@ -0,0 +1,13 @@
+{{- $options := dict
+ "displayMode" (eq .Type "block")
+ "output" "mathml"
+ "strict" "error"
+ "throwOnError" true
+-}}
+{{- with try (transform.ToMath .Inner $options) -}}
+ {{- with .Err -}}
+ {{- errorf "Unable to render mathematical markup at %s: %s" $.Position . -}}
+ {{- else -}}
+ {{- .Value -}}
+ {{- end -}}
+{{- end -}}