{{ $dest := .Destination }} {{ $text := .PlainText }} {{ $url := urls.Parse $dest }} {{ if .Title }}
{{ if eq $url.Scheme "" }} {{ with $image := resources.Get $dest }} {{ if eq $image.MediaType.SubType "svg" }} {{ $image.Content | safeHTML }} {{ else }} {{ $text }} {{ end }} {{ end }} {{ else }} {{ $text }} {{ end }}
{{ .Title | markdownify }}
{{ else }} {{ if eq $url.Scheme "" }} {{ with $image := resources.Get $dest }} {{ if eq $image.MediaType.SubType "svg" }} {{ $image.Content | safeHTML }} {{ else }} {{ $text }} {{ end }} {{ end }} {{ else }} {{ $text }} {{ end }} {{ end }}