Skip to content

Commit 3af0a70

Browse files
committed
Support dotted notation on namespaced components
1 parent 145bd4e commit 3af0a70

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Languages/Blade/Patterns/BladeComponentCloseTagPattern.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
use Tempest\Highlight\PatternTest;
1010
use Tempest\Highlight\Tokens\TokenTypeEnum;
1111

12+
#[PatternTest(input: '</a>', output: 'a')]
1213
#[PatternTest(input: '</x-hello>', output: 'x-hello')]
1314
#[PatternTest(input: '</x-hello::world>', output: 'x-hello::world')]
14-
#[PatternTest(input: '</a>', output: 'a')]
15+
#[PatternTest(input: '</x-hello::world.lorem>', output: 'x-hello::world.lorem')]
1516
final readonly class BladeComponentCloseTagPattern implements Pattern
1617
{
1718
use IsPattern;
1819

1920
public function getPattern(): string
2021
{
21-
return '<\/(?<match>[\w\-\:]+)';
22+
return '<\/(?<match>[\w\-\:\.]+)';
2223
}
2324

2425
public function getTokenType(): TokenTypeEnum

src/Languages/Blade/Patterns/BladeComponentOpenTagPattern.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
use Tempest\Highlight\PatternTest;
1010
use Tempest\Highlight\Tokens\TokenTypeEnum;
1111

12+
#[PatternTest(input: '<a attr="">', output: 'a')]
1213
#[PatternTest(input: '<x-hello attr="">', output: 'x-hello')]
1314
#[PatternTest(input: '<x-hello::world attr="">', output: 'x-hello::world')]
14-
#[PatternTest(input: '<a attr="">', output: 'a')]
15+
#[PatternTest(input: '<x-hello::world.lorem attr="">', output: 'x-hello::world.lorem')]
1516
final readonly class BladeComponentOpenTagPattern implements Pattern
1617
{
1718
use IsPattern;
1819

1920
public function getPattern(): string
2021
{
21-
return '<(?<match>[\w\-\:]+)';
22+
return '<(?<match>[\w\-\:\.]+)';
2223
}
2324

2425
public function getTokenType(): TokenTypeEnum

0 commit comments

Comments
 (0)