Skip to content
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

ID attribute not highlighted if it comes first in script tag #58

Open
dflock opened this issue May 7, 2015 · 1 comment
Open

ID attribute not highlighted if it comes first in script tag #58

dflock opened this issue May 7, 2015 · 1 comment

Comments

@dflock
Copy link

dflock commented May 7, 2015

This code, with the id attribute first, doesn't highlight properly:

<script id="data_categories" type="text/x-handlebars-template">

but it does if you swap the id and type attributes around, eg:

screenshot - 15-05-06 - 05 10 31 pm

@daaain
Copy link
Owner

daaain commented May 9, 2015

Right, I had a dig and this is a side effect of handling these different text/template script types and recognising the Handlebars templates inside them (rather than just treating them as generic script). So basically whatever is between the script tag name and the type attribute gets picked up as the beginning of the capture group.

I'm not really sure how to work around this :( if you have some time to play around with it the overly greedy regex is in this line: https://github.com/daaain/Handlebars/blob/master/Handlebars.JSON-tmLanguage#L597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants