HTML syntax highlight sublime 3 Typescript

Issue

I am using TypeScript with Sublime 3. How can I add HTML highlight in template attribute: [NOTE: I am already using Microsoft TypeScript Package]

Look how its not highlighted now:

enter image description here

Solution

You can read here how to achieve this:

https://forum.sublimetext.com/t/javascript-es6-template-literals-syntax-for-html/18242

Reproduced here:

Open Tools > Developer > New Syntax

Add:

%YAML1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: JavaScript NG
file_extensions:
  - js
  - ng.js
scope: source.js.ng
contexts:
  main:
    - match: ""
      push: scope:source.js
      with_prototype:
      - match: '`'
        push:
          - meta_content_scope: text.html.basic.embedded.js
          - include: 'scope:text.html.basic'
          - match: '`'
          pop: true

and save it has JavaScript-NG.sublime-syntax

There is also an open github issue on this:

https://github.com/sublimehq/Packages/issues/179

Answered By – VRPF

Answer Checked By – Cary Denson (AngularFixing Admin)

Leave a Reply

Your email address will not be published.