I simplified this to the basics to make sure it wasn’t something I was doing wrong. charAt() refuses to print an exclamation mark, which makes no sense to me.
Here’s the simplified widget:
<<widget "Test">> <<for _i to 0; _i lt $args.length; _i++>> <span><<print $args.charAt(_i)>></span> <</for>> <</widget>>
I need the print to be inside of a span in order to apply text effects per letter via the span (which is the whole point of the widget), in case it’s confusing why that span is there. When simplifying I removed everything but the basic span, for loop, and print.
Everything is working properly in the original widget, except for charAt() refusing to print an exclamation mark.
Running the test widget, both of these fail to display an exclamation point:
<<Test "\"Test!\"">> <<Test "\"Test\!\"">>
Even escaping the ! with a \ doesn’t work. Why? I thought \ escaped anything right behind it. Plus \ is working with the quotes, so clearly escaping works with charAt().
I did eventually get around this by putting in an if statement to directly print ! when there’s an exclamation point.
But I would really like to understand why ! wasn’t working with charAt(), and couldn’t be made to work even by escaping it. That makes absolutely no sense to me.