Double quotes and color coding



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?



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.


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


Thanks for this.