1
0
Fork 0
mirror of https://gitlab.com/news-flash/article_scraper.git synced 2025-07-07 16:15:32 +02:00

even if img has src

This commit is contained in:
Jan Lukas Gernert 2023-07-22 20:03:32 +02:00
parent 42eb9daf65
commit 345518253a

View file

@ -583,9 +583,6 @@ impl FullTextParser {
continue; continue;
} }
_ = node.remove_attribute("decoding");
_ = node.remove_attribute("loading");
for (name, val) in node.get_attributes() { for (name, val) in node.get_attributes() {
if name == "src" || name == "srcset" || name == "alt" { if name == "src" || name == "srcset" || name == "alt" {
continue; continue;
@ -848,6 +845,8 @@ impl FullTextParser {
_ = Self::fix_lazy_images(context, document); _ = Self::fix_lazy_images(context, document);
_ = Self::fix_iframe_size(context, "youtube.com"); _ = Self::fix_iframe_size(context, "youtube.com");
_ = Self::remove_attribute(context, Some("a"), "onclick"); _ = Self::remove_attribute(context, Some("a"), "onclick");
_ = Self::remove_attribute(context, Some("img"), "decoding");
_ = Self::remove_attribute(context, Some("img"), "loading");
// strip elements using Readability.com and Instapaper.com ignore class names // strip elements using Readability.com and Instapaper.com ignore class names
// .entry-unrelated and .instapaper_ignore // .entry-unrelated and .instapaper_ignore