Open shennan opened 8 years ago
Yeah, I'm dealing with huge pink lines as well.
Another example of the syntax highlighter breaking: for loops.
I'm having this errors too =/
Same here, any suggestions where to start debugging this?
Same problem here. In my case I found this is the issue:
// This works since there's no open brackets or parentheses.
<% arr.forEach(function(item) { })%>
// This messes up all the html inside the block.
<% arr.forEach(function(item) { %>
Hope this helps debug, the lack of correct syntax highlighting is driving me crazy.
Edit: This is the same issue as in #14 .
I believe these problems are solved in the EJS 2 package that I wrote. I hope it's okay that it requires the Babel package (I needed it to support ES6).
I was having the same issue. So I removed the EJS package:
control+shift+p
remove
Package Control: Remove Package
Enter
ejs
EJS
Enter
Then I installed Babel
control+shift+p
install
Package Control: Install Package
Enter
babel
Babel
Enter
Then I installed EJS 2 (same as babel)
control+shift+p
install
Package Control: Install Package
Enter
ejs
EJS 2
Enter
Fixed! Thanks @nwoltman, this only took a couple minutes.
Glad to hear it @mattrat :smiley:
@nwoltman how did you solve this issue with your package (EJS 2)? Is the issue inherent in the fact that I’m still using a tmLanguage file instead of a sublime-syntax file?
@samholmes I'm not very familiar with tmLanguage files so I can't say for sure, but I think it should still be possible to solve as long as it lets you sort of "import" an existing syntax.
My solution was essentially these three steps:
<%
) is encountered, make JavaScript the syntax (using a clone of the Babel-JavaScript syntax file)%>
) is encountered, go back to HTMLHere's the file that has this logic: https://github.com/nwoltman/sublime-ejs/blob/master/EJS.sublime-syntax
Since I updated Sublime with the auto updater, this package has started to throw errors in valid markup.
Sublime Version: Stable Channel, Build 3103