feat: update mermaid shortcode

This commit is contained in:
Henk Verlinde
2021-06-30 20:32:28 +02:00
parent f7867376fb
commit b7eda85593
4 changed files with 36 additions and 19 deletions

View File

@ -1,3 +1,8 @@
<div class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}">
{{- .Inner -}}
</div>
{{ if .Site.Params.options.mermaid -}}
<div class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}">
{{ $data := replaceRE "(^\\s+```)" "" .Inner -}}
{{ replaceRE "(```\\s+$)" "" $data -}}
</div>
{{ else }}
{{ errorf "Set `mermaid = true` in `./config/_default/params.toml`"}}
{{ end }}