vscode-blade-formatter icon indicating copy to clipboard operation
vscode-blade-formatter copied to clipboard

[Formatting Bug]: Laravel Blade anonymous component attributes are being formatted to use single quote when use blade directive

Open thanhhungtn1 opened this issue 5 months ago • 1 comments

Platform

Windows

Template before formatting

<x-floating_input placeholder="{{ __('SKU') }}"
    fieldName="variants[{{ $index }}][sku]" title="{{ __('SKU') }}"
    iconClass="ti-barcode"
    fieldErrorMessage='{{ $errors->first("variants.$index.sku") }}'
    fieldValue='{{ old("variants.$index.sku", "") }}' 
/>

Template after formatting

<x-floating_input placeholder="{{ __('SKU') }}"
    fieldName="variants[{{ $index }}][sku]" title="{{ __('SKU') }}"
    iconClass="ti-barcode"
    fieldErrorMessage='{{ $errors->first("variants.$index.sku") }}'
    fieldValue='{{ old("variants.$index.sku", '') }}' 
/>

Expected Behaviour

As you can see when I pass the fieldValue in the double quote " automatically changed to ' causing the component cannot be rendered. It should remains the double quote for empty check passed in. I'm not sure it's conflicting with other plugins or the plugin itself bug.

Relevant log output

No response

thanhhungtn1 avatar Sep 18 '24 22:09 thanhhungtn1