Added support for lazy loaded images

Note: The way this patch works is by resolving any data-src tags on images in
the same way as normal source tags are resolved.  It is assumed that most
lazy-load libraries will use this tag, and that if this tag is set, then it is a
URL that is in use.
This commit is contained in:
Emi Simpson 2019-12-06 19:27:41 -05:00
parent 35f5e1353d
commit feb37f5812
No known key found for this signature in database
GPG key ID: 68FAB2E2E6DFC98B

View file

@ -158,7 +158,7 @@ pub fn walk_and_embed_assets(
}
"img" => {
for attr in attrs_mut.iter_mut() {
if &attr.name.local == "src" {
if &attr.name.local == "src" || &attr.name.local == "data-src" {
let value = attr.value.to_string();
// Ignore images with empty source