0

I ran into a problem when my template contains some javascript. For instance

<script>var i = /{{([a-z]*)}}/gi;</script>

Sure enough the template interpreter wants to interpret everything that is in double curled braces {{}} as a variable. Now I wonder if there is a way to turn off such a behavior similar to {% autoescape off %}{% endautoescape %}.

1 Answer 1

2

You can use built-in tags: {% verbatim %} and {% endverbatim %} like this:

{% verbatim %}
     <script>var i = /{{([a-z]*)}}/gi;</script>
{% endverbatim %} 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.