Is there a way (plugin, option, or tip and trick) to highlight html syntax in a js string?
My document is .JS file, in which I use strings containing html code. Is it possible highlight html syntaxe inside these strings?
Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names.
If you are using JavaScript's new template literal syntax in a JSP page it might not work as expected. That's because JSP and JavaScript both use the ${myVar} syntax.
OMG , after 3 hour research i find !!!!!
https://marketplace.visualstudio.com/items?itemName=Tobermory.es6-string-html
befor
after
enjoys
The extension that you suggested requires that you prefix your strings with a comment like /*html*/
or html
. I'm working with Angular, and I didn't want to go through all my templates to prefix them, so I found this extension that does it automatically without prefixes:
https://marketplace.visualstudio.com/items?itemName=natewallace.angular2-inline
It is included in the Angular Essentials package by John Papa:
https://marketplace.visualstudio.com/items?itemName=johnpapa.angular-essentials
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With