When nesting for non-list contexts, inherit list info.
This ensures that if you enter a conditional block while inside a list
block, the list "state" from the outer list will still be visible. For
example (somewhat contrived, but gets the point across):
{{#list}}
{{#name}}{{-index}}. {{.}}{{/name}}
{{^name}}{{-index}}. No name!{{/name}}
{{/list}}
Yields something like:
1. Bob
2. Mary
3. No name!
4. Jim
Fixes #90.
This commit is contained in:
@@ -878,7 +878,7 @@ public class Mustache
|
||||
} else if (_comp.isFalsey(value)) {
|
||||
// omit the section
|
||||
} else {
|
||||
executeSegs(tmpl, ctx.nest(value, 0, false, false), out);
|
||||
executeSegs(tmpl, ctx.nest(value), out);
|
||||
}
|
||||
}
|
||||
@Override public void decompile (Delims delims, StringBuilder into) {
|
||||
|
||||
Reference in New Issue
Block a user