Stillat / blade-parser-typescript

A Laravel Blade parser, compiler, and static analyzer written in TypeScript.
https://stillat.com
MIT License
82 stars 2 forks source link

`@Foreach` gets transformed incorrectly #108

Closed RobertBlaauwendraad closed 1 month ago

RobertBlaauwendraad commented 1 month ago

When I run --write,

@Foreach($filters as $item)
  <li class="list-unstyled">
    <a href="{{ $item->link }}" class="{{ $item->active ? 'fw-bold text-primary' : '' }}">
                    {{ $item->name }}
    </a>
  </li>
@endforeach

becomes

@Foreach(foreach ($filters as $item):endforeach;)
  <li class="list-unstyled">
    <a href="{{ $item->link }}" class="{{ $item->active ? 'fw-bold text-primary' : '' }}">
                    {{ $item->name }}
    </a>
  </li>
@endforeach
JohnathonKoster commented 1 month ago

Thanks for the report. Tracked this down to the uppercase characters within the @foreach. A fix is available in 2.1.18 👍