Images added in wrong place
cjlien42 opened this issue · comments
When building a responsive slide show using figure elements as slides, and figcaptions as descriptions, it works so long as I don't have any 'a' tags in the figcaption. If the description contains a link then the responsive image is added to the link instead of the figure.
Howdy, the script was selecting all a tags inside the picture element and adding the images. I've now changed it to only insert images into an a tag that is a direct child. It should now work like this:
<figure>
<a href="#">
<!-- Picture image will be inserted here -->
<noscript><img src="fallback.png"></noscript>
</a>
<figcaption>
This is some text with a <a href="#"><!-- This will be left alone -->link</a>.
</figcaption>
</figure>