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

add current context only search for mustache #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add current context only search for mustache #226

wants to merge 1 commit into from

Conversation

RocHo
Copy link

@RocHo RocHo commented Jun 28, 2012

This feature solves my project problem about using recursive template.Both parent node and child nodes has same property name ,when child node does not have that property(or null value),template will search parent property,this cause a recursive reference problem. Use ".children" to force search only with current context,not continue searching parent context.

@dasilvacontin
Copy link
Collaborator

What about variable clashing with other children keys?

@bobthecow
Copy link

@dasilvacontin It isn't blessing a children key, this is actually an implementation of mustache/spec#52

@dasilvacontin
Copy link
Collaborator

@bobthecow, oh, I see. This totally makes sense. Sorry for the confusion, I was going through a lot of old issues.

We still don't have this in mustache.js then? I have to check.

@dasilvacontin dasilvacontin reopened this Dec 20, 2014
@dasilvacontin
Copy link
Collaborator

I'll investigate if this is a breaking change or not, to know if it will be incorporated in v1 or in a posterior version.

@bobthecow
Copy link

It's mostly not a breaking change, but it's also not in the spec. That issue I linked weighs both sides of that. Mustache.php hasn't shipped it (yet) because it's technically not spec compliant (see bobthecow/mustache.php#129).

That said, any spec-compliant Mustache implementation would render {{.foo}} as an empty string, since there's no way that context lookup works. So it shouldn't be a backwards compatibility break, as no user would be using tags like this in the wild.

@dasilvacontin
Copy link
Collaborator

This will need a Chore issue for discussing, then. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants