Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Colons break chat window buttons

July 08 (8 years ago)

Edited July 08 (8 years ago)
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
I don't know if this is a bug or not, but I suspect it is something that everybody who knows a whole lot more about markup would say "of course that would happen - can't be helped". 
Anyway, here is what is happening, and I hope somebody can explain why.

The following typed into the chat window gives me a nice big red button in the chat window. 
[click this](!edParse~ illegal)
However if I change it to:
[click this](!edParse~ illegal: )
IE: add a colon anywhere inside it. It gives something other than a button. It looks a bit like a link but is not clickable or go anywhere. 
Anyway, I really, really want a button that will send commands that contain colons to my API. 
I tried replacing all the colons with the uf8 code for colon, but that did not work. 

As a workaround I am sending some other character and having my parser replace all of the other characters with colons, and I guess I can keep that solution in a pinch, but...

Is this a bug? A feature of Markup?  Why is this happening?

     Thanks. 
July 08 (8 years ago)

Edited July 08 (8 years ago)
I've noticed this too. There's a few other characters (and some HTML entities) that don't play well with Command Buttons. My guess is that it has something to do with HTTP. You could try escaping the colons twice, i.e.
[click this](!edParse~ illegal: )
July 08 (8 years ago)
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator

Silvyre said:

 You could try escaping the colons twice, i.e.
Is that working for you? because none of the variants I can think up of that work other than just substituting them out. 

July 09 (8 years ago)
chris b.
Pro
Sheet Author
API Scripter
What if you try % escape codes or is that what you meant (%20 for space etc )
Since it's a URL, just a thought.
July 09 (8 years ago)
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
Is it a URL? Once again, markup is something I know nothing about, but I don't think it is a URL. where the URL would normally go is an API command that starts with a "!" so the parser knows it is an API command. 

What I have tried is substituting the UF8 code & @ 58 ;  And any other variants of that I could think of. None of them worked.

Like I said, I have sidestepped this problem by just before forming the button doing a string.replace() to change all the colons to something else, then when the API gets a new command, doing the reverse, but like I said, typing the contents of the 2nd box above into the chat window does not result in a button being displayed. If somebody could show me a string that does result in a button, and the button presenting a string with a colon in it, I would be interested in seeing the results. 
July 10 (8 years ago)
Lithl
Pro
Sheet Author
API Scripter
Buttons in the chat window are links, yes. "[example](!test)" produces "<a href="!test">example</a>". A colon in the button's command could certainly lead to the browser interpreting everything before the colon as the protocol.