diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 64bad0f2a..b3b1519c6 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -209,7 +209,7 @@ def sanitize(sanitized, edit=False): sanitized = sanitized.replace('‎','').replace('​','').replace("\ufeff", "").replace("𒐪","") - sanitized = reddit_regex.sub(r'\1/\2', sanitized) + sanitized = reddit_regex.sub(r'\1/\2', sanitized) sanitized = sub_regex.sub(r'\1/\2', sanitized) matches = [ m for m in mention_regex.finditer(sanitized) if m ] @@ -240,6 +240,7 @@ def sanitize(sanitized, edit=False): a = soup.new_tag("a", href=tag["data-src"]) if not is_site_url(a["href"]): a["rel"] = "nofollow noopener noreferrer" + a["target"] = "_blank" tag = tag.replace_with(a) a.append(tag)