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

[Formatting Bug]: Incorrect formatting when using `textarea`

Open KarimElsayad247 opened this issue 1 year ago • 0 comments

Platform

Linux

Template before formatting

<textarea class="elm"
  name="inner_group[{{ $i }}][{{ $c->attribute }}{{ $j }}]"
>
  @if (explode('|', $values) != null && isset(explode('|', $values)[$j - 1]))
    {{ explode('|', $values)[$j - 1] }}
  @endif
</textarea>

Template after formatting

<textarea class="elm"
  name="inner_group[{{ $i }}][{{ $c->attribute }}{{ $j }}]"
>
  @if (explode('|', $values) != null && isset(explode('|', $values)[$j - 1]))
{{ explode('|', $values)[$j - 1] }}
@endif
</textarea>

Expected Behaviour

@endif and its preceeding line always get pushed to 0 indentation. this happens regardless of indentation level. e.g. this also

                          <textarea class="elm"
                            name="inner_group[{{ $i }}][{{ $c->attribute }}{{ $j }}]"
                          >
                            @if (explode('|', $values) != null && isset(explode('|', $values)[$j - 1]))
                              {{ explode('|', $values)[$j - 1] }}
                            @endif
                          </textarea>

becomes this

                          <textarea class="elm"
                            name="inner_group[{{ $i }}][{{ $c->attribute }}{{ $j }}]"
                          >
                            @if (explode('|', $values) != null && isset(explode('|', $values)[$j - 1]))
{{ explode('|', $values)[$j - 1] }}
@endif
                          </textarea>

Relevant log output

No response

KarimElsayad247 avatar Sep 23 '24 09:09 KarimElsayad247