How can I disable the special mode of Latte in <script> tag?
Notice: This thread is very old.
- MartyIX
- Member | 217
Hi,
Latte handles differently the two following cases:
1)
<script>
{$variable} {* additional quotes are added to the output *}
</script>
2)
{$variable} {* that is not wrapped in a <script> tag *}
I would like to know if I can disable Latte's behavior in the first scenario and make it work as in the second scenario. Why should I need it? Well, have a look at Handlebars.js template for example:
<script id="entry-template" type="text/x-handlebars-template">
template content {* This is not JavaScript and <script n:syntax="off"> is not a solution either. *}
</script>
(My true reason is rather more obscure but let's not dwell on it. :))
Thanks
- petr.pavel
- Member | 535
You could capture “template content” outside <script></script> and then insert it in there with |noescape. Would that help?