mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
Merge pull request #163 from mAAdhaTTah/bugfix/mustache-compatibility
Add failing test for Mustache-style `if` blocks
This commit is contained in:
commit
b85cee07ea
@ -87,6 +87,8 @@ class Parser
|
||||
|
||||
if (!array_key_exists(Tokenizer::NODES, $result)
|
||||
&& isset($result[Tokenizer::NAME])
|
||||
&& ($result[Tokenizer::TYPE] == Tokenizer::T_SECTION
|
||||
|| $result[Tokenizer::TYPE] == Tokenizer::T_INVERTED)
|
||||
&& $result[Tokenizer::NAME] == $token[Tokenizer::NAME]
|
||||
) {
|
||||
if (isset($result[Tokenizer::TRIM_RIGHT])
|
||||
|
@ -177,6 +177,11 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
|
||||
array('first' => false, 'second' => true),
|
||||
'The second'
|
||||
),
|
||||
array(
|
||||
'{{#value}}Hello {{value}}, from {{parent_context}}{{/value}}',
|
||||
array('value' => 'string', 'parent_context' => 'parent string'),
|
||||
'Hello string, from parent string'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user