mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-05-03 10:33:08 +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);
|
$this->escaping = $this->tagChange(self::T_ESCAPE, $text, $i);
|
||||||
|
|
||||||
|
if ( $this->escaped and $text[$i + 1] != self::T_UNESCAPED ) {
|
||||||
|
$this->buffer .= "\\";
|
||||||
|
}
|
||||||
|
|
||||||
switch ($this->state) {
|
switch ($this->state) {
|
||||||
case self::IN_TEXT:
|
case self::IN_TEXT:
|
||||||
if ($this->tagChange(self::T_UNESCAPED.$this->otag, $text, $i) and $this->escaped) {
|
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'),
|
array('data' => 'foo'),
|
||||||
'{{{data}}}'
|
'{{{data}}}'
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'\pi',
|
||||||
|
array(),
|
||||||
|
'\pi'
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user