{{ if .IsNamedParams }}
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
    <figcaption>{{ .Get "caption" }}</figcaption>
    {{ .Inner }}
</figure>
{{ else }}
<figure{{ if len .Params | eq 2 }} class="{{ .Get 1 }}"{{ end }}>
    <figcaption>{{ .Get 0 }}</figcaption>
    {{ .Inner }}
</figure>
{{ end }}
{{- if .IsNamedParams -}}
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
    <figcaption>{{ .Get "caption" }}</figcaption>
    <pre><code>{{ trim .Inner "\r\n " }}</code></pre>
</figure>
{{- else -}}
<figure{{ if len .Params | eq 2 }} class="{{ .Get 1 }}"{{ end }}>
    <figcaption>{{ .Get 0 }}</figcaption>
    <pre><code>{{ trim .Inner "\r\n " }}</code></pre>
</figure>
{{- end -}}
Update for changing shortcode specification at Hugo 0.55
Update for changing shortcode specification at Hugo 0.55

don't expect 'markdownify' at '.Inner'
