sqrtminusone.github.io/layouts/shortcodes/math.html

8 lines
238 B
HTML

{{ if or (hasPrefix .Inner "\n") (hasPrefix .Inner "<p>") }}
$$
{{ $inner := trim (.Inner | htmlUnescape) "$\n " }}
{{- replace $inner "\n" " " -}}
$$
{{ else }}
${{- trim (.Inner | htmlUnescape) "$\n " -}}$
{{ end }}