Quantcast
Viewing all articles
Browse latest Browse all 38

Lazy load is converting quotes from image attributes into HTML entities

Replies: 5

Hi, I’m having issues with lazy load, is converting quotes from additional image attributes to html entities, like this:

<img width="150" height="100" src="https://local.com/app/uploads/140520-150x150.jpg" class="w-full h-full object-cover" alt="Owen Pallett In Conflict" decoding="async" srcset="https://local.com/app/uploads/140520-150x100.jpg 150w, https://local.com/app/uploads/140520-300x199.jpg 300w, https://local.com/app/uploads/140520-620x413.jpg 620w, https://local.com/app/uploads/140520-218x145.jpg 218w, https://local.com/app/uploads/140520-640x426.jpg 640w, https://local.com/app/uploads/140520-320x213.jpg 320w, https://local.com/app/uploads/140520-298x198.jpg 298w, https://local.com/app/uploads/140520-313x209.jpg 313w, https://local.com/app/uploads/140520-191x127.jpg 191w, https://local.com/app/uploads/140520-158x105.jpg 158w, https://local.com/app/uploads/140520-414x276.jpg 414w, https://local.com/app/uploads/140520.jpg 940w" sizes="(max-width: 150px) 100vw, 150px" onerror="this.onerror=null; this.src='https://local.com/app/themes/a-theme/public/images/svg/logo.svg'; this.srcset='https://local.com/app/themes/a-theme/public/images/svg/logo.svg'; this.className='h-9 mx-auto top-[calc(50%-16px)] relative opacity-10';" />

I have been trying to figure out a way to prevent this, but the only way I figure it out that works is by adding html_entity_decode on the file

plugins/powered-cache/includes/classes/LazyLoad.php

At lines 335 and 336

array_push( $search, html_entity_decode( $img_html ) );
array_push( $replace, html_entity_decode( $replace_html ) )

Is there a better workaround for this issue?


Viewing all articles
Browse latest Browse all 38

Trending Articles