visual-studio-codesyntax-highlightingtemplate-strings

Highlight HTML syntax inside a string?


Is there a way (plugin, option, or tip and trick) to highlight HTML syntax in a JS string?

My document is a .js file, in which I use strings containing HTML code. Is it possible to highlight HTML syntaxe inside these strings?

enter image description here


Solution

  • You can use the extension es6-string-html

    Note: You need to add a comment with the language in front of the multiline string

    Before and After