Skip to content

Commit

Permalink
Fix custom tags configuration effect
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgiopogliani committed Apr 9, 2022
1 parent c2eab35 commit b37cdd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ public function setup()
{
$this->twig->addExtension(new ComponentExtension($this));

$this->twig->setLexer(new ComponentLexer($this->twig));
if ($this->isUsingCustomTags()) {
$this->twig->setLexer(new ComponentLexer($this->twig));
}

/** @var \Twig\Extension\EscaperExtension */
$escaper = $this->twig->getExtension(\Twig\Extension\EscaperExtension::class);
Expand Down
3 changes: 2 additions & 1 deletion tests/ComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ protected function setupTwig(): \Twig\Environment
Configuration::make($twig)
->setTemplatesPath('components')
->setTemplatesExtension('twig')
->useGlobalContext(false)
->useGlobalContext()
->useCustomTags()
->setup();

return $twig;
Expand Down

0 comments on commit b37cdd5

Please sign in to comment.