Loading Mastodon feed … | WordPress.org

Some image lazy loading plugin seems to break the JavaScript code. It tries to inject lazy loading code, but breaks the JavaScript code in the process:

return string.replace(':' + emoji.shortcode + ':', '<img src="data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width="0"%20height="0"%20viewBox=%270%200%200%200%27%3E%3C/svg%3E" loading="lazy" data-lazy="1" decoding="async" class="tf_svg_lazy emoji" data-tf-src="' + emoji.url + '" title="' + emoji.shortcode + '" /><noscript><img class="emoji" data-tf-not-load src="' + emoji.url + '" title="' + emoji.shortcode + '" /></noscript>');

The original source code of the mastodon plugin looks like this:

return string.replace(':' + emoji.shortcode + ':', '<img class="emoji" src="' + emoji.url + '" title="' + emoji.shortcode + '" />');

Typically those optimization plugins allow to define exceptions. If you can define an exception for all images with the class “emoji” it should stop breaking the plugin.

Other quick-fix would be to disable the plugin that breaks the JavaScript code.

Can you provide me with the name of the image lazy loading / optimization / caching plugin that you are using? I might find some time to look into it a bit deeper.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer