{{- $raw := (markdownify .Inner | chomp) -}} {{- $block := findRE "(?is)^<(?:address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h(?:1|2|3|4|5|6)|header|hgroup|hr|li|main|nav|noscript|ol|output|p|pre|section|table|tfoot|ul|video)\\b" $raw 1 -}} {{- $blockType := .Get 0 | default "info" -}} {{ $icon := "💡" }} {{ $title := .Get 1 | default "NOTE" }} {{ if (eq $blockType "warning") }} {{ $icon = "⚠" }} {{ $title = .Get 1 | default "WARNING" }} {{ end }} {{ if (eq $blockType "important") }} {{ $icon = "❗" }} {{ $title = .Get 1 | default "IMPORTANT" }} {{ end }}
{{ $icon }} {{ $title }}
{{- if or $block (not $raw) }} {{ $raw }} {{ else }}{{ $raw }}
{{ end -}}