Skip to content

Commit 751a29b

Browse files
committed
wip
1 parent 89ecae3 commit 751a29b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/view/src/ViewComponentDiscovery.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ public function discoverPath(DiscoveryLocation $location, string $path): void
5151

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

0 commit comments

Comments
 (0)