shufo / vscode-blade-formatter

An opinionated Blade file formatter for VSCode

Home Page:https://marketplace.visualstudio.com/items?itemName=shufo.vscode-blade-formatter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Formatting Bug]:

kudratov25 opened this issue · comments

Platform

Windows

Template before formatting

<div class="form-group">
        <label for="description">Define project scale</label><br/>
        <label class="radio-inline"><input type="radio" wire:model="scope" value="smal" {{{ $scope == 'small' ? "checked" : "" }}}> Small</label>
        <label class="radio-inline"><input type="radio" wire:model="scope" value="medium" {{{ $scope == 'medium' ? "checked" : "" }}}> Medium</label>
        <label class="radio-inline"><input type="radio" wire:model="scope" value="large" {{{ $scope == 'large' ? "checked" : "" }}}> Large</label>
        @error('scope') <span class="error">{{ $message }}</span> @enderror
    </div>

Template after formatting

<div class="form-group">
        <label for="description">Define project scale</label><br/>
        <label class="radio-inline"><input type="radio" wire:model="scope" value="smal" {{{ $scope == 'small' ? "checked" : "" }}}> Small</label>
        <label class="radio-inline"><input type="radio" wire:model="scope" value="medium" {{{ $scope == 'medium' ? "checked" : "" }}}> Medium</label>
        <label class="radio-inline"><input type="radio" wire:model="scope" value="large" {{{ $scope == 'large' ? "checked" : "" }}}> Large</label>
        @error('scope') <span class="error">{{ $message }}</span> @enderror
    </div>

Expected Behaviour

image

Relevant log output

Parse Error : syntax error, unexpected '{' on line 1 > 1 | <?php echo { $scope == 'small' ? "checked" : "" ?> | ^

This seems wrong syntax

{{{ $scope == 'small' ? "checked" : "" }}}

It should be double curly brackets

{{ $scope == 'small' ? "checked" : "" }}

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days