forked from MarseyWorld/MarseyWorld
dffd
parent
0aa8353031
commit
8a7fc4adae
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue