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.
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 @@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 @@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 @@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
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 @@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 @@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 @@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 @@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 @@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 @@
fool.
fool.
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 @@