python - Pystache without escaping (unescaped) -
i'm using pystache render templates. i'm getting &
in output when render context variables having &. how can rid of &
need & . same thing happening django templating
>>> pystache.render('the url {{url}}', {'url': 'http://google.com?a=3&b=3'}) u'the url http://google.com?a=3&b=3'
to prevent escaping use triple braces {{{var}}}
to prevent escaping, use triple braces, {{{url}}}
instead of double braces {{url}}
>>> pystache.render('the url {{{url}}}', {'url': 'http://google.com?a=3&b=3'}) u'the url http://google.com?a=3&b=3'
i've tested on recent release of today, version 0.5.4
mustache documentation
since pystache mustache implementation in python, can use mustache's documentation pointers.
all variables html escaped default. if want return unescaped html, use triple mustache: {{{name}}}.
Comments
Post a Comment