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 .
×

Ermahgerd, What Did I Do?

Not urgent - I don't think - but what on earth have I done? I'm working on an issue and wanted to mark part of a script with xxx to make it easier to find when I come back to it. I put "xxx" behind a // for a comment and it turned green? It reverts to a normal comment colour if I add an extra x. But anyone know what this is? A way to make things easy to find, perhaps?
1784613997

Edited 1784614861
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Tim! That is likely the work of the Roll20 syntax highlighter. It wants to tokenize certain common comments to highlight them. Try these: // TODO // FIXME // NOTE // HACK // XXX You will find that all of them highlight in green except note. The highlighter recognizes these common comments and wants you to be able to find and see them easily. Edit: With some guidance from chatGPT, I managed to track down the actual Regex rule through the console: \\b(?:TODO|FIXME|XXX|HACK)\\b That matches the test cases above.
keithcurtis said: Hi Tim! That is likely the work of the Roll20 syntax highlighter. It wants to tokenize certain common comments to highlight them. Try these: // TODO // FIXME // NOTE // HACK // XXX You will find that all of them highlight in green except note. The highlighter recognizes these common comments and wants you to be able to find and see them easily. Edit: With some guidance from chatGPT, I managed to track down the actual Regex rule through the console: \\b(?:TODO|FIXME|XXX|HACK)\\b That matches the test cases above. Cool beans, thanks Keith. I had no idea. Though my plan was to start using //xxx to stand out. Previously, I used to write xxx without saving anything anything to help find my way. Just started to comment it yesterday. 
1784643874
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Heh, I use "QX" as a bookmark for the same reason, under the theory that it's a letter combination that does not occur naturally.
keithcurtis said: Heh, I use "QX" as a bookmark for the same reason, under the theory that it's a letter combination that does not occur naturally. Ohh, I might use that too!