don't eat up backslashes. fixes #59

This commit is contained in:
behrooz shabani (everplays) 2014-03-21 02:39:59 +03:30
parent 97201fe861
commit d719bd12ca
2 changed files with 9 additions and 0 deletions

View File

@ -127,6 +127,10 @@ class Tokenizer
$this->escaping = $this->tagChange(self::T_ESCAPE, $text, $i);
if ( $this->escaped and $text[$i + 1] != self::T_UNESCAPED ) {
$this->buffer .= "\\";
}
switch ($this->state) {
case self::IN_TEXT:
if ($this->tagChange(self::T_UNESCAPED.$this->otag, $text, $i) and $this->escaped) {

View File

@ -137,6 +137,11 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
array('data' => 'foo'),
'{{{data}}}'
),
array(
'\pi',
array(),
'\pi'
),
);
}