Skip to content

Commit 868694e

Browse files
committed
Make each pug-js compliant
1 parent 654f6d1 commit 868694e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Phug/Compiler/EachCompiler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Phug\AbstractStatementNodeCompiler;
66
use Phug\CompilerException;
7+
use Phug\Formatter\Element\ExpressionElement;
78
use Phug\Formatter\ElementInterface;
89
use Phug\Parser\Node\EachNode;
910
use Phug\Parser\NodeInterface;
@@ -12,7 +13,7 @@ class EachCompiler extends AbstractStatementNodeCompiler
1213
{
1314
protected function compileLoop(NodeInterface $node, $items, $key, $item)
1415
{
15-
$subject = $items.' as ';
16+
$subject = $this->getCompiler()->getFormatter()->formatCode($items).' as ';
1617
if ($key) {
1718
$subject .= '$'.$key.' => ';
1819
}

0 commit comments

Comments
 (0)