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.
pull/80/head
Emi Simpson 5 years ago
parent 35f5e1353d
commit feb37f5812
No known key found for this signature in database
GPG Key ID: 68FAB2E2E6DFC98B

@ -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

Loading…
Cancel
Save