forked from MarseyWorld/MarseyWorld
master
parent
79246cf558
commit
f90b2ea466
|
@ -237,6 +237,7 @@ def edit_post(pid, v):
|
|||
|
||||
body = request.form.get("body", "")
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|9999))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})')
|
||||
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n").replace("\n\n\n", "\n\n")
|
||||
with CustomRenderer() as renderer: body_md = renderer.render(mistletoe.Document(body))
|
||||
body_html = sanitize(body_md)
|
||||
|
||||
|
@ -747,6 +748,7 @@ def submit_post(v):
|
|||
|
||||
# render text
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|9999))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})')
|
||||
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n").replace("\n\n\n", "\n\n")
|
||||
with CustomRenderer() as renderer:
|
||||
body_md = renderer.render(mistletoe.Document(body))
|
||||
body_html = sanitize(body_md)
|
||||
|
|
Loading…
Reference in New Issue