This commit is contained in:
Aevann1 2022-01-21 16:22:44 +02:00
parent b05840c369
commit 98fffe55d3
4 changed files with 5 additions and 12 deletions

View file

@ -178,7 +178,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
sanitized = re.sub('\|\|(.*?)\|\|', r'<span class="spoiler">\1</span>', sanitized)
if comment:
marsey_count = cache.get("marsey_count")
with open("marsey_count.json", 'r') as f: marsey_count = loads(f.read())
marseys_used = set()
for i in re.finditer("[^a]>\s*(:[!#]{0,2}\w+:\s*)+<\/", sanitized):
@ -260,7 +260,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
if comment:
for emoji in marseys_used:
if emoji in marsey_count: marsey_count[emoji] += 1
cache.set("marsey_count", marsey_count)
with open('marsey_count.json', 'w') as f: dump(marsey_count, f)
return sanitized