{{ $align := .align | default "center" }} {{ $caption := .caption | markdownify }} {{ $compact := .compact }} {{ $content := .content | markdownify }} {{ $float := .float }} {{ $gap := .gap | default "2" }} {{ $height := .height }} {{ $maxheight := .maxheight }} {{ $maxwidth := .maxwidth }} {{ $width := .width }} {{ $bottommargin := true }} {{ if $compact }} {{ $bottommargin = false }} {{ end }} {{ $table := false }} {{ if or $compact $float }} {{ $table = true }} {{ end }} {{ $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 }} {{ $sidemargin := "" }} {{ if $float }} {{ if eq $float "start" }} {{ $sidemargin = "me-4" }} {{ else if eq $float "end" }} {{ $sidemargin = "ms-4" }} {{ else }} {{ errorf "invalid float: %q" $float }} {{ end }} {{ end }}
{{ if and (not $float) $style }}
{{ end }} {{ if $table }}
{{ end }}
{{ $content }}
{{ with $caption }}
{{ . }}
{{ end }} {{ if $table }}
{{ end }} {{ if and (not $float) $style }}
{{ end }}