{{{text}}} is returned without field formatting but html intact

This commit is contained in:
Damien Elmes 2010-11-29 22:40:20 +09:00
parent da1cfa52b1
commit dfb21a0f71

View file

@ -120,13 +120,12 @@ class Template(object):
return template return template
@modifier('{') @modifier('{')
@modifier('&')
def render_tag(self, tag_name, context): def render_tag(self, tag_name, context):
"""Given a tag name and context, finds, escapes, and renders the tag.""" """Given a tag name and context, finds, escapes, and renders the tag."""
raw = get_or_attr(context, tag_name, '') raw = get_or_attr(context, tag_name, '')
if not raw and raw is not 0: if not raw and raw is not 0:
return '' return ''
return cgi.escape(unicode(raw)) return re.sub("^<span.+?>(.*)</span>", "\\1", raw)
@modifier('!') @modifier('!')
def render_comment(self, tag_name=None, context=None): def render_comment(self, tag_name=None, context=None):