diff --git a/src/Install/GuidelineComposer.php b/src/Install/GuidelineComposer.php index f18f02ed..2a957af1 100644 --- a/src/Install/GuidelineComposer.php +++ b/src/Install/GuidelineComposer.php @@ -256,6 +256,8 @@ protected function renderContent(string $content, string $path): string $placeholders = [ '`' => '___SINGLE_BACKTICK___', ' '___OPEN_PHP_TAG___', + '@volt' => '___VOLT_DIRECTIVE___', + '@endvolt' => '___ENDVOLT_DIRECTIVE___', ]; $content = str_replace(array_keys($placeholders), array_values($placeholders), $content); diff --git a/tests/Feature/Install/GuidelineComposerTest.php b/tests/Feature/Install/GuidelineComposerTest.php index f381d930..5051d874 100644 --- a/tests/Feature/Install/GuidelineComposerTest.php +++ b/tests/Feature/Install/GuidelineComposerTest.php @@ -388,6 +388,7 @@ test('renderContent handles blade and markdown files correctly', function (): void { $packages = new PackageCollection([ new Package(Packages::LARAVEL, 'laravel/framework', '11.0.0'), + new Package(Packages::VOLT, 'laravel/volt', '1.0.0'), ]); $this->roster->shouldReceive('packages')->andReturn($packages); @@ -424,5 +425,10 @@ // Processes blade variables correctly ->toContain('=== .ai/test-blade-with-assist rules ===') ->toContain('Run `npm install` to install dependencies') - ->toContain('Package manager: npm'); + ->toContain('Package manager: npm') + // Preserves @volt directives in blade templates + ->toContain('`@volt`') + ->toContain('@endvolt') + ->not->toContain('volt-anonymous-fragment') + ->not->toContain('@livewire'); });