Closed RobertBlaauwendraad closed 2 months ago
{{-- format-ignore-start --}}
@if(isset($link) && !empty($link))
<a href="{{ $link }}"
class="usp {{ isset($class) && !empty($class) ? $class : '' }}">
@else
<div class="usp {{ isset($class) && !empty($class) ? $class : '' }}">
@endif
<div
class="usp__icon {{ isset($size) && $size == 'sm' ? 'usp__icon--sm' : '' }}">
<i class="icon icon-checkmark"></i>
</div>
<span class="usp__text">{{ $title }}</span>
@if(isset($link) && !empty($link))
{{-- format-ignore-end --}}
</a>
@else
</div>
@endif
@endif
This is the smallest block I can ignore to resolve the error, so it might be due to nested @if
statements
This issue is caused by having these types of things:
@if(isset($link) && !empty($link))
</a>
@else
</div>
@endif
This will ultimately end up looking like an unpaired element to prettier, causing issues. I have no plans to support these types of templates.
I think my
@else
tag gets seen as a closing tag. My code gets formatted like this, which has wrong indentation:And in the console I get the following error: