Skip to content

Commit

Permalink
Mark attrs as Markup to avoid double escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Aug 28, 2012
1 parent 59f478f commit 5e138ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tw2/core/mako_util.py
Expand Up @@ -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

Expand All @@ -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):
Expand Down

0 comments on commit 5e138ac

Please sign in to comment.