fix polls

pull/139/head
Aevann 2023-03-12 20:40:18 +02:00
parent 25b8913b8d
commit a7a104348d
2 changed files with 4 additions and 4 deletions

View File

@ -509,7 +509,7 @@ def process_poll_options(v:User, target:Union[Submission, Comment]):
if option_count > 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:
abort(400, f"Poll option body too long! (Max 500 characters)")

View File

@ -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)
poll_regex = re.compile("^\$\$([^\$\n]+)\$\$\s*(?!([^<]*<\/(code|pre|a)>|[^`]*`))", flags=re.A)
bet_regex = re.compile("^##([^\!\n]+)##\s*(?!([^<]*<\/(code|pre|a)>|[^`]*`))", flags=re.A)
choice_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)##([^\!\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)