forked from MarseyWorld/MarseyWorld
Revert "delete empty <a> tags to prevent exploits"
This reverts commit 5f78b4e365
.
This commit is breaking @-mentions in a great many contexts and
I'm not quite sure how to fix it right now.
master
parent
36d24cf213
commit
26273d0997
|
@ -227,9 +227,7 @@ def sanitize(sanitized, alert=False, edit=False):
|
||||||
tag['referrerpolicy'] = "no-referrer"
|
tag['referrerpolicy'] = "no-referrer"
|
||||||
|
|
||||||
for tag in soup.find_all("a"):
|
for tag in soup.find_all("a"):
|
||||||
if not tag.string or not tag.get("href"):
|
if tag.get("href") and fishylinks_regex.fullmatch(str(tag.string)):
|
||||||
tag.decompose()
|
|
||||||
elif fishylinks_regex.fullmatch(str(tag.string)):
|
|
||||||
tag.string = tag["href"]
|
tag.string = tag["href"]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue