master
Aevann1 2021-09-03 16:39:12 +02:00
parent 0aa8353031
commit 8a7fc4adae
1 changed files with 4 additions and 5 deletions

View File

@ -89,11 +89,6 @@ def settings_profile_post(v):
if request.values.get("bio"):
bio = request.values.get("bio")[:1500]
if bio == v.bio:
return render_template("settings_profile.html",
v=v,
error="You didn't change anything")
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")
@ -115,6 +110,10 @@ def settings_profile_post(v):
bio += f"\n\n![]({url})"
if bio == v.bio:
return render_template("settings_profile.html",
v=v,
error="You didn't change anything")
with CustomRenderer() as renderer: bio_html = renderer.render(mistletoe.Document(bio))
bio_html = sanitize(bio_html)