magefan / module-lazyload

https://magefan.com/magento-2-image-lazy-load-extension
Other
53 stars 16 forks source link

Bug if there is no img tag src attribute #24

Closed MyroslavDobra closed 2 years ago

MyroslavDobra commented 3 years ago

In case of there is img without src attribute regex in \Magefan\LazyLoad\Plugin\BlockPlugin::afterToHtml is too "hungry" and "eat" all over img tag. Example:

<div class="new-bestseller-block-main">
<div class="new-block">
<div class="new-block-inner">
<div class="content">
<div class="img-right"><img test="test-2.png" alt=""></div>
</div>
</div>
<div class="best-seller-block">
<span>
        <img class="product-image-photo"
                        src="test.jpg"
            max-width="201"
            max-height="188"
            alt="" /></span>
</div>
<span>
        <img class="product-image-photo"
                        src="test_1.jpg"
            max-width="201"
            max-height="188"
            alt=""/>
</span>
magefan commented 3 years ago

Hello @MyroslavDobra , could you please make sure that you use the latest Lazy Load extension version 2.0.15? Looks like this issue has already been fixed https://github.com/magefan/module-lazyload/pull/20/files

Could you please check if it works for you?