diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index 165a1a0..e25bd8c 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -263,7 +263,7 @@ class Mustache_Compiler const BLOCK_ARG = ' // %s block_arg - $value = $this->section%s($context, $indent, true); + $value = $this->section%s($context, \'\', true); $newContext[%s] = %s$value; '; diff --git a/test/Mustache/Test/Functional/InheritanceTest.php b/test/Mustache/Test/Functional/InheritanceTest.php index 730dd96..122ed31 100644 --- a/test/Mustache/Test/Functional/InheritanceTest.php +++ b/test/Mustache/Test/Functional/InheritanceTest.php @@ -286,6 +286,29 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas ); } + public function testInheritSpacingWhenOverridingAPartial() + { + $partials = array( + 'parent' => 'collaborate_and{{$id}}{{/id}}', + 'child' => '{{mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + 'stop: + {{>child}}' + ); + + $data = array(); + + $this->assertEquals( + 'stop: + collaborate_and_listen', + $tpl->render($data) + ); + } + public function testOverrideOneSubstitutionButNotTheOther() { $partials = array(