Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Formatting Bug]: @break inside @if inside @foreach loop indentation #288

Open
chrillep opened this issue Jun 27, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working Stale

Comments

@chrillep
Copy link

chrillep commented Jun 27, 2024

Version

^1.14.1

Template before formatting

@foreach ($users as $user)
    @if ($user->type == 1)
        @continue
    @endif
 
    <li>{{ $user->name }}</li>
 
    @if ($user->number == 5)
        @break
    @endif
@endforeach

Template after formatting

@foreach ($users as $user)
    @if ($user->type == 1)
        @continue
    @endif

    <li>{{ $user->name }}</li>

    @if ($user->number == 5)
    @break
@endif
@endforeach

Expected Behaviour

https://laravel.com/docs/11.x/blade#loops:~:text=When%20using%20loops,directives%3A

for @if and @break inside a @foreach should be scoped and indented correctly

Relevant log output

No response

@chrillep chrillep added the bug Something isn't working label Jun 27, 2024
@chrillep chrillep changed the title [Formatting Bug]: break foreach loop indent [Formatting Bug]: @break inside @foreach loop indentation Jun 27, 2024
@chrillep chrillep changed the title [Formatting Bug]: @break inside @foreach loop indentation [Formatting Bug]: @break inside @if inside @foreach loop indentation Jun 27, 2024
Copy link
Contributor

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

@github-actions github-actions bot added the Stale label Aug 27, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2024
@chrillep
Copy link
Author

chrillep commented Sep 6, 2024

@shufo reopen :)

Copy link
Contributor

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

@github-actions github-actions bot added the Stale label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

2 participants