{{- $cols := .Get "cols" | default "2" -}}

<div class="my-8 grid gap-4" style="grid-template-columns: repeat({{ $cols }}, 1fr)">
  {{- range $line := strings.Split .Inner "\n" -}}
    {{- if strings.Contains $line "![" -}}
      {{- $image := strings.TrimSpace $line -}}
      {{- if $image -}}
        {{ $image | markdownify | safeHTML }}
      {{- end -}}
    {{- end -}}
  {{- end -}}
</div>
