From 23d77a165a687e01a2ff879cfce55a564205a840 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 15 Feb 2024 21:12:29 +0200 Subject: [PATCH] add tabs --- files/helpers/bleach_body.py | 10 ++++++++-- files/helpers/sanitize.py | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/files/helpers/bleach_body.py b/files/helpers/bleach_body.py index 48880ebc2..11d315b1a 100644 --- a/files/helpers/bleach_body.py +++ b/files/helpers/bleach_body.py @@ -85,8 +85,14 @@ def bleach_body_html(body_html, runtime=False): attributes=allowed_attributes, protocols=['http', 'https'], css_sanitizer=css_sanitizer, - filters=[partial(LinkifyFilter, skip_tags=["pre"], - parse_email=False, url_re=sanitize_url_regex)] + filters=[ + partial( + LinkifyFilter, + skip_tags=["pre"], + parse_email=False, + url_re=sanitize_url_regex + ) + ] ).clean(body_html) return body_html diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 4bed1631f..1ae66d5cd 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -652,7 +652,12 @@ def filter_emojis_only(title, golden=True, count_emojis=False, obj=None, author= title = strikethrough_regex.sub(r'\1\2', title) - title = bleach.clean(title, tags=['img','del','span'], attributes=allowed_attributes_emojis, protocols=['http','https']).replace('\n','') + title = bleach.clean( + title, + tags=['img','del','span'], + attributes=allowed_attributes_emojis, + protocols=['http','https'] + ).replace('\n','') if len(title) > POST_TITLE_HTML_LENGTH_LIMIT: abort(400, "Rendered title is too long!")