master
Aevann1 2022-04-22 17:17:10 +02:00
parent 6b97488355
commit e3b00f6c89
2 changed files with 5 additions and 1 deletions

View File

@ -816,4 +816,6 @@ yt_id_regex = re.compile('[a-z0-9-_]{5,20}', flags=re.I|re.A)
image_regex = re.compile("(^|\s)(https:\/\/[\w\-.#&/=\?@%;+]{5,250}(\.png|\.jpg|\.jpeg|\.gif|\.webp|maxwidth=9999|fidelity=high))($|\s)", flags=re.I|re.A)
procoins_li = (0,2500,5000,10000,25000,50000,125000,250000)
procoins_li = (0,2500,5000,10000,25000,50000,125000,250000)
linefeeds_regex = re.compile("([^\n])\n([^\n])", flags=re.A)

View File

@ -87,6 +87,8 @@ def sanitize(sanitized, alert=False, comment=False, edit=False):
signal.signal(signal.SIGALRM, handler)
signal.alarm(1)
sanitized = linefeeds_regex.sub(r'\1\n\n\2', sanitized)
sanitized = image_check_regex.sub(r'\1', sanitized)
sanitized = markdown(sanitized)