From d49d32fbc6536e5ce2818e54fe8258886ef5cd98 Mon Sep 17 00:00:00 2001 From: ayaka Date: Thu, 4 Apr 2024 22:59:20 +1300 Subject: [PATCH] embed images --- src/utils.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.rs b/src/utils.rs index aa992d6..153ba86 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -883,7 +883,8 @@ pub fn rewrite_urls(input_text: &str) -> String { let text1 = // Rewrite Reddit links to Redlib REDDIT_REGEX.replace_all(input_text, r#"href="/"#) - .to_string(); + .to_string()F + .replace("a href=\"https://preview.redd.it", "img src=\"https://preview.redd.it"); let text1 = REDDIT_EMOJI_REGEX .replace_all(&text1, format_url(REDDIT_EMOJI_REGEX.find(&text1).map(|x| x.as_str()).unwrap_or_default())) .to_string()