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]: #824

Closed
fe2-Nyxar opened this issue Feb 9, 2024 · 3 comments
Closed

[Formatting Bug]: #824

fe2-Nyxar opened this issue Feb 9, 2024 · 3 comments
Assignees
Labels
bug Something isn't working Stale Stale label

Comments

@fe2-Nyxar
Copy link

fe2-Nyxar commented Feb 9, 2024

Platform

Windows

Template before formatting

<table>
    <tr>
        <td>Number</td>
        <td>Nom</td>
        <td>prenom</td>
        <td>Company</td>
        <td>Ville</td>
        <td>Salaire</td>
        <td>Action</td>
    </tr>
    @foreach($data as $d)
    <tr>
        <td>{{$d->id}}</td>
        <td>{{$d->Name}}</td>
        <td>{{$d->Lastname}}</td>
        <td>{{$d->Company}}</td>
        <td>{{$d->Ville}}</td>
        <td>{{$d->Salaire}}</td>
        <td><button></button>
            <button></button>
            <button></button></td>
    </tr>
    @endforeach

</table>

Template after formatting

<table>
    <tr>
        <td>Number</td>
        <td>Nom</td>
        <td>prenom</td>
        <td>Company</td>
        <td>Ville</td>
        <td>Salaire</td>
        <td>Action</td>
    </tr>
<?php
    @foreach($data->$d)
    <tr>
        <td>{{$d->id}}</td>
        <td>{{$d->Name}}</td>
        <td>{{$d->Lastname}}</td>
        <td>{{$d->Company}}</td>
        <td>{{$d->Ville}}</td>
        <td>{{$d->Salaire}}</td>
        <td><button></button>
            <button></button>
            <button></button></td>
    </tr>
    @endforeach

?>

</table>

Expected Behaviour

the "php" bracket wasn't expected
and the change from as to -> for some reason :/

Relevant log output

No response

@fe2-Nyxar fe2-Nyxar added the bug Something isn't working label Feb 9, 2024
@shufo
Copy link
Owner

shufo commented Feb 9, 2024

Could not reproduced. I think other part of template or some option causes this.

 $  ./bin/blade-formatter.js test.blade.php
<table>
    <tr>
        <td>Number</td>
        <td>Nom</td>
        <td>prenom</td>
        <td>Company</td>
        <td>Ville</td>
        <td>Salaire</td>
        <td>Action</td>
    </tr>
    @foreach ($data as $d)
        <tr>
            <td>{{ $d->id }}</td>
            <td>{{ $d->Name }}</td>
            <td>{{ $d->Lastname }}</td>
            <td>{{ $d->Company }}</td>
            <td>{{ $d->Ville }}</td>
            <td>{{ $d->Salaire }}</td>
            <td><button></button>
                <button></button>
                <button></button>
            </td>
        </tr>
    @endforeach

</table>

Can you provide entire template? (please replace sensitive data)

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 Stale label label Apr 10, 2024
@fe2-Nyxar fe2-Nyxar reopened this Apr 14, 2024
@fe2-Nyxar
Copy link
Author

this issue was caused by another extention it has nothing to do with this one.

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 Stale label
Projects
None yet
Development

No branches or pull requests

2 participants