sal0max / grav-plugin-shortcode-gallery-plusplus

A Shortcode extension to add sweet galleries with a lightbox to your Grav website.
MIT License
33 stars 8 forks source link

this plugin doesn't seem to work along with "trilbymedia/grav-plugin-image-captions" #8

Closed vecjh closed 3 years ago

vecjh commented 3 years ago

Hello, I have your plugin with default configuraiton. When I have "trilbymedia/grav-plugin-image-captions" plugin enabled and reference an image with 'caption' class in my page, i.e.

![](image1.jpg?classes=caption,center "My image caption")

Then any [gallery] within the same page is not rendered anymore.

The source section becomes just empty:

<p id="6977931">
    </p>
....
    <script src="/assets/5246ceab977a56b766085feb05e6a042.js"></script>
<script>
$("#6977931").justifiedGallery({
    rowHeight: 400,
    margins: 8,
    lastRow: "nojustify",
    captions: false,
    border: 0,
});

GLightbox({
    selector: ".glightbox-6977931",
    openEffect: "zoom",
    closeEffect: "fade",
    slideEffect: "slide",
    closeButton: true,
    touchNavigation: true,
    touchFollowAxis: true,
    keyboardNavigation: true,
    closeOnOutsideClick: true,
    loop: true,
    draggable: true,
    descPosition: "bottom",
});
</script>

While it still works if the same image comes only with the 'center' class selector. ![](image1.jpg?classes=center "My image caption")

Just in case - I use "quark-open-publishing" theme

sal0max commented 3 years ago

Thanks for the info. I took a look at this behavior and found the following:

Without the image-captions plugin intervening, a Markdown image link like ![](image.jpg) gets converted to e.g.

<img alt="" src="/user/pages/demo/image.jpg" />

With the image-captions plugin the Markdown ![](image.jpg?classes=caption "Caption") gets converted to:

<figure class="image-caption">
   <img title="Caption" alt="" class="caption" src="/user/pages/demo/image.jpg">
   <figcaption class="">My Image Caption</figcaption>
</figure>

Besides the figure-stuff, there's a major difference:

The Regex my plugin includes, expected the closing Tag to be there.

So, tldr;: That's a quick fix I can do. Thanks for this issue. Update is on its way.

sal0max commented 3 years ago

Fixed in 6cfda86341ffd0da663168b854581cd9534f9416

vecjh commented 3 years ago

wow, thanks a lot for prompt feedback! I confirm it works now.