diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 1194a84e9..a76fa2afc 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -27,7 +27,7 @@ def favorite_emojis(x): str = "" emojis = sorted(x.items(), key=lambda x: x[1], reverse=True)[:25] for k, v in emojis: - str += f'' + str += f'' return str @app.context_processor diff --git a/files/helpers/markdown.py b/files/helpers/markdown.py index 86071b0a7..2ac20aef1 100644 --- a/files/helpers/markdown.py +++ b/files/helpers/markdown.py @@ -82,7 +82,7 @@ class CustomRenderer(HTMLRenderer): if not user: return f"{space}@{target}" - return f'{space}@{user.username}' + return f'{space}@{user.username}' def render_sub_mention(self, token): space = token.target[0] @@ -123,7 +123,7 @@ class Renderer(HTMLRenderer): if not user: return f"{space}@{target}" - return f'{space}@{user.username}' + return f'{space}@{user.username}' def render_sub_mention(self, token): space = token.target[0] diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index b9f895aae..8ec76f051 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -77,7 +77,7 @@ no_images = ['b', ] _allowed_attributes = { - '*': ['href', 'style', 'src', 'class', 'title', 'rel', 'data-original-name'] + '*': ['href', 'style', 'src', 'class', 'title', 'rel', 'data-bs-original-name'] } _allowed_protocols = [ @@ -173,8 +173,8 @@ def sanitize(sanitized, noimages=False): link["target"] = "_blank" link["onclick"] = f"expandDesktopImage('{tag['src']}');" - link["data-toggle"] = "modal" - link["data-target"] = "#expandImageModal" + link["data-bs-toggle"] = "modal" + link["data-bs-target"] = "#expandImageModal" tag.wrap(link) @@ -220,7 +220,7 @@ def sanitize(sanitized, noimages=False): for i in re.finditer('

:([^ ]{1,30}?):

', sanitized): emoji = i.group(1).lower() if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - sanitized = sanitized.replace(f'

:{emoji}:

', f'

:{emoji}:

') + sanitized = sanitized.replace(f'

:{emoji}:

', f'

:{emoji}:

') try: if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 @@ -231,7 +231,7 @@ def sanitize(sanitized, noimages=False): for i in re.finditer('\w*(?', sanitized) + sanitized = re.sub(f'\w*(?', sanitized) try: if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 diff --git a/files/routes/posts.py b/files/routes/posts.py index 0a90a7207..c6657e8ec 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -412,7 +412,7 @@ def filter_title(title): for i in re.finditer(':(.{1,30}?):', title): if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'): - title = title.replace(f':{i.group(1)}:', f'') + title = title.replace(f':{i.group(1)}:', f'') return title diff --git a/files/routes/reporting.py b/files/routes/reporting.py index 305243dde..6e30c0c15 100644 --- a/files/routes/reporting.py +++ b/files/routes/reporting.py @@ -19,7 +19,7 @@ def api_flag_post(pid, v): for i in re.finditer(':(.{1,30}?):', reason): if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'): - reason = reason.replace(f':{i.group(1)}:', f'') + reason = reason.replace(f':{i.group(1)}:', f'') flag = Flag(post_id=post.id, user_id=v.id, @@ -50,7 +50,7 @@ def api_flag_comment(cid, v): for i in re.finditer(':(.{1,30}?):', reason): if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'): - reason = reason.replace(f':{i.group(1)}:', f'') + reason = reason.replace(f':{i.group(1)}:', f'') flag = CommentFlag(comment_id=comment.id, user_id=v.id, diff --git a/files/templates/admin/app.html b/files/templates/admin/app.html index 6c6e9dd10..7ce817d3b 100644 --- a/files/templates/admin/app.html +++ b/files/templates/admin/app.html @@ -57,12 +57,12 @@ - diff --git a/files/templates/award_modal.html b/files/templates/award_modal.html index 2d0f860a7..025c02f08 100644 --- a/files/templates/award_modal.html +++ b/files/templates/award_modal.html @@ -183,7 +183,7 @@ diff --git a/files/templates/changelog.html b/files/templates/changelog.html index 017e338e3..cbc079a2f 100644 --- a/files/templates/changelog.html +++ b/files/templates/changelog.html @@ -14,7 +14,7 @@
diff --git a/files/templates/comments.html b/files/templates/comments.html index 1c0c35842..40c127c7a 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -598,34 +598,34 @@
- {% if last_view_utc and c.created_utc > last_view_utc and not (v and v.id==c.author_id) and (not v or v.highlightcomments) %}{% endif %} + {% if last_view_utc and c.created_utc > last_view_utc and not (v and v.id==c.author_id) and (not v or v.highlightcomments) %}{% endif %} {% if c.awards %} {% for a in c.awards %} - + {% endfor %} {% endif %} {% if c.bannedfor and c.author.banned_by %} - + {% endif %} {% if c.active_flags %}{{c.active_flags}} Reports{% endif %} {% if c.over_18 %}+18{% endif %} - {% if v and v.admin_level==6 and c.author.shadowbanned %}{% endif %} - {% if c.is_pinned %}{% endif %} - {% if c.distinguish_level %}{% endif %} - {% if c.is_op %}{% endif %} - {% if c.is_bot %}{% endif %} - {% if c.is_blocking %}{% endif %} - {% if c.is_blocked %}{% endif %} + {% if v and v.admin_level==6 and c.author.shadowbanned %}{% endif %} + {% if c.is_pinned %}{% endif %} + {% if c.distinguish_level %}{% endif %} + {% if c.is_op %}{% endif %} + {% if c.is_bot %}{% endif %} + {% if c.is_blocking %}{% endif %} + {% if c.is_blocked %}{% endif %} - {% if c.author.verified %} + {% if c.author.verified %} {% endif %} {{c.author.username}}{% if c.author.customtitle %}  {% if c.author.quadrant %}{% endif %}{{c.author.customtitle | safe}}{% endif %} -  {{c.age_string}} +  {{c.age_string}} {% if c.edited_utc %} · Edited {{c.edited_string}} {% endif %} @@ -663,11 +663,11 @@
    Cancel @@ -689,9 +689,9 @@
- +   - +  
diff --git a/files/templates/search.html b/files/templates/search.html index 9b86b7416..9bd6caf87 100644 --- a/files/templates/search.html +++ b/files/templates/search.html @@ -13,7 +13,7 @@ {% if not '/users/' in request.path %}
@@ -139,7 +139,7 @@ {{msg}} -
@@ -236,7 +236,7 @@ @@ -288,7 +288,7 @@
@@ -302,13 +302,13 @@ {% block clipboard %} -