Respect delimiter changes in lambda helper.

See janl/mustache.js#489
This commit is contained in:
Justin Hileman
2015-10-12 12:48:21 -07:00
parent 5353b36ec6
commit 9cc21d63f7
3 changed files with 36 additions and 5 deletions
@@ -36,4 +36,17 @@ class Mustache_Test_FiveThree_Functional_LambdaHelperTest extends PHPUnit_Framew
$this->assertEquals('Mario', $one->render($foo));
$this->assertEquals('MARIO', $two->render($foo));
}
public function testSectionLambdaHelperRespectsDelimiterChanges()
{
$tpl = $this->mustache->loadTemplate("{{=<% %>=}}\n<%# bang %><% value %><%/ bang %>");
$data = new StdClass();
$data->value = 'hello world';
$data->bang = function ($text, $mustache) {
return $mustache->render($text) . '!';
};
$this->assertEquals('hello world!', $tpl->render($data));
}
}