Aevann 2024-05-24 00:20:46 +03:00
parent 34d1debd6b
commit 304ff66f40
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ controversial_regex = re.compile('https:\/\/old\.reddit\.com\/r\/\w{2,20}\/comme
spoiler_regex = re.compile('\|\|(.+?)\|\|' + NOT_IN_CODE_OR_LINKS, flags=re.A)
hole_mention_regex = re.compile('(?<![\w/])\/?([hH]\/[\w-]{3,25})' + NOT_IN_CODE_OR_LINKS, flags=re.A)
strikethrough_regex = re.compile('(^|\s|>|")~{1,2}([^~]+)~{1,2}' + NOT_IN_CODE_OR_LINKS, flags=re.A)
strikethrough_regex = re.compile('~{1,2}([^~]+)~{1,2}' + NOT_IN_CODE_OR_LINKS, flags=re.A)
mute_regex = re.compile("\/mute @?([\w-]{1,30}) ([0-9]+)", flags=re.A|re.I)
unmute_regex = re.compile("\/unmute @?([\w-]{1,30})", flags=re.A|re.I)

View File

@ -369,7 +369,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
sanitized = numbered_list_regex.sub(r'\1\. ', sanitized)
sanitized = strikethrough_regex.sub(r'\1<del>\2</del>', sanitized)
sanitized = strikethrough_regex.sub(r'<del>\1</del>', sanitized)
sanitized = sanitized.replace('_', '')
sanitized = markdown(sanitized)
@ -670,7 +670,7 @@ def filter_emojis_only(title, golden=True, count_emojis=False, obj=None, author=
obj.nsfw = True
break
title = strikethrough_regex.sub(r'\1<del>\2</del>', title)
title = strikethrough_regex.sub(r'<del>\1</del>', title)
if link:
title = bleach.Cleaner(