fix: smarter typeit shortcode

Signed-off-by: Dillon ZENG <dillonzq@outlook.com>
This commit is contained in:
Dillon ZENG 2019-08-11 04:12:05 +08:00
parent c0237f3805
commit 0882180daa

View file

@ -12,7 +12,7 @@
{{ $content = replaceRE `\n</span>` "</span>\n" $content }}
{{ $content = replaceRE `(?m)^(<span.*?>)(.*?)\[(.*?)\]\((.*?)\)(.*?)(</span>)` "$1$2$6<a href=$4>$3</a>$1$5$6" $content }}
{{ $content = replaceRE `(?m)^( +)<span` "<span class=space>$1</span><span" $content }}
{{ $content = replaceRE `</span>( +)<span` "</span></span><span class=space>$1</span><span" $content | replaceRE `\n` "<br />" }}
{{ $content = replaceRE `</span>( +)<span` "</span><span class=space>$1</span><span" $content | replaceRE `\n` "<br />" }}
<div id={{ printf "r%s" $id }} hidden=true>{{ $content | safeHTML }}</div>
<div class={{ .Get "class" | default "typeit-code" }} id={{ $id }}></div>
{{ else }}