From ef43ba3c591a05196881f115e056d96e42575492 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 19 Aug 2021 07:54:40 +0200 Subject: [PATCH] fdfd --- files/routes/comments.py | 4 ++-- files/routes/posts.py | 4 ++-- files/routes/settings.py | 2 +- files/templates/changelog.html | 2 +- files/templates/home.html | 2 +- files/templates/home_comments.html | 2 +- files/templates/search.html | 2 +- files/templates/userpage.html | 2 +- files/templates/userpage_comments.html | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 4661c1d9e..f29f617e2 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -158,7 +158,7 @@ def api_comment(v): if not body and not request.files.get('file'): return {"error":"You need to actually write something!"}, 400 - 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'![]({i.group(1)})') + 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(post_id=parent_id) as renderer: body_md = renderer.render(mistletoe.Document(body)) body_html = sanitize(body_md, linkgen=True) @@ -535,7 +535,7 @@ def edit_comment(cid, v): if c.is_banned or c.deleted_utc > 0: abort(403) body = request.form.get("body", "")[:10000] - 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'![]({i.group(1)})') + 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(post_id=c.post.id) as renderer: body_md = renderer.render(mistletoe.Document(body)) body_html = sanitize(body_md, linkgen=True) diff --git a/files/routes/posts.py b/files/routes/posts.py index 718981975..89facddf6 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -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|?maxwidth=9999))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})') + 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)})') 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|?maxwidth=9999))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})') + 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)})') with CustomRenderer() as renderer: body_md = renderer.render(mistletoe.Document(body)) body_html = sanitize(body_md, linkgen=True) diff --git a/files/routes/settings.py b/files/routes/settings.py index caecc8239..2139c992f 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -76,7 +76,7 @@ def settings_profile_post(v): v=v, error="You didn't change anything") - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|?maxwidth=9999))', bio, re.MULTILINE): bio = bio.replace(i.group(1), f'![]({i.group(1)})') + for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|9999))', bio, re.MULTILINE): bio = bio.replace(i.group(1), f'![]({i.group(1)})') bio = bio.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: bio_html = renderer.render(mistletoe.Document(bio)) bio_html = sanitize(bio_html, linkgen=True) diff --git a/files/templates/changelog.html b/files/templates/changelog.html index 03419e009..a0839ae60 100644 --- a/files/templates/changelog.html +++ b/files/templates/changelog.html @@ -23,7 +23,7 @@ {{t | capitalize}}