diff --git a/src/fbt/Transform/FbtTransform/FbtAutoWrap.php b/src/fbt/Transform/FbtTransform/FbtAutoWrap.php index cdad110..d36c5d5 100644 --- a/src/fbt/Transform/FbtTransform/FbtAutoWrap.php +++ b/src/fbt/Transform/FbtTransform/FbtAutoWrap.php @@ -130,7 +130,7 @@ public static function createDescriptionsWithStack(string $moduleName, Node $nod { $stack[] = $node; - if ($node->children()) { + if ($node->nodes) { $filteredChildren = FbtUtils::filterEmptyNodes($node->nodes); foreach ($filteredChildren as $child) { if ($child->isElement() && FbtUtils::validateNamespacedFbtElement($moduleName, $node) === 'implicitParamMarker') { diff --git a/src/fbt/Transform/FbtTransform/Utils/GetNamespacedArgs.php b/src/fbt/Transform/FbtTransform/Utils/GetNamespacedArgs.php index 197c9e6..3d5f4bd 100644 --- a/src/fbt/Transform/FbtTransform/Utils/GetNamespacedArgs.php +++ b/src/fbt/Transform/FbtTransform/Utils/GetNamespacedArgs.php @@ -58,9 +58,7 @@ public function param(Node $node): array $node = NodeParser::parse('' . $node->innertext() . '', false, true, DEFAULT_TARGET_CHARSET, false) ->find('html', 0); - $value = FbtUtils::makeFbtElementArrayFromNode($node->children() ?: $node->nodes)[0] ?? ''; - - $value = (string)$value; + $value = implode('', FbtUtils::makeFbtElementArrayFromNode($node->nodes)); $paramArgs = [$nameAttr, $value]; diff --git a/tests/fbt/fbtTest.php b/tests/fbt/fbtTest.php index 5779dc6..063a5f7 100644 --- a/tests/fbt/fbtTest.php +++ b/tests/fbt/fbtTest.php @@ -632,6 +632,14 @@ public function testHtmlBreak() FBT; $this->assertSame('Bar
Bar
Bar', self::transform($fbt)); + + $fbt = << + Foo
Bar
Baz
+
+FBT; + + $this->assertSame('Foo
Bar
Baz', self::transform($fbt)); } public function testCheckAlreadyStoredHashes()