mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
don't eat up backslashes. fixes #59
This commit is contained in:
parent
97201fe861
commit
d719bd12ca
@ -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) {
|
||||
|
@ -137,6 +137,11 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
|
||||
array('data' => 'foo'),
|
||||
'{{{data}}}'
|
||||
),
|
||||
array(
|
||||
'\pi',
|
||||
array(),
|
||||
'\pi'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user