Closed talu-zz closed 5 years ago
When i wrap an image in a link i get this:
[![My Image Alt Text](P.jpg?classes=caption,figure-right "My Image Caption")](http://www.google.com)
<p>
<a href="http://www.google.com">
<figure class="image-caption figure-right">
<img title="My Image Caption" alt="My Image Alt Text" class="caption figure-right" src="/grav-demo-sampler/user/pages/06.core/01.markdown/P.jpg">
<figcaption class="">My Image Caption</figcaption>
</figure>
</a>
</p>
I have the same problem, I write:
[![My Image Alt Text](ico.png?classes=caption,figure-right "My Image Caption")](http://www.google.com)
[![My Image Alt Text](ico.png?classes=caption,figure-right "My Image Caption")](http://www.google.com)
I get the output:
<p><a href="http://www.google.com"></a></p>
<figure class="image-caption figure-right"><a href="http://www.google.com"><img title="My Image Caption" alt="My Image Alt Text"
class="caption figure-right" src="/user/pages/01.home/ico.png">
<figcaption class="">My Image Caption</figcaption>
</a></figure>
<a href="http://www.google.com">
<figure class="image-caption figure-right"><img title="My Image Caption" alt="My Image Alt Text" class="caption figure-right"
src="/user/pages/01.home/ico.png">
<figcaption class="">My Image Caption</figcaption>
</figure>
</a>
<p></p>
if I disable the plugin, then the output:
<p>
<a href="http://www.google.com"><img title="My Image Caption" alt="My Image Alt Text" class="caption figure-right" src="/user/pages/01.home/ico.png"></a>
<a href="http://www.google.com"><img title="My Image Caption" alt="My Image Alt Text" class="caption figure-right" src="/user/pages/01.home/ico.png"></a>
</p>
This fix does not work. I updated the file image-captions.php
, but nothing has changed
Did you clear cache?
If that doesn’t help, please zip up a sample page for me as my fix sorts all my test cases.
Ok, made another fix that does seem to work with your content
No, all the same. I have already tried to completely remove and clone the plugin, nothing has changed
Ok, fixed your problem. It was related to the extra spacing you had in your links:
[ ![Шпаргалка: команды в линуксе](ico.png?classes=caption "Шпаргалка: команды в линуксе") ](/articles/bash-cribs)
rather than:
[![Шпаргалка: команды в линуксе](ico.png?classes=caption "Шпаргалка: команды в линуксе")](/articles/bash-cribs)
That I had in my testing
BTW released 2.0.0 which contains this.
Hi,
it seems like a linked image lost its link when using the image caption plugin since the link is not wrapped by the figure tag.
The markdown
![](Foto-aussen.jpg?lightbox=1200&classes=caption "Some caption")
produces the following html
I think if the image is wrapped by a link, the link element and not the image itself should be used as figure children.