When we write HTML template in string form, or add HTML content to a tag, such as, if this str is more long, once there is less a single quotation mark, less a plus sign, the basic error can not understand, a face Meng forced ...
// var datajson = [{item.name =" China ", Item.id =" 1 " =" haha ", Item.link =" www.google.com "}, just write a note. ...}] var item = Datajson[0]; var str = ' <li itemid= ' ' + item.id + ' ">;$ ( ' #box '). Text (str);
Well, then, I was smart, so I wrote Str.
var str = ' <li itemid= ' ' + item.id + '"> ' + item.name + '< /h4> <p>' + item.content + '</p> <p class= "Item.link" >' + item.link + ' </ P></li> ';
But obsessive-compulsive disorder may be confused, not all of them! So, previously discovered a function of webstorm , the effect is as follows
The upper part of Str becomes very difficult to see, but the formatted place (lower part) shows good results and is clear at a glance. This function is called edit HTML Fragment (edit HTML fragment)
The operation steps are:
1, to the HTML part of STR alt+enter
2. Select Edit HTML fragment,enter OK
Of course, there are four functions in it, if you do not want that function, the cursor is selected the right button, disable it, and then it will never appear
Disabled you will regret, how to do? Where to find it? Google a bit, well, found, first we want to know its name is called Edit injected fragment, then,
File------and setting--and intentions, then on the right we see Language injection, the one you want to disable.
The above is said that the whole content, a lot of nonsense, the picture is too much, well, I hope to be helpful to you
Webstorm HTML defragmentation feature