Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/View/Antlers/Language/Parser/DocumentParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@ private function scanToEndOfDirective()
$this->nodes[] = $node;
$this->lastAntlersNode = $node;
$this->startIndex = $this->currentIndex;
$this->currentIndex += 1;
}

private function advanceWhitespace()
Expand Down
19 changes: 19 additions & 0 deletions tests/Antlers/Parser/DirectivesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,23 @@ public function test_directives_args_must_be_finished()

$this->renderString('@props ("this isnt()", "done!"');
}

public function test_directives_dont_leave_extra_parenthesis()
{
$template = <<<'EOT'
@props([

])a

Hellow
EOT;

$expected = <<<'EOT'
a

Hellow
EOT;

$this->assertSame($expected, $this->renderString($template));
}
}