fdssfd
This commit is contained in:
parent
9e7e4173dd
commit
6405dc208e
8 changed files with 10 additions and 16 deletions
|
@ -206,7 +206,7 @@ def edit_post(pid, v):
|
|||
p.title_html = filter_title(title)
|
||||
|
||||
if body != p.body:
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE):
|
||||
for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE):
|
||||
if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'})')
|
||||
body_md = CustomRenderer().render(mistletoe.Document(body))
|
||||
body_html = sanitize(body_md)
|
||||
|
@ -665,7 +665,7 @@ def submit_post(v):
|
|||
if request.headers.get("Authorization"): return {"error":"2048 character limit for URLs."}, 400
|
||||
else: return render_template("submit.html", v=v, error="2048 character limit for URLs.", title=title, url=url,body=request.values.get("body", "")), 400
|
||||
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE):
|
||||
for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE):
|
||||
if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'})')
|
||||
body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue