WebStorm - Live Template - Twig + Html not working

112 Views Asked by At

I'm trying to add a simple snippet:

<a class="button button--link" href="{{ $1$.url }}" {% if $1$.target %} target="{{ $1$.target }}" rel="noreferrer noopener prerender" {% endif %}>
  {{ $1$.title|e }}
</a>
$END$

The result:

<a class="button button--link" href="{{ .url }}" target="{{ .target }}" rel="noreferrer noopener prerender" {%="${%$"  %}="$%}$" if="" .target="$_1_.target$" endif="">
  {{ .title|e }}
</a>

The problem is starting with {% if $1$.target %}, actually the % causing problems cause when I remove this if statement, all works.

Does anyone know how can I tell WebStorm that it should ignore this and not replace it to {%="${%$" %}="$%}$" if="" .target="$_1_.target$"

0

There are 0 best solutions below