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

SyntaxError: Unpaired condition control structure #112

Closed stayallive closed 1 month ago

stayallive commented 1 month ago

This code:

@if($domains->isNotEmpty() || $customDomains->isNotEmpty())
    <option @if($selectedDomain === $value) selected="selected" @endif>{{ $label }}</option>
@endif

Results in a SyntaxError: Unpaired condition control structure on the first line.

afbeelding

Screenshot is of a larger block of code, I have tried to make the example as minimal as possible.

I know I could use @selected instead of the @if but this code is perfectly valid and should (and did not) cause any issues before.

JohnathonKoster commented 1 month ago

Thanks for the report! I've tracked this down to the > character in @endif> causing issues. I've addressed this in 2.1.19

Have a fantastic day!

stayallive commented 1 month ago

That was super quick, thanks! 🚀 Just tested and works like a charm again ❤️