I have a render hook for links to add target="_blank"
to external links, and it looks like this:
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>{{ .Text }}</a>
However, when I render the following markdown, putting an image in the contents of the link, the output is the img html as text within the a tag, as you can see from this devtools screenshot:
It’s important to note that when I take away the render hook (and the link is rendered how hugo intends it) the image shows up perfectly fine. I have already tried enabling unsafe
in the config file in case that helped, but it did not change anything. Is there something I am doing wrong here or is this a bug?
Thanks!