Permalink
Browse files

Mark attrs as Markup to avoid double escaping

  • Loading branch information...
amol- committed Aug 28, 2012
1 parent 59f478f commit 5e138ace2c90cb07f09fb577f3f70e251a1deba2
Showing with 2 additions and 1 deletion.
  1. +2 −1 tw2/core/mako_util.py
@@ -2,6 +2,7 @@
from mako.runtime import Undefined
from copy import copy
from markupsafe import Markup
from cgi import escape
#from mako.filters import xml_escape
@@ -27,7 +28,7 @@ def attrs(context, args=None, attrs=None):
new_attrs = [u'%s="%s"' % (k, escape(unicode(k in bools and k or v), True))
for k, v in args.iteritems()
if (k not in bools and v is not None) or (k in bools and v)]
return u" ".join(new_attrs)
return Markup(u" ".join(new_attrs))
def compat(context, attr):

0 comments on commit 5e138ac

Please sign in to comment.