Skip to content
Permalink
Browse files

MacroSet: skips n:attr when $node is empty

  • Loading branch information
dg committed Jan 8, 2020
1 parent 76f4973 commit 3f92a906105113794cceb12ebe0bdbc25fdec9c8
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Latte/Macros/MacroSet.php
@@ -107,9 +107,12 @@ public function nodeOpened(MacroNode $node)
}
$node->context[1] = Latte\Compiler::CONTEXT_HTML_TEXT;

} elseif ($node->empty && $node->prefix) {
return false;

} elseif ($begin) {
$res = $this->compile($node, $begin);
if ($res === false || ($node->empty && $node->prefix)) {
if ($res === false) {
return false;
} elseif (!$node->openingCode && is_string($res) && $res !== '') {
$node->openingCode = "<?php $res ?>";

0 comments on commit 3f92a90

Please sign in to comment.
You can’t perform that action at this time.