diff --git a/src/Compiler.php b/src/Compiler.php index 6b8c33d..2077dc2 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -182,11 +182,16 @@ public function convertNode(DOMNode $node, int $level = 0): DOMNode } } + foreach (iterator_to_array($node->childNodes) as $childNode) { + $this->convertNode($childNode, $level + 1); + } + /* * Slots (Default) */ if ($node->hasChildNodes()) { $innerHtml = $this->innerHtmlOfNode($node); + $innerHtml = $this->replacePlaceholders($innerHtml); $this->logger->debug('Add default slot:', [ 'nodeValue' => $node->nodeValue, 'innerHtml' => $innerHtml, diff --git a/tests/fixtures/vue-slot/include-child-component-with-default-slot.twig b/tests/fixtures/vue-slot/include-child-component-with-default-slot.twig index 85c1e8f..fb07fd7 100644 --- a/tests/fixtures/vue-slot/include-child-component-with-default-slot.twig +++ b/tests/fixtures/vue-slot/include-child-component-with-default-slot.twig @@ -1,7 +1,9 @@
some text
+ {% if true %} +some text
+ {% endif %} {% endset %} {% include "/templates/ChildComponent.twig" with { 'slot_default': slot_default_value, 'class': "" } %}some text
+some text