Skip to content

Commit 3bf357e

Browse files
authored
Merge pull request #30 from tronsha/bugfix/key-attribute-return
Bugfix/key attribute return
2 parents 4328934 + b81d261 commit 3bf357e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Compiler.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function convert(): string
120120
$html = $this->addVariableBlocks($html);
121121
$html = $this->replacePlaceholders($html);
122122

123-
$html = trim(preg_replace('/\<template\>(.*)\<\/template\>/ism', '$1', $html));
123+
$html = preg_replace('/\<template\>\s*(.*?)\s*\<\/template\>/ism', '$1', $html);
124124

125125
if ($this->stripWhitespace) {
126126
$html = $this->stripWhitespace($html);
@@ -307,10 +307,11 @@ private function handleAttributeBinding(DOMElement $node)
307307
$this->logger->debug('- remove original ' . $attribute->name);
308308
$node->removeAttribute($attribute->name);
309309

310+
if ($name === 'key') {
311+
continue;
312+
}
313+
310314
switch ($name) {
311-
case 'key':
312-
// Not necessary in twig
313-
return;
314315
case 'style':
315316
break;
316317
case 'class':

0 commit comments

Comments
 (0)