I am supporting some existing code where the original author used StringEscapeUtils to escape Javascript for the contents of a list like so...
def myList = ["Easy Installation", "Good Price / Value", "Attractive Design"]
myList = myList.collect { StringEscapeUtils.escapeJavaScript(it) }
println("Result is ${myList.join(',')}")
Of course what is printed out is..
Result is Easy Installation,Good Price \/ Value,Attractive Design
First question is why is it trying to escape the forward slash? According to this post, the forward slash is harmless in Javascript (and I assume HTML too).
Second question, can anything be done about it (short of not escaping of course) so forward slashes don't appear as "V"s?