From 26b720f870478b2808e893cfa21d6493550f5187 Mon Sep 17 00:00:00 2001 From: Mitchell Bosecke Date: Sat, 22 Feb 2014 13:59:49 -0700 Subject: [PATCH] Fixed issue with dynamic inheritance --- src/main/java/com/mitchellbosecke/pebble/node/NodeRoot.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/mitchellbosecke/pebble/node/NodeRoot.java b/src/main/java/com/mitchellbosecke/pebble/node/NodeRoot.java index 5ec58a923..47c5c142b 100644 --- a/src/main/java/com/mitchellbosecke/pebble/node/NodeRoot.java +++ b/src/main/java/com/mitchellbosecke/pebble/node/NodeRoot.java @@ -136,8 +136,9 @@ private void compileBuildContentFunction(Compiler compiler) { getBody().compile(compiler, true); compiler.write("context.pushInheritanceChain(this);").newline(); compiler.write("getParent().buildContent(writer, context);").newline().outdent(); - compiler.write("} else {").newline(); - compiler.subcompile(getBody()).newline(); + compiler.write("context.popInheritanceChain();").newline(); + compiler.write("} else {").newline().indent(); + compiler.subcompile(getBody()).newline().outdent(); compiler.write("}").newline(); } else {