switch raw and escaped modifiers

This commit is contained in:
Damien Elmes 2010-11-27 20:58:19 +09:00
parent 6d787a92f1
commit 9f6a21e0a7

View file

@ -116,7 +116,8 @@ class Template(object):
return template return template
@modifier(None) @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, '')
@ -129,8 +130,7 @@ class Template(object):
"""Rendering a comment always returns nothing.""" """Rendering a comment always returns nothing."""
return '' return ''
@modifier('{') @modifier(None)
@modifier('&')
def render_unescaped(self, tag_name=None, context=None): def render_unescaped(self, tag_name=None, context=None):
"""Render a tag without escaping it.""" """Render a tag without escaping it."""
return unicode(get_or_attr(context, tag_name, '')) return unicode(get_or_attr(context, tag_name, ''))