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:
parent
69b7b1fdc2
commit
c5c6b788c8
7 changed files with 7091 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue