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

@if inside class #61

Closed 1stevengrant closed 1 year ago

1stevengrant commented 1 year ago

I have this conditional

<div class="@if($step === 1 || $step === 2 || $step === 3 ) bg-white @endif h-3 rounded-full border border-white"></div>

when I run the formatter over the top, it becomes

<div
        class="@if($step === 1 || $step === 2 || $step === 3 ) bg-white
    @endifh-3 rounded-full border border-white"
    ></div>

concatenating the h-3 class with the @endif statement and breaks the view

JohnathonKoster commented 1 year ago

Thanks for the report!

This has been resolved in 1.6.2 (while preserving the existing smart-spacing logic), with additional test coverage.