groue / GRMustache

Flexible and production-ready Mustache templates for MacOS Cocoa and iOS
http://mustache.github.com/
MIT License
1.44k stars 190 forks source link

NSNumber treated as context for rendering blocks #83

Closed robinkunde closed 10 years ago

robinkunde commented 10 years ago

In 7.2 the following data and template don't work the same way as in 7.1:

data =@[
  @{
    @"name": @"name", 
    @"isSubscribed": [NSNumber numberWithBool:YES], 
    @"actionUrl": @"http://"
  }
]
{{#data}}
  {{#.isSubscribed}}
    <a href="{{{.actionUrl}}}" class="style1">{{.name}}</a>
  {{^}}
    <a href="{{{.actionUrl}}}" class="style2">{{.name}}</a>
  {{/}}
{{/data}}

In 7.2, actionUrl and name come back blank, unless I remove the dot in front.

groue commented 10 years ago

Hi @sapheriel. This is clearly a regression. Let me look for a fix. Can you use 7.1 until a fix is shipped?

groue commented 10 years ago

There is another compatibility issue (#82).

I advise you to keep using GRMustache v7.1.0. GRMustache v7.2.0 will be flagged as a rotten version. Sorry for the inconvenience.

groue commented 10 years ago

@sapheriel Thanks a lot for noticing this issue.

groue commented 10 years ago

Fixed by v7.3.0

robinkunde commented 10 years ago

Glad I could help.