最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - syntax highlighting for JSX not working in sublime text 3 - Stack Overflow

programmeradmin0浏览0评论

I am using sublime text for react.js development and everything is fine but the syntax highlighting for the inline code inside html files as shown in line number 18.

note that syntax highlighting works fine within example.js that was wired up in line number 16

I am using sublime text for react.js development and everything is fine but the syntax highlighting for the inline code inside html files as shown in line number 18.

note that syntax highlighting works fine within example.js that was wired up in line number 16

Share Improve this question edited Jul 17, 2016 at 21:41 Hesham Adel asked Jul 17, 2016 at 21:35 Hesham AdelHesham Adel 3676 silver badges16 bronze badges 1
  • 1 It doesn't work because in sublime your syntax highlighting is set to HTML. See bottom right corner in you sublime. In your js file it would have been set to jsx and that's why it worked correctly there. – Shubham Khatri Commented Jul 18, 2016 at 6:16
Add a comment  | 

2 Answers 2

Reset to default 15

You need to select Javascript (Babel) for the language in the bottom right corner:

It doesn't work because in sublime your syntax highlighting is set to HTML. See bottom right corner in you sublime. In your js file it would have been set to jsx and that's why it worked correctly there. This answer on Stackoverflow explains how you can achieve it in Sublime Text 2.

You can also visit and look at Sublime text 3 documentation for syntax here

I suppose these will help you and I could explain the problem to you.

发布评论

评论列表(0)

  1. 暂无评论