

@register.filter(is_safe=True)
def markdown(value, arg=''):
    '\n    Runs Markdown over a given value, optionally using various\n    extensions python-markdown supports.\n\n    Syntax::\n\n        {{ value|markdown:"extension1_name,extension2_name..." }}\n\n    To enable safe mode, which strips raw HTML and only returns HTML\n    generated by actual Markdown syntax, pass "safe" as the first\n    extension in the list.\n\n    If the version of Markdown in use does not support extensions,\n    they will be silently ignored.\n\n    '
    try:
        import markdown
    except ImportError:
        if settings.DEBUG:
            raise template.TemplateSyntaxError("Error in 'markdown' filter: The Python markdown library isn't installed.")
        return force_unicode(value)
    else:
        if hasattr(markdown, 'version'):
            extensions = [e for e in arg.split(',') if e]
            if ((len(extensions) > 0) and (extensions[0] == 'safe')):
                extensions = extensions[1:]
                safe_mode = True
            else:
                safe_mode = False
            python_markdown_deprecation = 'The use of Python-Markdown < 2.1 in Django is deprecated; please update to the current version'
            markdown_vers = getattr(markdown, 'version_info', None)
            if (markdown_vers < (1, 7)):
                warnings.warn(python_markdown_deprecation, DeprecationWarning)
                return mark_safe(force_unicode(markdown.markdown(smart_str(value), extensions, safe_mode=safe_mode)))
            elif (markdown_vers >= (2, 1)):
                if safe_mode:
                    return mark_safe(markdown.markdown(force_unicode(value), extensions, safe_mode=safe_mode, enable_attributes=False))
                else:
                    return mark_safe(markdown.markdown(force_unicode(e), extensions, safe_mode=safe_mode))
            else:
                warnings.warn(python_markdown_deprecation, DeprecationWarning)
                return mark_safe(markdown.markdown(force_unicode(value), extensions, safe_mode=safe_mode))
        else:
            warnings.warn(python_markdown_deprecation, DeprecationWarning)
            return mark_safe(force_unicode(markdown.markdown(smart_str(value))))

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/contrib/markup/templatetags/markup.py markdown/VarMisuse@255/562 `value`->`e`