Nested a/link elements inside an include not rendering correctly in jekyll liquid

I went with includes because I was using this same concept not just for headers but for images all throughout the post. In the case of having more than one image in the post, putting it in frontmatter doesn’t really scale.

Here’s what the output looks like:

If I don’t have a link inside the include figcaption, it renders just fine with no weirdness.

To be clear, this only affects rendering on the main index page where I’m looping through things. On the single/post page, it’s fine.