Disable showmore logic on posts.

remotes/1693045480750635534/spooky-22
Snakes 2022-08-10 17:34:15 -04:00
parent f2030077f0
commit 55c1ad859e
Signed by: Snakes
GPG Key ID: E745A82778055C7E
2 changed files with 4 additions and 4 deletions

View File

@ -214,7 +214,7 @@ def with_sigalrm_timeout(timeout: int):
@with_sigalrm_timeout(2)
def sanitize(sanitized, edit=False, limit_pings=False):
def sanitize(sanitized, edit=False, limit_pings=False, showmore=True):
sanitized = sanitized.strip()
sanitized = normalize_url(sanitized)
@ -388,7 +388,7 @@ def sanitize(sanitized, edit=False, limit_pings=False):
if '<pre>' not in sanitized:
sanitized = sanitized.replace('\n','')
if len(sanitized) > 5000:
if showmore and len(sanitized) > 5000:
sanitized = showmore_regex.sub(r'\1<p><button class="showmore" onclick="showmore()">SHOW MORE</button></p><d class="d-none">\2</d>', sanitized)
return sanitized.strip()

View File

@ -439,7 +439,7 @@ def edit_post(pid, v):
g.db.add(option)
body_html = sanitize(body, edit=True, limit_pings=True)
body_html = sanitize(body, edit=True, limit_pings=True, showmore=False)
if v.id == p.author_id and v.marseyawarded and marseyaward_body_regex.search(body_html):
return {"error":"You can only type marseys!"}, 403
@ -890,7 +890,7 @@ def submit_post(v, sub=None):
body = body.strip()
body_html = sanitize(body, limit_pings=True)
body_html = sanitize(body, limit_pings=True, showmore=False)
if v.marseyawarded and marseyaward_body_regex.search(body_html):
return error("You can only type marseys!")