daaain / Handlebars

Fullest Handlebars.js templating support for Sublime Text 2 / 3. Also drives syntax colouring on Github and in Visual Studio Code. Install from: https://packagecontrol.io/packages/Handlebars.
MIT License
301 stars 48 forks source link

Syntax highlighting is broken when Ember's bind-attr helper is used #29

Closed dunnkers closed 10 years ago

dunnkers commented 10 years ago

When using the bind-attr helper from ember.js, all syntax highlighting is broken.

Notice that when the boolean attributes are removed or quoted the highlighting works again, the quotes are not supported for this helper however. (In the image for example href=link)

image

ember.js bind-attr guide reference.

daaain commented 10 years ago

Thanks for reporting, just added some tests around it: https://github.com/daaain/Handlebars/commit/666b49c288988341b91ddc0ddec29d2556aae377

Not sure when will I get around to fix it, if you have the inclination a PR would be welcome :)

jacquescrocker commented 10 years ago

this one's killing me as well. dug into the code a bit but couldnt figure out how to fix it :P

utkarshkukreti commented 10 years ago

@dunnkers @railsjedi does this work for you https://github.com/utkarshkukreti/Handlebars/tree/fix-syntax-highlighting-of-unquoted-attributes? (I'll send a pull request then.)

dunnkers commented 10 years ago

Good work @utkarshkukreti, I haven't set up the package locally for testing / development however. Did you run the tests to see if the test @daaain wrote (666b49c) now passes?

utkarshkukreti commented 10 years ago

By "run the tests" you mean manually had a look how the html file renders in Handlebars syntax or something else?

dunnkers commented 10 years ago

Yeah that's what I meant :+1:

utkarshkukreti commented 10 years ago

Then yes, it seems to work fine with the code @daaain added, and it doesn't look like it broke any existing highlighting.

jacquescrocker commented 10 years ago

yes, it works great!! +1 on pull request

thank you so much @utkarshkukreti

daaain commented 10 years ago

Thanks a lot @utkarshkukreti, you're a hero :crown:

jacquescrocker commented 10 years ago

@utkarshkukreti you should claim the bounty i put on this bug fix https://www.bountysource.com/issues/1439338/claims thanks again!

daaain commented 10 years ago

Oh and on the note of testing, if any of you run into something more sophisticated than "optical comparison" please let me know! Would love to have some sort of automation instead of these crude syntax feature example files...

utkarshkukreti commented 10 years ago

@railsjedi thanks :)

@daaain yep, that would be really useful.