fix regex (i have no clue why this works)

This commit is contained in:
ultrablob 2025-04-22 17:16:56 -04:00
parent 5e95c5f8ff
commit aac1423638

View file

@ -28,9 +28,9 @@ fn main() {
.trim() .trim()
.to_string(); .to_string();
let announcements = Regex::new(r"\n+") let pretty_announcements = Regex::new("\\n+")
.unwrap() .unwrap()
.replace_all(&announcements, "\n") .replace_all(&announcements, "")
.to_string(); .to_string();
let description = &format_description!("[weekday] [month repr:long] [day] [year]"); let description = &format_description!("[weekday] [month repr:long] [day] [year]");
@ -42,8 +42,10 @@ fn main() {
return; return;
} }
// println!("{}", pretty_announcements);
Webhook::new(webhook) Webhook::new(webhook)
.content(&format!("## {}:\n{}", date, announcements)) .content(&format!("## {}:\n{}", date, pretty_announcements))
.send() .send()
.unwrap(); .unwrap();
} }