Double quotes and color coding


#1

Hello,

I use atom for my js work. I have a few places where I use a string replace code like: str.replace(/\"/g, " ") ==> which essentially replaces " in a string with a blank space. However, in doing so, the color coding of my entire js file gets messed up. Atom thinks i’ve opend a " but have never closed it. How do I fix such a scenario?

Thanks.


#2

This seems to work correctly on the beta version. If you’re using an earlier version, you might try a workaround:

str.replace(/\"/g, " ")    //"

I’ve had to do that before in other editors.


#3

Alternatively \x22 instead of " ( as in /\x22/)


#4

Thanks for this.