Stillat / blade-parser-typescript

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

SyntaxError: Unpaired condition control structure #112

Closed stayallive closed 3 months ago

stayallive commented 3 months 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 3 months 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 3 months ago

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