Closed zepfietje closed 1 year ago
Due to the implementation - I'm unlikely to change this at the moment (otherwise it breaks a lot of other things)
The problem is, its does actually affect the output visually. The browser will parse the colon separately to the text, which creates a gap between them
Will figure something out 🙂 Its an edge case that breaks for the most part (an annoying one, but I think I can get it sorted)
I've updated the inline echo analyzer, and it will now inline them as text when they are surrounded by content. This will let them be treated as text by prettier, but reversed back into the correct Blade echo once transformation is complete.
With the default settings I use for testing, the following input:
<span>
{{ 'foo' }}:
</span>
becomes:
<span>{{ "foo" }}:</span>
and the echo and its adjacent content are no longer separated.
However, if the echo does not neighbor any meaningful content in either direction (with respect to any child documents), the transformer will force them to be blocks internally to allow for the following:
@if ('foo')
{{ $actions }}
@elseif ('bar')
@endif
to become:
@if ("foo")
{{ $actions }}
@elseif ("bar")
@endif
P.s - You have all been incredibly patient and awesome with providing examples. Thanks a ton for that!!
Thank you for your responsivity John!
Input
Output
I would expect the input to remain unchanged or be formatted similar to how the following without
{{ }}
would:Input
Output