diff options
Diffstat (limited to 'pystache/template.py')
-rw-r--r-- | pystache/template.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pystache/template.py b/pystache/template.py index 787304d..c942cd7 100644 --- a/pystache/template.py +++ b/pystache/template.py @@ -97,7 +97,10 @@ class Template(object): @modifier(None) def render_tag(self, tag_name, context): """Given a tag name and context, finds, escapes, and renders the tag.""" - return cgi.escape(unicode(context.get(tag_name, '') or '')) + raw = context.get(tag_name, '') + if not raw and raw is not 0: + return '' + return cgi.escape(unicode(raw)) @modifier('!') def render_comment(self, tag_name=None, context=None): |