aboutsummaryrefslogtreecommitdiff
path: root/layouts/shortcodes
diff options
context:
space:
mode:
authorOlivier Roques <olivier@oroques.dev>2020-09-23 11:14:59 +0200
committerOlivier Roques <olivier@oroques.dev>2020-09-23 11:14:59 +0200
commit9a41223e9fe2336ad0ffe877e8287c084151fd2d (patch)
tree7506da68500429d4dab61f4067c53e256eb96103 /layouts/shortcodes
parent31c7c34c8fe11acacb02e83e5c5b457704f65cd9 (diff)
Add math shortcode
Diffstat (limited to 'layouts/shortcodes')
-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 }}