Sub Syntax Code Color


If I define a variable in a JavaScript file like so,

var myString = "<tag>foobar</tag>"

then WebStorm seems to use my HTML/XML code color preferences to highlight the contents of my JavaScript string (ie the text between the two quote marks). This is totally undesriable and incorrect, the text between the quotes is *not* HTML or XML, it is very definitly a JavaScript string literal, and I'd expect it to be colored as such. As it stands any JavaScript where I'm putting HTML tags into string literals is an unreadable, multicolored mess.

Is there anyway to stop WebStorm unhelpfully coloring my JavaScript as different syntaxes?



Comment actions Permalink

Hi Jed,

It's supposed to be controlled via "Settings | Language Injections" -- please check if you can turn it off there.

Comment actions Permalink

Hey thanks for the reponse. I had 5 language injections enabled and I disabled all of them, but it looks like HTML is still being highlighted in JS files ...

Comment actions Permalink

In this case I may only suggest submitting a ticket to the Issue Tracker -- I personally have no idea if that was done intentionally (i.e. maybe it is implemented in such way so it cannot be turned on/off when desired) or devs just forgot to list that option there.


Please sign in to leave a comment.