fddf
This commit is contained in:
parent
de880f14ba
commit
709598ebfb
11 changed files with 21 additions and 45 deletions
|
@ -264,7 +264,7 @@ def api_comment(v):
|
|||
|
||||
if not body and not request.files.get('file'): return jsonify({"error":"You need to actually write something!"}), 400
|
||||
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif))', body, re.MULTILINE): body = body.replace(i.group(1), f'})')
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif))', body.lower(), re.MULTILINE): body = body.replace(i.group(1), f'})')
|
||||
body = body.replace("\n", "\n\n")
|
||||
with CustomRenderer(post_id=parent_id) as renderer: body_md = renderer.render(mistletoe.Document(body))
|
||||
body_html = sanitize(body_md, linkgen=True)
|
||||
|
@ -649,7 +649,7 @@ def edit_comment(cid, v):
|
|||
if c.is_banned or c.deleted_utc > 0: abort(403)
|
||||
|
||||
body = request.form.get("body", "")[0:10000]
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif))', body, re.MULTILINE): body = body.replace(i.group(1), f'})')
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif))', body.lower(), re.MULTILINE): body = body.replace(i.group(1), f'})')
|
||||
body = body.replace("\n", "\n\n")
|
||||
with CustomRenderer(post_id=c.post.base36id) as renderer: body_md = renderer.render(mistletoe.Document(body))
|
||||
body_html = sanitize(body_md, linkgen=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue