I have encountered an issue in my backend handler where I am sending a string with double quotes. Here's what it looks like:
print '\"test\"'
self.render('test.html', test = '\"test\"')
In the template test.html, I am passing the test variable into JavaScript like this:
<script>
var test = {{ test }};
</script>
However, when the browser generates the code, it shows:
<script>
var test = &quo t;test&quo t;;
</script>
Instead of displaying double quotes as intended.
Is there a feature in tornadoweb similar to Django pipeline that can help resolve this issue?
<script>
var test = {{ test|safe }};
</script>
Or perhaps there is another method for successfully passing strings with double quotes (which are essential in frontend development)?
Any suggestions or advice would be greatly appreciated!