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

fmt & clippy

This commit is contained in:
Jan Lukas Gernert 2023-03-19 23:37:42 +01:00
parent 280c516cbe
commit f7fa696921
2 changed files with 4 additions and 8 deletions

View file

@ -73,8 +73,6 @@ pub const UNLIKELY_ROLES: &[&str] = &[
pub const DEFAULT_TAGS_TO_SCORE: &[&str] =
&["SECTION", "H2", "H3", "H4", "H5", "H6", "P", "TD", "PRE"];
pub const DEPRECATED_SIZE_ATTRIBUTE_ELEMS: Lazy<HashSet<&str>> =
Lazy::new(|| HashSet::from(["TABLE", "TH", "TD", "HR", "PRE"]));
pub const PRESENTATIONAL_ATTRIBUTES: &[&str] = &[
"align",
"background",
@ -89,6 +87,8 @@ pub const PRESENTATIONAL_ATTRIBUTES: &[&str] = &[
"valign",
"vspace",
];
pub static DEPRECATED_SIZE_ATTRIBUTE_ELEMS: Lazy<HashSet<&str>> =
Lazy::new(|| HashSet::from(["TABLE", "TH", "TD", "HR", "PRE"]));
pub static DIV_TO_P_ELEMS: Lazy<HashSet<&str>> = Lazy::new(|| {
HashSet::from([
"BLOCKQUOTE",

View file

@ -855,9 +855,7 @@ impl FullTextParser {
Ok(())
}
pub(crate) fn post_process_document(
document: &Document
) -> Result<(), FullTextParserError> {
pub(crate) fn post_process_document(document: &Document) -> Result<(), FullTextParserError> {
if let Some(mut root) = document.get_root_element() {
Self::simplify_nested_elements(&mut root)?;
@ -869,9 +867,7 @@ impl FullTextParser {
Ok(())
}
pub(crate) fn post_process_page(
node: &mut Node,
) -> Result<(), FullTextParserError> {
pub(crate) fn post_process_page(node: &mut Node) -> Result<(), FullTextParserError> {
Util::clean_conditionally(node, "fieldset");
Util::clean_conditionally(node, "table");
Util::clean_conditionally(node, "ul");