mirror of
https://github.com/nelsbrock/disbahn.git
synced 2026-08-14 22:26:49 +02:00
fix formatting of item descriptions
This commit is contained in:
+5
-5
@@ -32,17 +32,17 @@ fn validity_time_to_timestamp(input: &str) -> anyhow::Result<i64> {
|
||||
}
|
||||
|
||||
fn html_to_discord_markdown(input: &str) -> String {
|
||||
let re_times = regex!(r#"^.*<br/><br/>"#i);
|
||||
let re_times = regex!(r#"^.*<br\s*/>\s*<br\s*/>"#i);
|
||||
let re_bold = regex!(r#"<b\s*>((.|\n)*?)</b\s*>"#i);
|
||||
let re_italic = regex!(r#"<i\s*>((.|\n)*?)</i\s*>"#i);
|
||||
let re_strikethrough = regex!(r#"<s\s*>((.|\n)*?)</s\s*>"#i);
|
||||
let re_newline = regex!(r#"<br\s*/?>"#i);
|
||||
let re_bold = regex!(r#"<b>(.*?)</b>"#i);
|
||||
let re_italic = regex!(r#"<i>(.*?)</i>"#i);
|
||||
let re_strikethrough = regex!(r#"<s>(.*?)</s>"#i);
|
||||
|
||||
let input = re_times.replace(input, "");
|
||||
let input = re_newline.replace_all(&input, "\n");
|
||||
let input = re_bold.replace_all(&input, "**$1**");
|
||||
let input = re_italic.replace_all(&input, "*$1*");
|
||||
let input = re_strikethrough.replace_all(&input, "~~$1~~");
|
||||
let input = re_newline.replace_all(&input, "\n");
|
||||
input.to_string()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user