HTML语法高亮显示Sublime 3打字稿 [英] HTML syntax highlight sublime 3 Typescript

查看:91
本文介绍了HTML语法高亮显示Sublime 3打字稿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将TypeScript与Sublime 3一起使用.如何在模板属性中添加HTML高亮显示:[注意:我已经在使用Microsoft TypeScript软件包]

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:

推荐答案

您可以在此处阅读如何实现此目的:

You can read here how to achieve this:

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

转载于此:

打开工具>开发人员>新语法

Open Tools > Developer > New Syntax

添加:

%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

并保存为JavaScript-NG.sublime-syntax

and save it has JavaScript-NG.sublime-syntax

与此相关的还有一个开放的github问题:

There is also an open github issue on this:

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

这篇关于HTML语法高亮显示Sublime 3打字稿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆