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:
koalp 2021-05-13 20:30:27 +02:00
parent 970f510cd1
commit cee0af6c3c
Signed by: koalp
GPG Key ID: 35B21047DEB09A81

View File

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