Done Allow users to escape separators in polls

Status
Not open for further replies.
The following poll was suggested to me:

How do you pronounce "regex"? | ri.ɡɛks | ri.dʒɛks | re.ɡeks | re.compile(r'r(i|e)\.(g|dʒ)(e|ɛ)ks') and I'm a nerd

As you can tell, the regex's | will cause an error and split the last intended option into:
Question:
How do you pronounce "regex"?
Poll Options:
ri.ɡɛks
ri.dʒɛks
re.ɡeks
re.compile(r'r(i
e)\.(g
dʒ)(e
ɛ)ks')

Cool, so let's just change the separator to , to get:
How do you pronounce "regex"?, ri.ɡɛks, ri.dʒɛks, re.ɡeks, re.compile(r'r(i|e)\.(g|dʒ)(e|ɛ)ks') and I'm a nerd

This results with the following:
Question:
How do you pronounce "regex"?, ri.ɡɛks, ri.dʒɛks, re.ɡeks, re.compile(r'r(i
Poll Options:
e)\.(g
dʒ)(e
ɛ)ks')

The actual solution was to use the following (NOTE: /poll htmlcreate is locked behind the room owner roll):
/poll htmlcreate How do you pronounce "regex"? | ri.ɡɛks | ri.dʒɛks | re.ɡeks | re.compile(r'r(i|e)\.(g|dʒ)(e|ɛ)ks') and I'm a nerd

After talking this over, we came up with the idea to allow users to simply escape separators, presumably like \|

Thanks BreadLoeuf for requesting this poll. Attaching McLemore who volunteered to implement this if approved.

If this is rejected, I would like to document | takes precedence over , as a separator in /help poll
 

HoeenHero

The Misspelled Hero!
is a Battle Simulator Administratoris a Programmeris a Member of Senior Staffis a Community Contributoris a Smogon Discord Contributor Alumnus
PS Admin
Perhaps the best way to do this is to only split on one given seperator and not all of them? Eitherway, I'm fine with escaping too.

McLemore tagging you since you said you would work on it if its approved.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top