We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5526bfb commit 2c2d17bCopy full SHA for 2c2d17b
packages/view/src/ViewComponentDiscovery.php
@@ -53,7 +53,7 @@ public function discoverPath(DiscoveryLocation $location, string $path): void
53
preg_match('/(.|\n)*?<x-component name="(?<name>[\w\-]+)">/', $contents->toString(), $name);
54
$name = $name['name'] ?? null;
55
56
- $view = $contents->replaceRegex('/(.|\n)*?<x-component name="[\w\-]+">/', '')->replaceRegex('/<\/x-component>/', '')->trim()->toString();
+ $view = $contents->replaceRegex('/^(.|\n)*?<x-component name="[\w\-]+">/', '')->replaceRegex('/<\/x-component>$/', '')->trim()->toString();
57
58
if ($fileName->startsWith('x-') && $name === null) {
59
$this->discoveryItems->add($location, [
0 commit comments