diff --git a/files/routes/comments.py b/files/routes/comments.py index 5c443ea8dc..367ade160c 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -597,7 +597,6 @@ def edit_comment(cid, v): body = request.values.get("body", "")[:10000] for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') - body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body) body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md) diff --git a/files/routes/posts.py b/files/routes/posts.py index 6630d7d5ca..549bc8da2c 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -229,7 +229,6 @@ def edit_post(pid, v): if body != p.body: for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') - body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body) body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md)