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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue