chore: server side rendering of math equations (#589)

This commit is contained in:
Andreas Deininger
2025-03-30 19:05:35 +02:00
committed by GitHub
parent c74d44492e
commit b700825943
76 changed files with 47 additions and 81 deletions

View File

@ -0,0 +1,9 @@
{{- $opts := dict "output" "htmlAndMathml" "displayMode" (eq .Type "block") }}
{{- with try (transform.ToMath .Inner $opts) }}
{{- with .Err }}
{{ errorf "Unable to render mathematical markup to HTML using the transform.ToMath function. The KaTeX display engine threw the following error: %s: see %s." . $.Position }}
{{- else }}
{{- .Value }}
{{- $.Page.Store.Set "hasMath" true }}
{{- end }}
{{- end -}}