mirror of
https://gitlab.com/news-flash/article_scraper.git
synced 2025-07-07 16:15:32 +02:00
fmt
This commit is contained in:
parent
e2b804d00a
commit
2528aa3e18
1 changed files with 7 additions and 5 deletions
|
@ -131,10 +131,12 @@ impl Readability {
|
||||||
} else if !Util::is_whitespace(&child) {
|
} else if !Util::is_whitespace(&child) {
|
||||||
let mut new_node = Node::new("p", None, &document)
|
let mut new_node = Node::new("p", None, &document)
|
||||||
.map_err(|()| FullTextParserError::Readability)?;
|
.map_err(|()| FullTextParserError::Readability)?;
|
||||||
let mut old_node = node_ref.replace_child_node(new_node.clone(), child).map_err(|error| {
|
let mut old_node = node_ref
|
||||||
log::error!("{error}");
|
.replace_child_node(new_node.clone(), child)
|
||||||
FullTextParserError::Readability
|
.map_err(|error| {
|
||||||
})?;
|
log::error!("{error}");
|
||||||
|
FullTextParserError::Readability
|
||||||
|
})?;
|
||||||
|
|
||||||
new_node.add_child(&mut old_node).map_err(|error| {
|
new_node.add_child(&mut old_node).map_err(|error| {
|
||||||
log::error!("{error}");
|
log::error!("{error}");
|
||||||
|
@ -345,7 +347,7 @@ impl Readability {
|
||||||
// non_significant_whitespace: false,
|
// non_significant_whitespace: false,
|
||||||
// });
|
// });
|
||||||
// std::fs::write("doc.html", &html).unwrap();
|
// std::fs::write("doc.html", &html).unwrap();
|
||||||
|
|
||||||
// The scores shouldn't get too low.
|
// The scores shouldn't get too low.
|
||||||
let score_threshold = last_score / 3.0;
|
let score_threshold = last_score / 3.0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue