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

add citilab test & fix noscript unwrapping

This commit is contained in:
Jan Lukas Gernert 2023-03-09 20:10:03 +01:00
parent 69b7b1fdc2
commit c5c6b788c8
7 changed files with 7091 additions and 6 deletions

View file

@ -494,9 +494,9 @@ impl Util {
pub fn is_single_image(node: &Node) -> bool {
if node.get_name().to_uppercase() == "IMG" {
true
} else if node.get_child_nodes().len() != 1 || node.get_content().trim() != "" {
} else if node.get_child_elements().len() != 1 || node.get_content().trim() != "" {
false
} else if let Some(first_child) = node.get_child_nodes().first() {
} else if let Some(first_child) = node.get_child_elements().first() {
Self::is_single_image(first_child)
} else {
false