Add link to figure caption

I’m using the following approach to display a caption below an image inside a markdown post:

{{< figure src=“figure.jpg” title=“A Caption” >}}

But how do I add a link to the caption (e.g. for attribution)? HTML inside the title doesn’t seem to get parsed.

{{< figure src=“figure.jpg” title="A Caption <a href=“example.com”>link</a> " >}}

Thanks for any help!

Use the caption attribute of the shortcode instead of title for the caption. Markdown/HTML should get rendered in that attribute.

Thanks. This works!

{{< figure src=“figure.jpg” caption=“A Caption with a [link](example.com)” >}}

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.