shufo / blade-formatter

An opinionated blade template formatter for Laravel that respects readability
https://www.npmjs.com/package/blade-formatter
MIT License
458 stars 26 forks source link

[Formatting Bug]: Wrong indent #941

Open QuentiumYT opened 1 month ago

QuentiumYT commented 1 month ago

Version

1.41.1

Template before formatting

@if ($i >= 1)
    @break
  @endif

Template after formatting

@if ($i >= 1)
  @break
@endif

Expected Behaviour

It should keep the @break indented and not remove an indentation for the @endif.

As the following code using a variable works just fine

@if ($i >= 1)
  {{ $var }}
@endif

Relevant log output

No response

QuentiumYT commented 1 month ago

Looks like it's also the same as #912 as well, maybe a global prevent would be nice