I'm trying to insert html with twig via jQuery but the twig is escaped as text. Is there a way to escape the twig when it is appended with jquery ?
var html = `
{% if is_granted('ROLE_ADMIN') and app.user %}
<div class="col-sm-1 col-md-1">
<div class="form-group">
<div class="dropup">
<a class="btn btn-primary btn-sm" href="{{ path('easyadmin')}}"><i class=" glyphicon glyphicon-dashboard"></i> Administrar sistema</a></li>
</ul>
</div>
</div>
</div>
<div class="col-md-1 col-md-offset-7">
<div class="form-group">
<i id ="hide-footer" class="glyphicon glyphicon-remove white gi-2x"></i>
</div>
</div>
{% endif %}`
$('#reshow-footer').append(html);