New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Syntax highlighting in <script type="text/babel"> for HTML support #291
Comments
You might have better luck opening an issue in the sublimehq/Packages repo since it should be the Sublime HTML syntax that includes this feature. |
Can't do anything about this. What the HTML grammar decides to scope as embedded javascript is outside babel-sublime. |
I was having this issue too, this is how I fixed it (on MacOS):
For convenience, here is a gist with the modified |
@alopatin , when I copy the HTML.sublime-syntax file to that path you mentioned above, my sublime still not work ,did I miss anything ? do you have any suggestions ? |
@stanbers , I assume you came right. But just for the sake of anybody else who may be experiencing the same issue, rather save the file, |
@alopatin Thanks. Did the same with Windows! The only difference is the line is different where you need to change in HTMl.sublime-syntax:
|
I finally got it to work half-way using @alopatin 's help. However, it still doesn't work entirely. Some of the declarations are all yellow after entering some JSX code. Do I have to set a setting somewhere?? Thanx |
I have the same problem as @chavab1. EDIT:
Doesn't seem very elegant, but it got the job done I guess. My HTML looks like this now: |
@dtg5 I actually figured out that it was the ending However, after enabling this new syntax I found that the PHP syntax doesn't work anymore. I researched that and the developers just became aware of it. They suggest to disable the default PHP syntax and use their own PHP syntax. They said it's just a temporary fix and they are currently working on a permanent solution. After going through all that and then seeing your solution I'm kind of tempted to just use your solution. It's definitely much easier. Here's how my HTML looks now. |
still isn't working for me, even with the solution from @dtg5. I know the syntax file is being loaded because it's parsing the 'text/babel' tag, but it's parsing it as plain javascript. Can anybody provide the sublime-syntax file that is working for them (Windows, Sublime Text 3)? Thanks |
It looks like you're still having the problem with the '/' sign. Another solution was making revisions to the main HTML syntax as @dtg5 discovered. I've attached the file that I'm using with @dtg5's fix and it's working. I'm using the babel package as well. |
@chavab1 oh nice, that HTML sublime syntax file works for me, thanks! And I'll have to check out the Naomi syntax package as well, seems like a good alternative instead of manually overriding my HTML syntax file |
Summary
It would be nice, if in
JavaScript (Babel)
syntax will be added support syntax highlighting for Babel in tag<script></script>
for HTML.Expected behavior
In separate file.
Actual behavior
In HTML.
Steps to reproduce
In open HTML file I have script:
Script not highlight for me. I get scope for each place of this script:
source.js meta.jsx.js
I get each time.Environment
Sublime Text:
Build 3126
Syntax:
JavaScript (Babel) into Babel plugin
Color scheme:
Monokai Phoenix into Babel plugin
Thanks.
The text was updated successfully, but these errors were encountered: