diff --git a/src/View/Antlers/Language/Parser/AntlersNodeParser.php b/src/View/Antlers/Language/Parser/AntlersNodeParser.php index 10291a6fc3..606c8a3c84 100644 --- a/src/View/Antlers/Language/Parser/AntlersNodeParser.php +++ b/src/View/Antlers/Language/Parser/AntlersNodeParser.php @@ -545,7 +545,7 @@ private function getParameters(AntlersNode $node) if ($hasFoundName == false && $current == DocumentParser::Punctuation_Equals) { if (! empty($currentChars)) { - if (! (ctype_alpha($currentChars[0]) || ctype_digit($currentChars[0]) || $currentChars[0] == DocumentParser::Punctuation_Colon || $currentChars[0] == DocumentParser::AtChar)) { + if (! (ctype_alpha($currentChars[0]) || ctype_digit($currentChars[0]) || $currentChars[0] == DocumentParser::Punctuation_Colon || $currentChars[0] == DocumentParser::AtChar || $currentChars[0] == DocumentParser::String_EscapeCharacter)) { $currentChars = []; continue; @@ -672,7 +672,7 @@ private function getParameters(AntlersNode $node) } } - if (Str::startsWith($name, DocumentParser::AtChar)) { + if (Str::startsWith($name, DocumentParser::String_EscapeCharacter)) { $parameterNode->containsEscapedContent = true; $name = mb_substr($name, 1); } diff --git a/src/View/Antlers/Language/Parser/DocumentParser.php b/src/View/Antlers/Language/Parser/DocumentParser.php index 4a991712a0..a387ca0d69 100644 --- a/src/View/Antlers/Language/Parser/DocumentParser.php +++ b/src/View/Antlers/Language/Parser/DocumentParser.php @@ -1057,7 +1057,7 @@ private function scanToEndOfAntlersRegion() } } - if ($this->cur == self::AtChar && ($this->prev != null && ctype_space($this->prev))) { + if ($this->cur == self::String_EscapeCharacter && ($this->prev != null && ctype_space($this->prev))) { if ($this->next != null && (ctype_alpha($this->next) || $this->next == self::Punctuation_Underscore || $this->next == self::AtChar)) { // It is possible that we might be starting some escaped content. // We will need more information to determine this, but let's diff --git a/tests/Antlers/Parser/NodeParametersTest.php b/tests/Antlers/Parser/NodeParametersTest.php index 35b924f232..c4d29e4c94 100644 --- a/tests/Antlers/Parser/NodeParametersTest.php +++ b/tests/Antlers/Parser/NodeParametersTest.php @@ -252,7 +252,7 @@ public function test_double_braces_inside_a_parameter_emits_final_literal_node_i $this->assertSame('FINAL_LITERAL', $nodes[2]->content); $template = <<<'EOT' -