@register.filter
def bleach_urlize(text):
 linkified = bleach.linkify(unicode(text))
 cleaned = bleach.clean(linkified, tags=['a', 'p', 'div', 'br', 'spanb', 'strong', 'em', 'i'])
 return mark_safe(cleaned)

@ register . filter def bleach_urlize ( text ) : linkified = bleach . linkify ( unicode ( text ) ) cleaned = bleach . clean ( linkified , tags = [ 'a' , 'p' , 'div' , 'br' , 'spanb' , 'strong' , 'em' , 'i' ] ) return mark_safe ( cleaned )
converts any urls in text into clickable links .