Skip to content

Commit ed56981

Browse files
committed
Use the dedicated CommentElement class for comments
1 parent 260c8f2 commit ed56981

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Phug/Compiler/CommentCompiler.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Phug\AbstractNodeCompiler;
66
use Phug\CompilerException;
7-
use Phug\Formatter\Element\TextElement;
7+
use Phug\Formatter\Element\CommentElement;
88
use Phug\Formatter\ElementInterface;
99
use Phug\Parser\Node\CommentNode;
1010
use Phug\Parser\NodeInterface;
@@ -19,12 +19,13 @@ public function compileNode(NodeInterface $node, ElementInterface $parent = null
1919
);
2020
}
2121

22+
/** @var CommentNode $node */
2223
if (!$node->isVisible()) {
2324
return null;
2425
}
2526

2627
$comment = $this->getTextChildren($node);
2728

28-
return new TextElement('<!-- '.$comment.' -->');
29+
return new CommentElement($comment);
2930
}
3031
}

0 commit comments

Comments
 (0)