aboutsummaryrefslogtreecommitdiff
path: root/layouts/shortcodes/math.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/math.html')
-rw-r--r--layouts/shortcodes/math.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/layouts/shortcodes/math.html b/layouts/shortcodes/math.html
new file mode 100644
index 0000000..a429888
--- /dev/null
+++ b/layouts/shortcodes/math.html
@@ -0,0 +1,8 @@
+{{ if or (hasPrefix .Inner "\n") (hasPrefix .Inner "<p>") }}
+ $$
+ {{ $inner := trim (.Inner | htmlUnescape) "$\n " }}
+ {{- replace $inner "\n" " " -}}
+ $$
+{{ else }}
+ ${{- trim (.Inner | htmlUnescape) "$\n " -}}$
+{{ end }}