diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py
index 1faff19538..d04454af24 100644
--- a/files/helpers/sanitize.py
+++ b/files/helpers/sanitize.py
@@ -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'
')
+ sanitized = sanitized.replace(f'
:{emoji}:
', f'![{emoji}](https://{site}/assets/images/emojis/{emoji}.webp)
')
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(':([^ ]{1,30}?):', sanitized):
emoji = i.group(1).lower()
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
- sanitized = sanitized.replace(f':{emoji}:', f'
')
+ sanitized = sanitized.replace(f':{emoji}:', f'
')
try:
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
@@ -264,6 +264,6 @@ def sanitize(sanitized, noimages=False):
sanitized = sanitized.replace(rd, "https://old.reddit.com/")
sanitized = re.sub(' (https:\/\/[^ <>]*)', r' \1', sanitized)
- sanitized = re.sub('(https:\/\/[^ <>]*)', r'
\1', sanitized)
+ sanitized = re.sub('
(https:\/\/[^ <>]*)', r'
\1
', sanitized)
return sanitized
diff --git a/files/routes/posts.py b/files/routes/posts.py
index 1331e8a074..346a5e4dc3 100644
--- a/files/routes/posts.py
+++ b/files/routes/posts.py
@@ -439,7 +439,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 8b075216f3..df00165b0e 100644
--- a/files/routes/reporting.py
+++ b/files/routes/reporting.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)}.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,
@@ -52,7 +52,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,