vscode-template-literal-editor icon indicating copy to clipboard operation
vscode-template-literal-editor copied to clipboard

Does this work with Javascript inside HTML file?

Open mbendtsen opened this issue 6 years ago • 2 comments

mbendtsen avatar Jul 19 '18 08:07 mbendtsen

If you mean editing js template literals in html, it should work ok. But if you instead intend to edit html-embedded javascript code as a subdocument in a separate editor, you can configure a customized regex for html that marks only the javascript parts. You can use the regexes in package.json as inspiration for your config.

plievone avatar Jul 19 '18 10:07 plievone

To do this change the html regex to (<script.*?>)([\s\S]*?)(</script>). Very useful for better js intellisense and when using script tags for custom templates.

nicholas-ross avatar May 31 '21 03:05 nicholas-ross