mirror of
https://github.com/mii443/ncb-tts-r2.git
synced 2025-08-22 16:15:29 +00:00
fix code block regex
This commit is contained in:
@ -2,7 +2,7 @@ use regex::Regex;
|
||||
|
||||
pub fn remove_url(text: String) -> String {
|
||||
let url_regex = Regex::new(r"(http://|https://){1}[\w\.\-/:\#\?=\&;%\~\+]+").unwrap();
|
||||
let code_regex = Regex::new(r"```(.*)\n(.*)\n```").unwrap();
|
||||
let code_regex = Regex::new(r"```([.\n]*)```").unwrap();
|
||||
let text = url_regex.replace_all(&text, " URL ").to_string();
|
||||
code_regex.replace_all(&text, "code").to_string()
|
||||
}
|
||||
|
Reference in New Issue
Block a user