Closed jceipek closed 1 year ago
I could fix this on my end, but I'm wondering if I should. If you're writing ES6 code you probably should have an ES6 plugin, like Babel, in which case you won't have that problem. On the other hand, if I fix it on my end you'll loose ES6 highlighting if you do use a plugin, like this:
If you use Babel:
and if I fix it on my end:
As far as I can tell, pug uses the node.js javascript engine, which has supported template literals for a long time (see http://node.green/#template-literals).
I would be fine using an ES2015 (ES6) plugin; in fact I have https://github.com/babel/babel-sublime installed right now. I could be missing something obvious, but I'm not sure how to "stack" the syntax highlighting for Pug and ES2015 in Sublime Text without manually editing tmbundle
s. Is that possible?
I was indeed talking about the editor, not the interpreter. tmbundle highlighters can reference one another, I reference the javascript highlighter when I detect a javascript code block. I also have babel-sublime installed and for some reason in my editor it automatically replace the default javascript bundle when another bundle includes javascript. I'll have to investigate why that happens here.
That's interesting. There's two immediate things I can think of that might be the culprit:
README
mentions that you use v 2, right?)
Pug no longer supports interpolation inside attributes using the hash brace syntax
"#{ }"
. It does support ES2015 template literals${ }
(see https://github.com/pugjs/pug/issues/2346).However, the syntax definition in
pug-tmbundle
breaks when these literals include//
, which shows up near the start of URI schemes likehttp
,file
, etc...Here's an example usecase:
Everything from the
//
onwards on the same line gets treated as a comment and the remainder of the file stops syntax highlighting properly.