mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 23:18:10 +00:00
fix: skip view wrapper when importing blade recipes
Some checks are pending
tests / ci (push) Waiting to run
Some checks are pending
tests / ci (push) Waiting to run
This commit is contained in:
parent
e443539357
commit
6ae3e023d4
2 changed files with 5 additions and 5 deletions
|
|
@ -68,12 +68,11 @@ class PluginImportService
|
||||||
$fullLiquid = $sharedLiquid."\n".$fullLiquid;
|
$fullLiquid = $sharedLiquid."\n".$fullLiquid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fullLiquid = '<div class="view view--{{ size }}">'."\n".$fullLiquid."\n".'</div>';
|
|
||||||
|
|
||||||
// Check if the file ends with .liquid to set markup language
|
// Check if the file ends with .liquid to set markup language
|
||||||
$markupLanguage = 'blade';
|
$markupLanguage = 'blade';
|
||||||
if (pathinfo((string) $filePaths['fullLiquidPath'], PATHINFO_EXTENSION) === 'liquid') {
|
if (pathinfo((string) $filePaths['fullLiquidPath'], PATHINFO_EXTENSION) === 'liquid') {
|
||||||
$markupLanguage = 'liquid';
|
$markupLanguage = 'liquid';
|
||||||
|
$fullLiquid = '<div class="view view--{{ size }}">'."\n".$fullLiquid."\n".'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure custom_fields is properly formatted
|
// Ensure custom_fields is properly formatted
|
||||||
|
|
@ -193,12 +192,11 @@ class PluginImportService
|
||||||
$fullLiquid = $sharedLiquid."\n".$fullLiquid;
|
$fullLiquid = $sharedLiquid."\n".$fullLiquid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fullLiquid = '<div class="view view--{{ size }}">'."\n".$fullLiquid."\n".'</div>';
|
|
||||||
|
|
||||||
// Check if the file ends with .liquid to set markup language
|
// Check if the file ends with .liquid to set markup language
|
||||||
$markupLanguage = 'blade';
|
$markupLanguage = 'blade';
|
||||||
if (pathinfo((string) $filePaths['fullLiquidPath'], PATHINFO_EXTENSION) === 'liquid') {
|
if (pathinfo((string) $filePaths['fullLiquidPath'], PATHINFO_EXTENSION) === 'liquid') {
|
||||||
$markupLanguage = 'liquid';
|
$markupLanguage = 'liquid';
|
||||||
|
$fullLiquid = '<div class="view view--{{ size }}">'."\n".$fullLiquid."\n".'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure custom_fields is properly formatted
|
// Ensure custom_fields is properly formatted
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,9 @@ it('handles blade markup language correctly', function (): void {
|
||||||
$pluginImportService = new PluginImportService();
|
$pluginImportService = new PluginImportService();
|
||||||
$plugin = $pluginImportService->importFromZip($zipFile, $user);
|
$plugin = $pluginImportService->importFromZip($zipFile, $user);
|
||||||
|
|
||||||
expect($plugin->markup_language)->toBe('blade');
|
expect($plugin->markup_language)->toBe('blade')
|
||||||
|
->and($plugin->render_markup)->not->toContain('<div class="view view--{{ size }}">')
|
||||||
|
->and($plugin->render_markup)->toBe('<div>Blade template</div>');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('imports plugin from monorepo with zip_entry_path parameter', function (): void {
|
it('imports plugin from monorepo with zip_entry_path parameter', function (): void {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue