We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e327f1 commit 5ad661cCopy full SHA for 5ad661c
1 file changed
src/utils.rs
@@ -1093,15 +1093,7 @@ pub fn rewrite_urls(input_text: &str) -> String {
1093
// Rewrite Reddit links to Redlib
1094
REDDIT_REGEX.replace_all(input_text, r#"href="/"#).to_string();
1095
1096
- loop {
1097
- if REDDIT_EMOJI_REGEX.find(&text1).is_none() {
1098
- break;
1099
- } else {
1100
- text1 = REDDIT_EMOJI_REGEX
1101
- .replace_all(&text1, format_url(REDDIT_EMOJI_REGEX.find(&text1).map(|x| x.as_str()).unwrap_or_default()))
1102
- .to_string()
1103
- }
1104
+ text1 = REDDIT_EMOJI_REGEX.replace_all(&text1, |caps: ®ex::Captures| format_url(&caps[0])).to_string();
1105
1106
// Remove (html-encoded) "\" from URLs.
1107
text1 = text1.replace("%5C", "").replace("\\_", "_");
0 commit comments