From 5fc5762340e53d6ea78b94dd6df18461975dba71 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 22 Jul 2023 13:48:18 +0300 Subject: [PATCH] fix emojis inside links with snappy https://rdrama.net/post/189609/redditors-having-a-problem-with-supply/4629794#context --- files/helpers/sanitize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 3571b40e0c..286c4dab43 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -435,7 +435,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis soup = BeautifulSoup(sanitized, 'lxml') for tag in soup.find_all("img"): - if tag.get("src") and not tag["src"].startswith('/pp/'): + if tag.get("src") and not tag["src"].startswith('/pp/') and not tag["src"].startswith('/e/'): if not is_safe_url(tag["src"]): a = soup.new_tag("a", href=tag["src"], rel="nofollow noopener", target="_blank") a.string = tag["src"]