forked from rDrama/rDrama
fix polls
parent
25b8913b8d
commit
a7a104348d
|
@ -509,7 +509,7 @@ def process_poll_options(v:User, target:Union[Submission, Comment]):
|
||||||
if option_count > POLL_MAX_OPTIONS:
|
if option_count > POLL_MAX_OPTIONS:
|
||||||
abort(400, f"Max number of poll options is {POLL_MAX_OPTIONS}")
|
abort(400, f"Max number of poll options is {POLL_MAX_OPTIONS}")
|
||||||
|
|
||||||
body = i.group(1)
|
body = i.group(2)
|
||||||
|
|
||||||
if len(body) > 500:
|
if len(body) > 500:
|
||||||
abort(400, f"Poll option body too long! (Max 500 characters)")
|
abort(400, f"Poll option body too long! (Max 500 characters)")
|
||||||
|
|
|
@ -31,9 +31,9 @@ valid_sub_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$", flags=re.A)
|
||||||
|
|
||||||
query_regex = re.compile("(\w+):(\S+)", flags=re.A)
|
query_regex = re.compile("(\w+):(\S+)", flags=re.A)
|
||||||
|
|
||||||
poll_regex = re.compile("^\$\$([^\$\n]+)\$\$\s*(?!([^<]*<\/(code|pre|a)>|[^`]*`))", flags=re.A)
|
poll_regex = re.compile("(^|\n)\$\$([^\$\n]+)\$\$\s*?(?!([^<]*<\/(code|pre|a)>|[^`]*`))", flags=re.A)
|
||||||
bet_regex = re.compile("^##([^\!\n]+)##\s*(?!([^<]*<\/(code|pre|a)>|[^`]*`))", flags=re.A)
|
bet_regex = re.compile("(^|\n)##([^\!\n]+)##\s*?(?!([^<]*<\/(code|pre|a)>|[^`]*`))", flags=re.A)
|
||||||
choice_regex = re.compile("^&&([^\&\n]+)&&\s*(?!([^<]*<\/(code|pre|a)>|[^`]*`))", flags=re.A)
|
choice_regex = re.compile("(^|\n)&&([^\&\n]+)&&\s*?(?!([^<]*<\/(code|pre|a)>|[^`]*`))", flags=re.A)
|
||||||
|
|
||||||
html_comment_regex = re.compile("<!--.*-->", flags=re.A)
|
html_comment_regex = re.compile("<!--.*-->", flags=re.A)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue