mirror of
https://gitlab.com/news-flash/article_scraper.git
synced 2025-07-08 08:30:00 +02:00
fix has_single_tag_inside_element & update tests
This commit is contained in:
parent
31a8033844
commit
aea57d0cf3
10 changed files with 86 additions and 39 deletions
|
@ -900,18 +900,10 @@ impl FullTextParser {
|
|||
let mut node_iter = Some(root.clone());
|
||||
|
||||
while let Some(mut node) = node_iter {
|
||||
let classes = node.get_class_names();
|
||||
if classes.contains("page") {
|
||||
node.set_attribute("class", "page").map_err(|e| {
|
||||
log::error!("{e}");
|
||||
FullTextParserError::Xml
|
||||
})?;
|
||||
} else {
|
||||
node.remove_attribute("class").map_err(|e| {
|
||||
log::error!("{e}");
|
||||
FullTextParserError::Xml
|
||||
})?;
|
||||
}
|
||||
node.remove_attribute("class").map_err(|e| {
|
||||
log::error!("{e}");
|
||||
FullTextParserError::Xml
|
||||
})?;
|
||||
|
||||
node.remove_attribute(constants::SCORE_ATTR).map_err(|e| {
|
||||
log::error!("{e}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue