mirror of
https://gitlab.com/news-flash/article_scraper.git
synced 2025-07-10 09:25:29 +02:00
refactor & more testing
This commit is contained in:
parent
7ae98904d4
commit
e3246af28b
14 changed files with 1969 additions and 101 deletions
|
@ -4,6 +4,8 @@ use once_cell::sync::Lazy;
|
|||
use regex::Regex;
|
||||
|
||||
pub const DEFAULT_CHAR_THRESHOLD: usize = 500;
|
||||
pub static IS_IMAGE: Lazy<Regex> =
|
||||
Lazy::new(|| Regex::new(r#"/\.(jpg|jpeg|png|webp)/i"#).expect("IS_IMAGE regex"));
|
||||
pub static SIBLING_CONTENT: Lazy<Regex> =
|
||||
Lazy::new(|| Regex::new(r#"/\.( |$)/"#).expect("SIBLING_CONTENT regex"));
|
||||
pub static BYLINE: Lazy<Regex> = Lazy::new(|| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue