diff --git a/files/helpers/markdown.py b/files/helpers/markdown.py index 2eb51b469..8930ac8f4 100644 --- a/files/helpers/markdown.py +++ b/files/helpers/markdown.py @@ -87,7 +87,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] diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 918a06bf7..f97463828 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -165,6 +165,7 @@ def sanitize(sanitized, noimages=False): tag["rel"] = "nofollow noopener noreferrer" tag["style"] = "max-height: 100px; max-width: 100%;" tag["class"] = "in-comment-image rounded-sm my-2" + tag["loading"] = "lazy" link = soup.new_tag("a") link["href"] = tag["src"] @@ -212,11 +213,11 @@ def sanitize(sanitized, noimages=False): for i in re.finditer('

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

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

:{i.group(1)}:

', f'

') + sanitized = sanitized.replace(f'

:{i.group(1)}:

', f'

') for i in re.finditer(':([^ ]{1,30}?):', sanitized): if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.gif'): - sanitized = sanitized.replace(f':{i.group(1)}:', f'') + sanitized = sanitized.replace(f':{i.group(1)}:', f'') sanitized = sanitized.replace("https://www.", "https://").replace("https://youtu.be/", "https://youtube.com/watch?v=").replace("https://music.youtube.com/watch?v=", "https://youtube.com/watch?v=").replace("https://open.spotify.com/", "https://open.spotify.com/embed/").replace("https://streamable.com/", "https://streamable.com/e/").replace("https://youtube.com/shorts/", "https://youtube.com/watch?v=").replace("https://mobile.", "https://").replace("https://m.", "https://") diff --git a/files/routes/feeds.py b/files/routes/feeds.py index 18f0cbdbc..2d0b36d81 100644 --- a/files/routes/feeds.py +++ b/files/routes/feeds.py @@ -64,6 +64,6 @@ def feeds_user(sort='hot', t='all'): if len(post.body_html) > 0: with tag("content", type="html"): - text(html.escape(f"
{post.body_html}")) + text(html.escape(f"
{post.body_html}")) return Response( ""+ doc.getvalue(), mimetype="application/xml") \ No newline at end of file diff --git a/files/routes/flagging.py b/files/routes/flagging.py index e71026cf7..be686080d 100644 --- a/files/routes/flagging.py +++ b/files/routes/flagging.py @@ -21,7 +21,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)}.gif'): - 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)}.gif'): - 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/routes/posts.py b/files/routes/posts.py index 0539b2de8..438273784 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -540,7 +540,7 @@ def filter_title(title): for i in re.finditer(':(.{1,30}?):', title): if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.gif'): - title = title.replace(f':{i.group(1)}:', f'') + title = title.replace(f':{i.group(1)}:', f'') return title diff --git a/files/templates/2fa_modal.html b/files/templates/2fa_modal.html index 669eac2a4..3b9afaccc 100644 --- a/files/templates/2fa_modal.html +++ b/files/templates/2fa_modal.html @@ -19,7 +19,7 @@ Step 1: Scan this barcode (or enter the code) using a two-factor authentication app such as Google Authenticator or Authy.

- +

 							
Or enter this code: {{mfa_secret}}
diff --git a/files/templates/admin/badge_grant.html b/files/templates/admin/badge_grant.html index fca3c53be..e8c0b712a 100644 --- a/files/templates/admin/badge_grant.html +++ b/files/templates/admin/badge_grant.html @@ -55,7 +55,7 @@ {% for badge in badge_types %} - + {{badge.name}} {{badge.description}} diff --git a/files/templates/admin/new_users.html b/files/templates/admin/new_users.html index 10942590e..f20a160cd 100644 --- a/files/templates/admin/new_users.html +++ b/files/templates/admin/new_users.html @@ -1,8 +1,8 @@ {% extends "mine.html" %} {% block maincontent %} - - + + {% include "user_listing.html" %} {% endblock %} diff --git a/files/templates/admins.html b/files/templates/admins.html index 0c3959dc9..ac4ddd026 100644 --- a/files/templates/admins.html +++ b/files/templates/admins.html @@ -15,7 +15,7 @@ {% for user in admins %} - {{user.username}} + {{user.username}} {{user.coins}} {% endfor %} diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 00bea30f3..a013cf446 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -102,7 +102,7 @@
- + diff --git a/files/templates/award_leaderboard.html b/files/templates/award_leaderboard.html index 94dd95d33..3846340a4 100644 --- a/files/templates/award_leaderboard.html +++ b/files/templates/award_leaderboard.html @@ -17,7 +17,7 @@ {% for user in users %} {{users.index(user)+1}} - {{user.username}} + {{user.username}} {{user.received_awards_num}} {% endfor %} diff --git a/files/templates/badges.html b/files/templates/badges.html index 2db8919dc..74986057b 100644 --- a/files/templates/badges.html +++ b/files/templates/badges.html @@ -22,7 +22,7 @@ {% for badge in badges if badge.kind==1 %} {{badge.name}} - + {{badge.description}} {% endfor %} @@ -43,7 +43,7 @@ {% for badge in badges if badge.kind==3 %} {{badge.name}} - + {{badge.description}} {% endfor %} @@ -63,7 +63,7 @@ {% for badge in badges if badge.kind==4 %} {{badge.name}} - + {{badge.description}} {% endfor %} diff --git a/files/templates/banned.html b/files/templates/banned.html index 56d843946..ae89a6608 100644 --- a/files/templates/banned.html +++ b/files/templates/banned.html @@ -13,9 +13,9 @@ {% for user in users %} {{users.index(user)+1}} - {{user.username}} + {{user.username}} {% if user.ban_reason %}{{user.ban_reason}}{% endif %} - {{user.banned_by.username}} + {{user.banned_by.username}} {% endfor %} diff --git a/files/templates/comments.html b/files/templates/comments.html index c3e2e72f0..e59db813d 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -138,7 +138,7 @@ {% if c.author.verified %} {% endif %} - {{c.author.username}}{% if c.author.customtitle %}  {% if c.author.quadrant %}{% endif %}{{c.author.customtitle | safe}}{% endif %} + {{c.author.username}}{% if c.author.customtitle %}  {% if c.author.quadrant %}{% endif %}{{c.author.customtitle | safe}}{% endif %}  {{c.age_string}} {% if c.edited_utc %} diff --git a/files/templates/default.html b/files/templates/default.html index 34b73c8dc..4cf240bea 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -1066,7 +1066,7 @@ - + {% include "header.html" %} diff --git a/files/templates/errors/400.html b/files/templates/errors/400.html index 890d69a00..0acd4aa96 100644 --- a/files/templates/errors/400.html +++ b/files/templates/errors/400.html @@ -10,7 +10,7 @@
- +

 			

400 Bad Request

That request was bad and you should feel bad.

diff --git a/files/templates/errors/401.html b/files/templates/errors/401.html index 759415f61..90a9fe832 100644 --- a/files/templates/errors/401.html +++ b/files/templates/errors/401.html @@ -11,7 +11,7 @@
- +

 
 			

401 Not Authorized

diff --git a/files/templates/errors/403.html b/files/templates/errors/403.html index f42af4da4..6b49978d2 100644 --- a/files/templates/errors/403.html +++ b/files/templates/errors/403.html @@ -10,7 +10,7 @@
- +

 		

403 Forbidden

YOU AREN'T WELCOME HERE GO AWAY

diff --git a/files/templates/errors/404.html b/files/templates/errors/404.html index be7d8247b..52c0d8320 100644 --- a/files/templates/errors/404.html +++ b/files/templates/errors/404.html @@ -10,7 +10,7 @@
- +

 		

404 Page Not Found

Someone typed something wrong and it was probably you, please do better.

diff --git a/files/templates/errors/405.html b/files/templates/errors/405.html index d2a58b779..44cbd801c 100644 --- a/files/templates/errors/405.html +++ b/files/templates/errors/405.html @@ -10,7 +10,7 @@
- +

 		

405 Method Not Allowed

idk how anyone gets this error but if you see this, remember to follow @carpathianflorist
the original error text here talked about internet gremlins and wtf

diff --git a/files/templates/errors/409.html b/files/templates/errors/409.html index cc73f0a01..068670542 100644 --- a/files/templates/errors/409.html +++ b/files/templates/errors/409.html @@ -10,7 +10,7 @@
- +

 		

409 Conflict

There were no survivors.

diff --git a/files/templates/errors/410.html b/files/templates/errors/410.html index 5e976edc8..0627b7727 100644 --- a/files/templates/errors/410.html +++ b/files/templates/errors/410.html @@ -10,7 +10,7 @@
- +

 		

410 Gone

There's nothing left here but a giant smouldering crater.

diff --git a/files/templates/errors/413.html b/files/templates/errors/413.html index b40bbe90d..68efe943f 100644 --- a/files/templates/errors/413.html +++ b/files/templates/errors/413.html @@ -10,7 +10,7 @@
- +

 		

413 Image Size Too Large

There's a 1 MB limit to profile picture uploads, and a 16 MB limit to all other image uploads.

diff --git a/files/templates/errors/418.html b/files/templates/errors/418.html index 44fbb8c73..31072c66a 100644 --- a/files/templates/errors/418.html +++ b/files/templates/errors/418.html @@ -10,7 +10,7 @@
- +

 		

418 I'm A Teapot

Sorry, I've been cursed and can't make you coffee right now.

diff --git a/files/templates/errors/422.html b/files/templates/errors/422.html index 58b4bab7b..e22cc2d8b 100644 --- a/files/templates/errors/422.html +++ b/files/templates/errors/422.html @@ -10,7 +10,7 @@
- +

 		

422 Unprocessable Entity

STOP BREAKING THINGS PLEASE WHY DO WE HAVE SO MANY ERROR CODES

diff --git a/files/templates/errors/429.html b/files/templates/errors/429.html index ccd67c79f..27da4af09 100644 --- a/files/templates/errors/429.html +++ b/files/templates/errors/429.html @@ -10,7 +10,7 @@
- +

 		

429 Too Many Requests

go spam somewhere else nerd

diff --git a/files/templates/errors/451.html b/files/templates/errors/451.html index 742cfae8d..0bafc3ea9 100644 --- a/files/templates/errors/451.html +++ b/files/templates/errors/451.html @@ -10,11 +10,11 @@
- +

 		

451 Unavailable For Legal Reasons

-



fool.

+



fool.

diff --git a/files/templates/errors/500.html b/files/templates/errors/500.html index 0b5ea41d8..b5de08324 100644 --- a/files/templates/errors/500.html +++ b/files/templates/errors/500.html @@ -10,7 +10,7 @@
- +

 			

500 Internal Server Error

Hiiiii it's carp! I think this error means that there's a timeout error. And I think that means something took too long to load so it decided not to work at all. If you keep seeing this on the same page but not other pages, then something is probably wrong with that specific function. It may not be called a function, but that sounds right to me. Anyway, ping me and I'll whine to someone smarter to fix it. Don't bother them. Thanks ily <3

diff --git a/files/templates/errors/502.html b/files/templates/errors/502.html index 35cf37db5..69be245c8 100644 --- a/files/templates/errors/502.html +++ b/files/templates/errors/502.html @@ -37,7 +37,7 @@