Please add n:tag-syntax for better support of AlpineJS
Closed this issue · 2 comments
When using AlpineJS we often have to add markup like this to our tags:
<div x-data='{counter: 0}'>
This conflicts with latte markup if syntax is set to single braces, so I have to workaround like this:
https://fiddle.nette.org/latte/#632f86a638
{syntax double}
<div x-data='{counter: 0}'>
{/syntax}
Your counter is <span x-text='counter'>{$counter}</span>
</div>
Of course I could also do this:
{syntax double}
<div x-data='{counter: 0}'>
Your counter is <span x-text='counter'>{$counter}</span>
</div>
{/syntax}
But the content of the div might be a lot more complex in real world or even include other template files, so I really want to stick to single brackets if possible.
So what I'd love to have is this:
<div
n:tag-syntax='double'
x-data='{counter: 0}'
title='{{$foo}}'
>
Your counter is <span x-text='counter'>{$counter}</span>
</div>
Thx for considering!
You can also put space after { and before } in json. Latte will ignore it and the IDE should understand it well.
Doubled syntax is currently not supported by Latte plugin for PHPStorm and may take some time to implement it
Ah, nice, thank you! Adding quotes will also work: https://fiddle.nette.org/latte/#f5e4e9fff7
No need for n:tag-syntax then :)