{{- $page := .page }} {{- if and (not $page) .context }} {{- $page = .context }} {{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'mermaid' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }} {{- end }} {{- $content := .content }} {{- $align := .align | default "center" }} {{- $zoom := $page.Site.Params.mermaidZoom | default false }} {{- with $page.Params.mermaidZoom }} {{- $zoom = . }} {{- if eq (printf "%T" .) "string" }} {{- $zoom = (eq . "true") }} {{- end }} {{- end }} {{- with .zoom }} {{- $zoom = . }} {{- if eq (printf "%T" .) "string" }} {{- $zoom = (eq . "true") }} {{- end }} {{- end }} {{- with $page }}
{{- replaceRE "'" "'" ( replaceRE """ "\"" ( $content | safeHTML ) ) -}}
{{- .Store.Set "hasMermaid" true }} {{- end }}