aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2020-01-13 19:05:54 +0100
committerAlex Shpak <alex-shpak@users.noreply.github.com>2020-01-13 19:05:54 +0100
commit9fa444757af943adfe6c4c9b39dddae9738ab82b (patch)
treeb009b1ce83f3db177725d0a6751ca32305c1b309 /layouts
parentb9f45270a07a49851979f3a5a7acf449eb1ad3f3 (diff)
#117, Update KaTeX shortcode, add displayMode param
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/katex.html9
1 files changed, 5 insertions, 4 deletions
diff --git a/layouts/shortcodes/katex.html b/layouts/shortcodes/katex.html
index c3c36aa..ce7a6d9 100644
--- a/layouts/shortcodes/katex.html
+++ b/layouts/shortcodes/katex.html
@@ -7,7 +7,8 @@
{{ .Page.Scratch.Set "katex" true }}
{{ end }}
-<p class="katex{{ with .Get "class" }} {{ . }}{{ end }}">
- $$ {{- .Inner -}} $$
-</p>
-
+<span class="katex{{ with .Get "class" }} {{ . }}{{ end }}">
+ {{ if in .Params "display" }}\[{{ else }}\({{ end -}}
+ {{ $.Inner }}
+ {{- if in .Params "display" }}\]{{ else }}\){{ end }}
+</span>