This commit is contained in:
Aevann1 2022-03-02 02:05:30 +02:00
parent 1623407e7e
commit bd356bc87f
54 changed files with 301 additions and 459 deletions

View file

@ -188,6 +188,12 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
tag["target"] = "_blank"
tag["rel"] = "nofollow noopener noreferrer"
if fishylinks_regex.fullmatch(str(tag.string)):
try: tag.string = tag["href"]
except: tag.string = ""
sanitized = str(soup)
sanitized = spoiler_regex.sub(r'<span class="spoiler">\1</span>', sanitized)