Syntax Highlighting in Web Component Templates [blog]
Read OriginalThis article explains a simple trick to get proper syntax highlighting and Prettier auto-formatting for HTML template strings within JavaScript web component code. The solution involves adding the exact comment `/* HTML */` before the template literal, which works with the `es6-string-html` VS Code extension. It details the problem, shows visual examples of the code in VS Code, and contrasts this method with other less effective approaches.
Comments
No comments yet
Be the first to share your thoughts!
Browser Extension
Get instant access to AllDevBlogs from your browser