forked from rDrama/rDrama
master
parent
d428fa28e0
commit
4c6c1ecb6d
|
@ -278,6 +278,7 @@ def api_comment(v):
|
||||||
if not body and not request.files.get('file'): return jsonify({"error":"You need to actually write something!"}), 400
|
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'![]({i.group(1)})')
|
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})')
|
||||||
|
body = body.replace("\n", "\n\n")
|
||||||
with CustomRenderer(post_id=parent_id) as renderer: body_md = renderer.render(mistletoe.Document(body))
|
with CustomRenderer(post_id=parent_id) as renderer: body_md = renderer.render(mistletoe.Document(body))
|
||||||
body_html = sanitize(body_md, linkgen=True)
|
body_html = sanitize(body_md, linkgen=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue