diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 9469908bd1..4c8f30147b 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -215,9 +215,9 @@ def sanitize(sanitized, edit=False): tag['alt'] = f'![]({tag["data-src"]})' tag['referrerpolicy'] = "no-referrer" - a = soup.new_tag("a", href=tag["data-src"], rel="nofollow noopener noreferrer") - tag = tag.replace_with(a) - a.append(tag) + a = soup.new_tag("a", href=tag["data-src"], rel="nofollow noopener noreferrer") + tag = tag.replace_with(a) + a.append(tag) for tag in soup.find_all("a"): if tag.get("href") and fishylinks_regex.fullmatch(str(tag.string)):