wp-pwa / saturn-theme

This project was renamed and moved to https://github.com/frontity.
https://frontity.org
Apache License 2.0
5 stars 2 forks source link

Use data-src for images if it exists in content #171

Closed SantosGuillamot closed 6 years ago

SantosGuillamot commented 6 years ago

Some WP may have lazy load plugins installed with the correct src in data-src, like this:

<img data-expand="600" class="lazyload aligncenter wp-image-8578 size-full" src="https://mediamaklumat.com/wp-content/plugins/media-ace/includes/lazy-load/images/blank.png" data-src="https://mediamaklumat.com/wp-content/uploads/2018/10/cara-buat-nasi-lemak.jpg"

so we should use data-src if it is present.

First demo affected by this issue: https://docs.google.com/spreadsheets/d/1FWcvX7KiLAppGW2qOICxs8ATWqV1uEsCVdTnq5mK7q8/edit#gid=0&range=A9


luisherranz commented 6 years ago

We should check if data-src exists in the h2r processor: https://github.com/frontity/saturn-theme/blob/master/src/shared/processors/low/image.js#L52

and when checking for image ids in the plugin: https://github.com/frontity/wp-plugin/blob/master/wp-pwa.php#L303

orballo commented 6 years ago

The plugin part will be developed later in https://github.com/frontity/wp-plugin/issues/45 because is not relevant to demos and therefore not urgent.

frontibotito commented 6 years ago

:tada: This issue has been resolved in version 0.12.3 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: