This commit is contained in:
Aevann1 2021-07-29 10:03:00 +02:00
parent 48786bc1b8
commit d08e968f91
5 changed files with 19 additions and 41 deletions

View file

@ -390,7 +390,7 @@ def api_comment(v):
return jsonify({"error": "That wasn't an image!"}), 400
name = f'comment/{c.base36id}/{secrets.token_urlsafe(8)}'
url = upload_file(name, file)
url = upload_file(file)
body = request.form.get("body") + f"\n![]({url})"
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
@ -745,7 +745,7 @@ def edit_comment(cid, v):
if not file.content_type.startswith('image/'): return jsonify({"error": "That wasn't an image!"}), 400
name = f'comment/{c.base36id}/{secrets.token_urlsafe(8)}'
url = upload_file(name, file)
url = upload_file(file)
body += f"\n![]({url})"
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")