Skip to content

Commit 49f0e6b

Browse files
committed
wip
1 parent f8d4c1d commit 49f0e6b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/view/src/ViewComponentDiscovery.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,14 @@ public function discoverPath(DiscoveryLocation $location, string $path): void
5151

5252
if (isset($matches['name'])) {
5353
$view = $contents
54-
->replaceRegex('/^(?<header>(.|\n)*?)<x-component.*>/', function (array $matches): string {
55-
return $matches['header'] ?? '';
56-
})
54+
->replaceRegex('/^(.|\n)*?<x-component.*>/', '')
5755
->replaceRegex('/<\/x-component>$/', '')
5856
->toString();
5957
} else {
6058
$view = $contents->toString();
6159
}
6260

63-
if ($fileName->startsWith('x-')) {
61+
if ($fileName->startsWith('x-') && ! isset($matches['name'])) {
6462
$this->discoveryItems->add($location, [
6563
$fileName->toString(),
6664
new AnonymousViewComponent(

0 commit comments

Comments
 (0)