From fb4f02a80b9b9e1a127cf99d9f719c26bcc09c10 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 13 May 2023 06:55:07 +0300 Subject: [PATCH] fix links linkfied by linkfyfilter getting undone by my code --- files/helpers/sanitize.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 467fca941..c8a058443 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -532,8 +532,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_emojis= #don't allow something like this [https://rԁrama.net/leaderboard](https://iplogger.org/1fRKk7) if not snappy and tldextract.extract(str(link.string)).registered_domain: - unlinkfy() - continue + link.string = href #insert target="_blank" and ref="nofollower noopener" for external link if not href.startswith('/') and not href.startswith(f'{SITE_FULL}/'):