﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
10126	Add sanitize and tidy options to textile filter.	anonymous	nobody	"The current textile filter is really basic, you can't set any options, like validating the HTML, or sanitizing the HTML.

I made a simple workaround for this problem:
django/contrib/markup/templatetags/markup.py
{{{
def textile(value, arg=''):
    try:
        import textile
    except ImportError:
        if settings.DEBUG:
            raise template.TemplateSyntaxError, ""Error in {% textile %} filter: The Python textile library isn't installed.""
        return force_unicode(value)
    else:
        args = arg.split(',')
        
        sanitize = 'sanitize' in args
        tidy = 'tidy' in args
        
        return mark_safe(force_unicode(textile.textile(smart_str(value), sanitize=sanitize, validate=tidy, encoding='utf-8', output='utf-8')))
textile.is_safe = True
}}}

Now you can add a comma seperated list of args to the textile filter, to validate the output, or sanitizing it."	New feature	closed	contrib.markup	1.0	Normal	invalid	textile	luckyluke56@…	Design decision needed	1	0	0	0	0	0
