From 51273e61ff9daaa1f1a81659c9e4c5e886119fa2 Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 20 Mar 2026 04:50:18 +0200 Subject: [PATCH] match fmt len --- src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index f30151c..d666bc4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -260,15 +260,15 @@ fn main() -> Result<()> { } fn pre_format(data: &str, uploads: &mut HashSet) -> String { + const R: &str = r#"(?s)]*>[^<]*"#; html_escape::decode_html_entities(&strip_tags::strip_tags( - &Regex::new(r#"(?s)]*>[^<]*"#) - .unwrap() - .replace_all(data, |c: &Captures| { - let rel = c[2] - .trim_start_matches("/") - .trim_start_matches("d/"); + &Regex::new(R).unwrap().replace_all(data, |c: &Captures| { + let rel = c[2].trim_start_matches("/").trim_start_matches("d/"); uploads.insert(rel.into()); - format!("![{}]({rel})", c.get(1).map(|s|s.as_str()).unwrap_or_default()) + format!( + "![{}]({rel})", + c.get(1).map(|s| s.as_str()).unwrap_or_default() + ) }), )) .into()