From 9a41223e9fe2336ad0ffe877e8287c084151fd2d Mon Sep 17 00:00:00 2001 From: Olivier Roques Date: Wed, 23 Sep 2020 11:14:59 +0200 Subject: Add math shortcode --- layouts/shortcodes/math.html | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 layouts/shortcodes/math.html (limited to 'layouts/shortcodes') 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 "

") }} + $$ + {{ $inner := trim (.Inner | htmlUnescape) "$\n " }} + {{- replace $inner "\n" " " -}} + $$ +{{ else }} + ${{- trim (.Inner | htmlUnescape) "$\n " -}}$ +{{ end }} -- cgit v1.2.3