hugo-theme-relearn/layouts/partials/shortcodes/mermaid.html
Sören Weber f06fef8d3c
mermaid: remove W3C validator errors #337
escaping of special characters is omitted resulting in illegal content,
safeHTML does escape too much, so we revert it partly
2022-10-07 20:08:12 +02:00

9 lines
No EOL
304 B
HTML

{{- $context := .context }}
{{- $content := .content }}
{{- $align := .align | default "center" }}
{{- with $context }}
<div class="mermaid" align="{{ $align }}">
{{- replaceRE "&#39;" "'" ( replaceRE "&#34;" "\"" ( $content | safeHTML ) ) -}}
</div>
{{- .Page.Store.Set "hasMermaid" true }}
{{- end }}