Skip to content

Conversation

bpierre
Copy link

@bpierre bpierre commented May 9, 2014

Just a suggestion for #253, don’t hesitate to close it if it does not fit your vision.

The compiler now replaces every : in an attribute name to escape it: \:.

If a directive name contains an escaped colon (\:), it won’t be considered as a separator.

The compiler now replaces every `:` in an attribute name to escape it `\:`. If a directive name contains an escaped colon (`\:`), it won’t be considered as a separator.
@yyx990803
Copy link
Member

Thanks for the PR Pierre, but I think there could be a simpler fix.

@bpierre
Copy link
Author

bpierre commented May 15, 2014

Great! I think there is still two changes that could be interesting though:

1/ I think there is no reason to repeat str.slice(begin, i).trim() here, it’s already in arg:
bpierre@250969a#diff-c4447b04d8f41855d00d9e821c25ed7cL165

2/ Caching attr.name could be a small improvement here [1]:
bpierre@250969a#diff-b0b85d67c2201828828422795fb44581R533

[1] Benchmark: http://jsperf.com/attribute-name/

@bpierre bpierre closed this May 15, 2014
@yyx990803
Copy link
Member

Yeah these two changes make sense. If you move them into a separate PR I can merge it.

bpierre added a commit to bpierre/vue that referenced this pull request May 15, 2014
According to the discussion in vuejs#262
@bpierre bpierre mentioned this pull request May 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants