From 666b57dffcfdfd9e12447b8bbfd4f707ab3edf28 Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 20 Mar 2026 02:46:54 +0200 Subject: [PATCH] use main image instead of thumb --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 104e483..39c6130 100644 --- a/src/main.rs +++ b/src/main.rs @@ -266,22 +266,22 @@ fn pre_format(data: &str, uploads: &mut HashSet) -> String { .unwrap() .replace_all( &Regex::new(r"[^<]+").unwrap().replace_all( - &Regex::new(r"(?s)]+)>\[[^\]]+\]") + &Regex::new(r"(?s)]+>([^<]+)") .unwrap() .replace_all(data, |c: &Captures| { uploads.insert( - Regex::new(r#"url="([^"]+)""#) + Regex::new(r#"url="?([^\s]+)"?"#) .unwrap() .captures(&c[1]) .unwrap()[1] .trim_start_matches("/") - .replace("d/", "") + .trim_start_matches("d/") .into(), ); format!( "", - c[1].replace(" url=\"/", " src=\"") - .replace(" url=\"d/", " src=\"") + c[1].replace(" url=d/", " url=") + .replace(" url=/", " url=") .replace(" url=", " src=") ) }),