naomi icon indicating copy to clipboard operation
naomi copied to clipboard

Highlight HTML inside template strings

Open dantman opened this issue 6 years ago • 3 comments

It would be nice if in JavaScript template literals with a html tag were syntax highlighted as html.

Like the following.

https://www.polymer-project.org/blog/2018-01-18-polymer-3-new-preview

import {Element as PolymerElement, html} from "../node_modules/@polymer/polymer/polymer-element.js"
class MyAppElement extends PolymerElement {
  static get template() {
    return html`<div>I'm a template</div>
                <div>[[withBindings]]</div>
                <button on-click="clickHandler">Click me!</button>`
  }
  ...
}
customElements.define('my-app-element', MyAppElement);

dantman avatar Mar 20 '18 05:03 dantman

Have you figured a way to do this yet @dantman . I am currently facing the same challenge

dawuzi avatar Jul 13 '18 18:07 dawuzi

@dawuzi Sorry no, I stopped using Sublime.

dantman avatar Jul 13 '18 18:07 dantman

@dantman I thought you were using vscode like I am. I just figured it out some minutes ago though. I installed an extension. lit html and is shows properly now

dawuzi avatar Jul 13 '18 19:07 dawuzi