{{ $content := .Inner }} {{ $id := delimit (split (md5 $content) "" | shuffle) "" | printf "tp-%s" }} {{ if .Get "raw" }} {{ $content = trim $content "\n" }}
{{ else if .Get "code" }} {{ $content = highlight $content (.Get "code") "encoding=utf-8" }} {{ $content = replaceRE `
\s*?
\s*?(?s)(.*?)\s*?
\s*?
` "$1" $content }} {{ $content = trim $content "\n" }} {{ $content = replaceRE `\n` "\n" $content }} {{ $content = replaceRE `(?m)^()(.*?)\[(.*?)\]\((.*?)\)(.*?)()` "$1$2$6$3$1$5$6" $content }} {{ $content = replaceRE ` ` " " $content | replaceRE `(<\w+) ` "$1 " | replaceRE `\n` "
" }}
{{ else }} {{ $tag := .Get "tag" | default "p" }} {{ $content = $content | markdownify | chomp }} {{ $content = trim $content "\n" }} {{ printf "<%s class=%s id=%s>" $tag (.Get "class" | default "typeit") $id $tag | safeHTML }} {{ end }}