mirror of
https://github.com/imfing/hextra.git
synced 2025-06-20 12:11:23 -04:00
chore: server side rendering of math equations (#589)
This commit is contained in:

committed by
GitHub

parent
c74d44492e
commit
b700825943
9
layouts/_default/_markup/render-passthrough.html
Normal file
9
layouts/_default/_markup/render-passthrough.html
Normal 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 -}}
|
Reference in New Issue
Block a user