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

allow reserved words in tags e.g. {{class}} #385

Merged
merged 2 commits into from
Mar 18, 2017
Merged

allow reserved words in tags e.g. {{class}} #385

merged 2 commits into from
Mar 18, 2017

Conversation

Rich-Harris
Copy link
Member

Fixes #383. Are we comfortable with this change? It allows class="{{class}}" which is helpful, but it wouldn't allow e.g. class="{{class + ' other class'}}" since that's a full-blown expression that Acorn would refuse to parse.

I think that's probably okay, but if anyone has objections raise them now...

@Conduitry
Copy link
Member

Yeah I think this is a reasonable compromise. It's a bit of a weird case, but this behavior would probably make some people's lives easier, and it seems unlikely to confuse additional people.

One weird edge case I did think of was something like {{Array}} or any of the other special whitelisted globals. But, it looks like that's getting handled correctly still! So LGTM.

@PaulBGD
Copy link
Member

PaulBGD commented Mar 17, 2017

Does <elem :class/> work?

@Conduitry
Copy link
Member

@PaulBGD That actually works right now without this change. The new shorthand attribute notation doesn't try to parse anything with Acorn so they're fine.

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

Successfully merging this pull request may close these issues.

3 participants