Use goldmark-mathjax extension

I found a new workaround. It works well for me as the same as when I use the math shortcode which includes {{ .Inner }}.

But, this will break other elements, is not practical. We need the goldmark-mathjax extension to solve this problem.

Template:

{{ $content := $.Content | replaceRE "\\<br>" "\\" }}
{{ $content | safeHTML }}

Markdown:

{{< math >}}
\begin{vmatrix}a & b\\
c & d
\end{vmatrix}
{{< /math >}}

$$
\begin{vmatrix}a & b\\
c & d
\end{vmatrix}
$$

Screen Shot 2020-12-12 at 20.32.04

1 Like