Add more logic to remove extra newlines (my rust sucks ik)

This commit is contained in:
ultrablob 2025-04-22 16:51:49 -04:00
parent 6cc62a000c
commit 5e95c5f8ff

View file

@ -26,7 +26,12 @@ fn main() {
.unwrap() .unwrap()
.as_str() .as_str()
.trim() .trim()
.replace("\n\n", "\n"); .to_string();
let announcements = Regex::new(r"\n+")
.unwrap()
.replace_all(&announcements, "\n")
.to_string();
let description = &format_description!("[weekday] [month repr:long] [day] [year]"); let description = &format_description!("[weekday] [month repr:long] [day] [year]");
let parsed_date = Date::parse(&format!("{} 2025", date), description).unwrap(); let parsed_date = Date::parse(&format!("{} 2025", date), description).unwrap();