Let\'s say that I have this string:
s = \'Hello!\'
Hello!
When I pass this variable to a template, I want it to be rendered as raw
I think you should write as follows
{{s|escape|safe}}
it is ok for me