diff --git a/layouts/partials/components/markdownify.html b/layouts/partials/components/markdownify.html index 2eb7fbe9..404d833c 100644 --- a/layouts/partials/components/markdownify.html +++ b/layouts/partials/components/markdownify.html @@ -17,7 +17,7 @@ {{- $Content := $Deliver.Scratch.Get "Content" -}} {{- if $Deliver.Site.Params.compatibleWithLaTeX -}} {{- if or ($Deliver.Params.katex | default $Deliver.Site.Params.enableKaTeX) ($Deliver.Params.mathjax | default $Deliver.Site.Params.enableMathJax) -}} - {{- $regexLaTeX := `([^\$]|\n)\$(.+)\$` -}} + {{- $regexLaTeX := `([^\$]|\n)\$([^\$]+)\$` -}} {{- $replacementLaTeX := `$1$$${2}$$` -}} {{- $Content := $Content | replaceRE $regexLaTeX $replacementLaTeX -}}