This commit is contained in:
spikecodes 2021-02-03 21:42:43 -08:00
parent e23eaf0be0
commit 90d3063f93
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB

View file

@ -173,7 +173,7 @@ pub fn format_url(url: &str) -> String {
// Rewrite Reddit links to Libreddit in body of text
pub fn rewrite_url(text: &str) -> String {
let re = Regex::new(r#"href="(https://|http://|)(www.|)(reddit).(com)/"#).unwrap();
let re = Regex::new(r#"href="(https://|http://|)(www.|old.|np.|)(reddit).(com)/"#).unwrap();
re.replace_all(text, r#"href="/"#).to_string()
}