borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
558 stars 18 forks source link

Highlight HTML inside template strings #104

Open dantman opened 6 years ago

dantman commented 6 years ago

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);
dawuzi commented 6 years ago

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

dantman commented 6 years ago

@dawuzi Sorry no, I stopped using Sublime.

dawuzi commented 6 years ago

@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