make it not possible for a post to have "queen" or "sharpened" css class without having the body replacements (through editing above the 1000 mark)

pull/213/head
Aevann 2023-10-11 23:18:52 +03:00
parent a1b226117b
commit 678faa9e73
2 changed files with 12 additions and 8 deletions

View File

@ -383,10 +383,11 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
sanitized = owoify(sanitized)
if author.marsify and not author.chud:
sanitized = marsify(sanitized)
if obj.sharpened:
sanitized = sharpen(sanitized)
if obj.queened:
sanitized = queenify(sanitized)
if obj.sharpened:
sanitized = sharpen(sanitized)
if obj.queened:
sanitized = queenify(sanitized)
if '```' not in sanitized and '<pre>' not in sanitized:
sanitized = linefeeds_regex.sub(r'\1\n\n\2', sanitized)
@ -681,8 +682,9 @@ def filter_emojis_only(title, golden=True, count_emojis=False, obj=None, author=
title = owoify(title)
if author.marsify and not author.chud:
title = marsify(title)
if obj.sharpened:
title = sharpen(title)
if obj.sharpened:
title = sharpen(title)
emojis_used = set()

View File

@ -551,6 +551,8 @@ def submit_post(v, hole=None):
if url == '': url = None
flag_chudded = v.chud and hole != 'chudrama' and not (len(body) > 1000 and not v.chudded_by)
flag_queened = v.queened and len(body) <= 1000
flag_sharpened = v.sharpened and len(body) <= 1000
p = Post(
private=flag_private,
@ -568,8 +570,8 @@ def submit_post(v, hole=None):
ghost=flag_ghost,
chudded=flag_chudded,
rainbowed=bool(v.rainbow),
queened=bool(v.queen),
sharpened=bool(v.sharpen),
queened=flag_queened,
sharpened=flag_sharpened,
)
title_html = filter_emojis_only(title, count_emojis=True, obj=p, author=v)