diff --git a/src/formatters.nim b/src/formatters.nim index 75ff17e..4f9e52e 100644 --- a/src/formatters.nim +++ b/src/formatters.nim @@ -21,7 +21,7 @@ let # Images aren't supported due to errors from Teddit when the image # wasn't first displayed via a post on the Teddit instance. - imgurRegex = re"((i|i.stack)\.)?imgur.(com|io)" + imgurRegex = re"((i|i.stack)\.)?imgur\.(com|io)" wwwRegex = re"https?://(www[0-9]?\.)?" m3u8Regex = re"""url="(.+.m3u8)"""" @@ -71,7 +71,7 @@ proc replaceUrls*(body: string; prefs: Prefs; absolute=""): string = if prefs.replaceReddit in result and "/gallery/" in result: result = result.replace("/gallery/", "/comments/") - if prefs.replaceImgur.len > 0 and "imgur.com" in result: + if prefs.replaceImgur.len > 0 and "imgur" in result: result = result.replace(imgurRegex, prefs.replaceImgur) if absolute.len > 0 and "href" in result: