fggf4
This commit is contained in:
parent
44808cec5c
commit
8f62931975
75 changed files with 259 additions and 250 deletions
|
@ -236,7 +236,7 @@ def edit_post(pid, v):
|
|||
abort(403)
|
||||
|
||||
body = request.form.get("body", "")
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'})')
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|?maxwidth=9999))', body, re.MULTILINE): body = body.replace(i.group(1), f'})')
|
||||
with CustomRenderer() as renderer: body_md = renderer.render(mistletoe.Document(body))
|
||||
body_html = sanitize(body_md, linkgen=True)
|
||||
|
||||
|
@ -707,7 +707,7 @@ def submit_post(v):
|
|||
else: return render_template("submit.html", v=v, error="2048 character limit for URLs.", title=title, url=url,body=request.form.get("body", "")), 400
|
||||
|
||||
# render text
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'})')
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|?maxwidth=9999))', body, re.MULTILINE): body = body.replace(i.group(1), f'})')
|
||||
with CustomRenderer() 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