forked from rDrama/rDrama
parent
360cff7e8f
commit
578e1896fd
|
@ -27,6 +27,8 @@ poll_regex = re.compile("\s*\$\$([^\$\n]+)\$\$\s*", flags=re.A)
|
||||||
bet_regex = re.compile("\s*\$\$\$([^\$\n]+)\$\$\$\s*", flags=re.A)
|
bet_regex = re.compile("\s*\$\$\$([^\$\n]+)\$\$\$\s*", flags=re.A)
|
||||||
choice_regex = re.compile("\s*&&([^\$\n]+)&&\s*", flags=re.A)
|
choice_regex = re.compile("\s*&&([^\$\n]+)&&\s*", flags=re.A)
|
||||||
|
|
||||||
|
html_comment_regex = re.compile("<!--.*-->", flags=re.A)
|
||||||
|
|
||||||
title_regex = re.compile("[^\w ]", flags=re.A)
|
title_regex = re.compile("[^\w ]", flags=re.A)
|
||||||
|
|
||||||
based_regex = re.compile("based and (.{1,20}?)(-| )pilled", flags=re.I|re.A)
|
based_regex = re.compile("based and (.{1,20}?)(-| )pilled", flags=re.I|re.A)
|
||||||
|
|
|
@ -197,6 +197,7 @@ def sanitize_raw_title(sanitized):
|
||||||
|
|
||||||
def sanitize_raw_body(sanitized, is_post):
|
def sanitize_raw_body(sanitized, is_post):
|
||||||
if not sanitized: return ""
|
if not sanitized: return ""
|
||||||
|
sanitized = html_comment_regex.sub('', sanitized)
|
||||||
sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\r\n", "\n")
|
sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\r\n", "\n")
|
||||||
sanitized = sanitized.strip()
|
sanitized = sanitized.strip()
|
||||||
return sanitized[:POST_BODY_LENGTH_LIMIT if is_post else COMMENT_BODY_LENGTH_LIMIT]
|
return sanitized[:POST_BODY_LENGTH_LIMIT if is_post else COMMENT_BODY_LENGTH_LIMIT]
|
||||||
|
|
Loading…
Reference in New Issue