diff --git a/latte/src/Latte/Macros/BlockMacros.php b/latte/src/Latte/Macros/BlockMacros.php index abb72965366..57976aea590 100644 --- a/latte/src/Latte/Macros/BlockMacros.php +++ b/latte/src/Latte/Macros/BlockMacros.php @@ -229,6 +229,10 @@ public function macroBlock(MacroNode $node, PhpWriter $writer) } elseif (strpos($name, '$') !== false) { // dynamic block/snippet if ($node->name === 'snippet') { + if ($node->prefix && isset($node->htmlNode->attrs[$this->snippetAttribute])) { + throw new CompileException("Cannot combine HTML attribute $this->snippetAttribute with n:snippet."); + } + for ( $parent = $node->parentNode; $parent && !($parent->name === 'snippet' || $parent->name === 'snippetArea');