{{ $align := .Get "align" | default "center" }} {{ $caption := .Get "caption" | markdownify }} {{ $cite := (.Get 0 | default (.Get "cite")) | markdownify }} {{ $float := .Get "float" }} {{ $height := .Get "height" }} {{ $maxheight := .Get "maxheight" }} {{ $maxwidth := .Get "maxwidth" }} {{ $width := .Get "width" }} {{ $content := .Inner | markdownify }} {{ $style := "" }} {{ if $height }} {{ with printf "height: %v" $height }} {{ if $style }} {{ $style = printf "%v; %v" $style . }} {{ else }} {{ $style = . }} {{ end }} {{ end }} {{ end }} {{ if $maxheight }} {{ with printf "max-height: %v" $maxheight }} {{ if $style }} {{ $style = printf "%v; %v" $style . }} {{ else }} {{ $style = . }} {{ end }} {{ end }} {{ end }} {{ if $maxwidth }} {{ with printf "max-width: %v" $maxwidth }} {{ if $style }} {{ $style = printf "%v; %v" $style . }} {{ else }} {{ $style = . }} {{ end }} {{ end }} {{ end }} {{ if $width }} {{ with printf "width: %v" $width }} {{ if $style }} {{ $style = printf "%v; %v" $style . }} {{ else }} {{ $style = . }} {{ end }} {{ end }} {{ end }} {{ $margin := "" }} {{ if $float }} {{ if eq $float "start" }} {{ $margin = "me-4" }} {{ else if eq $float "end" }} {{ $margin = "ms-4" }} {{ else }} {{ errorf "invalid float: %q" $float }} {{ end }} {{ end }}
{{ if $float }}
{{ end }} {{ if $caption }}
{{ end }}
{{ $content }}
{{ if $caption }}
{{ end }} {{ with $caption }}
{{ . }}
{{ end }} {{ with $cite }} {{ end }} {{ if $float }}
{{ end }}