google app engine - webapp2 changes html tags in pure text -
i want make gae application webapp2 compatible. code worked great webapp:
insert = '<p><font color="red"><b>some text</b></font></p>' template_values = { 'insert': insert, ... } path = ... self.response.out.write(template.render(path,template_values))
the content of variable insert put web page output webapp. content of variable "analyzed" webapp2 , content changed when inserted in webpage.
webapp2 inserts this:
<p><font color="red"><b>some text</b></font></p>
how can go old behavior?
thanks help.
have @
safe
: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#safe &
autoescape
: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#autoescape.
eg:
{{ inserthtml|safe }}
or
{% autoescape off %}{{ inserhtml }}{% endautoescape %}
Comments
Post a Comment