From a89d2ac5d58b92aa82f021fba81c2513925d52ef Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 6 Aug 2023 00:23:18 +0300 Subject: [PATCH] fix this https://rdrama.net/h/chudrama/post/194293/-/4736559#context --- files/helpers/sanitize.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index c7b7a862f9..25be8249b4 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -554,7 +554,10 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis href = link.get("href") if not href: continue - href = normalize_url(href) + link["href"] = normalize_url(href) + if link.string == href: + link.string = link["href"] + href = link["href"] def unlinkfy(): link.string = href @@ -665,7 +668,7 @@ def filter_emojis_only(title, golden=True, count_emojis=False, graceful=False): def is_whitelisted(domain, k): if 'sort' in k.lower() or 'query' in k.lower(): return True - if k in {'v','context','q','page','time_continue','title','scrollToComments','u','url','story_fbid','fbid','forum_id','vid','oldid','postid','post_id','threadid','thread_id','ticket_form_id'}: + if k in {'v','context','q','page','time_continue','title','scrollToComments','u','url','story_fbid','fbid','forum_id','vid','oldid','postid','post_id','threadid','thread_id','ticket_form_id','_x_tr_sl','_x_tr_tl','_x_tr_hl','_x_tr_pto'}: return True if k == 't' and domain != 'twitter.com': return True