Corrected contrib.markup filter errors to not use misleading template syntax.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17610 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Carl Meyer 2012-03-01 19:49:19 +00:00
parent b05abd8314
commit d0f162c73c
1 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ def textile(value):
import textile import textile
except ImportError: except ImportError:
if settings.DEBUG: if settings.DEBUG:
raise template.TemplateSyntaxError("Error in {% textile %} filter: The Python textile library isn't installed.") raise template.TemplateSyntaxError("Error in 'textile' filter: The Python textile library isn't installed.")
return force_unicode(value) return force_unicode(value)
else: else:
return mark_safe(force_unicode(textile.textile(smart_str(value), encoding='utf-8', output='utf-8'))) return mark_safe(force_unicode(textile.textile(smart_str(value), encoding='utf-8', output='utf-8')))
@ -51,7 +51,7 @@ def markdown(value, arg=''):
import markdown import markdown
except ImportError: except ImportError:
if settings.DEBUG: if settings.DEBUG:
raise template.TemplateSyntaxError("Error in {% markdown %} filter: The Python markdown library isn't installed.") raise template.TemplateSyntaxError("Error in 'markdown' filter: The Python markdown library isn't installed.")
return force_unicode(value) return force_unicode(value)
else: else:
# markdown.version was first added in 1.6b. The only version of markdown # markdown.version was first added in 1.6b. The only version of markdown
@ -79,7 +79,7 @@ def restructuredtext(value):
from docutils.core import publish_parts from docutils.core import publish_parts
except ImportError: except ImportError:
if settings.DEBUG: if settings.DEBUG:
raise template.TemplateSyntaxError("Error in {% restructuredtext %} filter: The Python docutils library isn't installed.") raise template.TemplateSyntaxError("Error in 'restructuredtext' filter: The Python docutils library isn't installed.")
return force_unicode(value) return force_unicode(value)
else: else:
docutils_settings = getattr(settings, "RESTRUCTUREDTEXT_FILTER_SETTINGS", {}) docutils_settings = getattr(settings, "RESTRUCTUREDTEXT_FILTER_SETTINGS", {})