Skip to content

Commit 6938476

Browse files
committed
temp
1 parent 703cfd4 commit 6938476

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Parser.php

+6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ protected static function getExpression(string $v, Context $context, int|string
8484
if (preg_match('/^\\\\\'(.*)\\\\\'$/', $v, $matched)) {
8585
return static::getLiteral($matched[1], $asis, true);
8686
}
87+
/*if (preg_match("/^'(.*)'$/", $v, $matched)) {
88+
$name = preg_replace("/^\\\\\\\\'/", "'", $matched[1]);
89+
$name = preg_replace("/([^\\\\])\\\\\\\\'/", "$1'", $name);
90+
return static::getLiteral($name, $asis, true);
91+
}*/
8792

8893
// handle bool, null and undefined
8994
if (preg_match('/^(true|false|null|undefined)$/', $v)) {
@@ -251,6 +256,7 @@ protected static function advancedVariable(array $vars, Context $context, string
251256
}
252257

253258
if (!preg_match("/^(\"|\\\\')(.*)(\"|\\\\')$/", $var)) {
259+
//if (!preg_match("/^([\"'])(.*)([\"'])$/", $var)) {
254260
// foo] Rule 1: no starting [ or [ not start from head
255261
if (preg_match('/^[^\\[.]+[\\[\\]]/', $var)
256262
// [bar Rule 2: no ending ] or ] not in the end

test2.php

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
require 'vendor/autoload.php';
66

77
$templateString = '{{test "\"\"\"" prop="\"\"\""}}';
8+
$templateString = "{{test '\'\'\'' prop='\'\'\''}}";
89

910
$template = Handlebars::compile($templateString, new Options(
1011
helpers: [

0 commit comments

Comments
 (0)