fix: only select images that have non-data src
Previously, when the image url contained data, it tried to parse an url and failed, instead of keeping data. It have been fixed so that images where url is starting by 'data' are not modified.
This commit is contained in:
parent
970f510cd1
commit
cee0af6c3c
@ -92,7 +92,7 @@ where
|
||||
//
|
||||
let image_urls = {
|
||||
let document = Document::from(&html);
|
||||
let imgs = document.select("img");
|
||||
let imgs = document.select("img:not([src^=\"data:\"])");
|
||||
|
||||
imgs.iter()
|
||||
.map(|image| {
|
||||
@ -115,7 +115,7 @@ where
|
||||
|
||||
let html = {
|
||||
let document = Document::from(&html);
|
||||
let imgs = document.select("img");
|
||||
let imgs = document.select("img:not([src^=\"data:\"])");
|
||||
|
||||
imgs.iter()
|
||||
.zip(downloaded_images.iter())
|
||||
|
Loading…
Reference in New Issue
Block a user