premasagar / tim

A tiny, secure JavaScript micro-templating script.
251 stars 26 forks source link

Add Dollar-Sign to path #14

Closed mdix closed 11 years ago

mdix commented 11 years ago

You should consider adding the dollar sign to

path = "[a-z0-9_][\\.a-z0-9_]*", // e.g. config.person.name like path = "[a-z0-9_$][\\.a-z0-9_$]*", // e.g. config.person.name

because, for instance youtube, returns something like this:

{feed:{entry: [{id:{$t: 'just a test'}, title:{$t: 'just the title'}}]}};

which cannot be parsed by tinytim like we'd expect:

{{feed.entry.0.title.$t}}

Thanks for your trouble and kind regards Marc

premasagar commented 11 years ago

Thanks for this, @mdix. Fixed in 812bca6477188f117b65e515267eeefec6dbdc5f