Merge pull request #36 from Y2Z/no-images-no-icons
Ignore icons if told to avoid images
This commit is contained in:
commit
080ed50264
@ -137,6 +137,10 @@ pub fn walk_and_embed_assets(
|
|||||||
NodeMatch::Icon => {
|
NodeMatch::Icon => {
|
||||||
for attr in attrs_mut.iter_mut() {
|
for attr in attrs_mut.iter_mut() {
|
||||||
if &attr.name.local == "href" {
|
if &attr.name.local == "href" {
|
||||||
|
if opt_no_images {
|
||||||
|
attr.value.clear();
|
||||||
|
attr.value.push_slice(TRANSPARENT_PIXEL);
|
||||||
|
} else {
|
||||||
let href_full_url = resolve_url(&url, &attr.value.to_string());
|
let href_full_url = resolve_url(&url, &attr.value.to_string());
|
||||||
let favicon_datauri = retrieve_asset(
|
let favicon_datauri = retrieve_asset(
|
||||||
&href_full_url.unwrap(),
|
&href_full_url.unwrap(),
|
||||||
@ -149,6 +153,7 @@ pub fn walk_and_embed_assets(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
NodeMatch::Image => {
|
NodeMatch::Image => {
|
||||||
for attr in attrs_mut.iter_mut() {
|
for attr in attrs_mut.iter_mut() {
|
||||||
if &attr.name.local == "src" {
|
if &attr.name.local == "src" {
|
||||||
|
Loading…
Reference in New Issue
Block a user