From 990791e59b403304c90c7064ce9e598933c8ccc0 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 13 Aug 2023 17:22:04 +0300 Subject: [PATCH] do this https://rdrama.net/h/countryclub/post/79285/-/4788305#context --- files/helpers/sanitize.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 8aec49736..04c5cbeb3 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -718,8 +718,13 @@ def filter_emojis_only(title, golden=True, count_emojis=False, graceful=False): if len(title) > POST_TITLE_HTML_LENGTH_LIMIT and not graceful: abort(400) - else: - return title.strip() + + title = title.strip() + soup = BeautifulSoup(title, 'lxml') + text = soup.html.body.text.strip() + if not text: title = f'--- {title} ---' + + return title def is_whitelisted(domain, k): if domain.endswith('pullpush.io'):