Merge branch 'fix/template-inheritance-whitespace' into dev

This commit is contained in:
Justin Hileman
2015-03-31 23:24:25 -07:00
2 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -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;
';
@@ -286,6 +286,29 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
);
}
public function testInheritSpacingWhenOverridingAPartial()
{
$partials = array(
'parent' => 'collaborate_and{{$id}}{{/id}}',
'child' => '{{<parent}}{{$id}}_listen{{/id}}{{/parent}}',
);
$this->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(