From: Armin Ronacher Date: Thu, 7 Jun 2007 23:07:48 +0000 (+0200) Subject: [svn] fixed unicode issues with dump textile library. this fixes #249. X-Git-Tag: 2.0rc1~294 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8712dad9a2f4e1963f2e23a4f83c16d00a3d47de;p=jinja2.git [svn] fixed unicode issues with dump textile library. this fixes #249. --HG-- branch : trunk --- diff --git a/jinja/filters.py b/jinja/filters.py index 4cd360f..619148b 100644 --- a/jinja/filters.py +++ b/jinja/filters.py @@ -538,7 +538,7 @@ def do_textile(s): .. _PyTextile: http://dealmeida.net/projects/textile/ """ from textile import textile - return textile(s) + return textile(s.encode('utf-8')).decode('utf-8') do_textile = stringfilter(do_textile) @@ -551,7 +551,7 @@ def do_markdown(s): .. _Python-markdown: http://www.freewisdom.org/projects/python-markdown/ """ from markdown import markdown - return markdown(s) + return markdown(s.encode('utf-8')).decode('utf-8') do_markdown = stringfilter(do_markdown) @@ -564,12 +564,9 @@ def do_rst(s): .. _docutils: from http://docutils.sourceforge.net/ """ - try: - from docutils.core import publish_parts - parts = publish_parts(source=s, writer_name='html4css1') - return parts['fragment'] - except: - return s + from docutils.core import publish_parts + parts = publish_parts(source=s, writer_name='html4css1') + return parts['fragment'] do_rst = stringfilter(do_rst)