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:
parent
35f5e1353d
commit
feb37f5812
@ -158,7 +158,7 @@ pub fn walk_and_embed_assets(
|
|||||||
}
|
}
|
||||||
"img" => {
|
"img" => {
|
||||||
for attr in attrs_mut.iter_mut() {
|
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();
|
let value = attr.value.to_string();
|
||||||
|
|
||||||
// Ignore images with empty source
|
// Ignore images with empty source
|
||||||
|
Loading…
Reference in New Issue
Block a user