mirror of
https://github.com/spikecodes/libreddit.git
synced 2026-01-15 09:12:33 +01:00
Fix #96
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user