{{ $error := false }} {{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "accordion" "args" .Params) }} {{ errorf "Invalid arguments: %s" .Position -}} {{ $error = true }} {{ end }} {{ if not $error }} {{- $id := printf "accordion-%d" .Ordinal -}} {{ with .Get "id" }}{{ $id = . }}{{ end }} {{- $class := .Get "class" | default "" -}} {{- $open := false -}} {{ with .Get "always-open" }}{{ $open = partial "utilities/CastBool.html" . }}{{ end -}} {{- $body := .Inner -}} {{- if $open -}} {{- $pattern := printf "data-bs-parent=\"#%s\"" $id -}} {{- $body = (replace .Inner $pattern "") }} {{- end -}}
{{- $body | safeHTML -}}
{{ end }}