From bbdd279772a12e3e52926e69ae05aac0cf94e123 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 10 Oct 2023 21:59:48 +0300 Subject: [PATCH] disallow bounce cide repititive nesting --- files/assets/css/main.css | 4 ++++ files/helpers/sanitize.py | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 7bc192d5c..c27e8a712 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -5508,6 +5508,10 @@ span > img[src$="/i/love-background.webp"] { animation-timing-function: linear; } +[cide] [cide], [bounce] [bounce] { + animation: none; +} + /* Fix for
    being populated with
  1. in many contexts. */ .post-body li > p:first-child, .comment-text li > p:first-child, diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 1f0a7c2b7..5d82bdc8f 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -456,9 +456,6 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis soup = BeautifulSoup(sanitized, 'lxml') - if len(soup.select('[bounce], [cide]')) > 5: - error("Max 5 usages of 'bounce' and 'cide'!") - for tag in soup.find_all("img"): if tag.get("src") and not tag["src"].startswith('/pp/') and not (snappy and tag["src"].startswith(f'{SITE_FULL_IMAGES}/e/')): if not is_safe_url(tag["src"]):