A
A
andrey_kl2013-11-16 19:02:06
Node.js
andrey_kl, 2013-11-16 19:02:06

JavaScript templating conflict

I am writing a project in Node.js + Express.js with the Swig templating engine .
On the user side, I use the doT.js
template engine. The question arose to pass a string like this to the browser:
<h1>string {{=it.stringVar}}</h1>
But I don’t know how to force Swig not to process part of the string as a variable (ie, not to process curly braces).
Doing an escape will not suit me. then I need to process the string with doT.js
Is there any mechanism to solve my problem?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andrey_kl, 2013-11-16
@andrey_kl

{% raw %} string {{= it.stringVar}} {% endraw %}
Read more in swig docs .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question