@register.filter
def showextrawhitespace(value):
 value = extraWhitespace.sub(u'<span class="ew">\\1</span>', value)
 return value.replace(u' DCTB ', u'<span class="tb"> DCTB </span>')

@ register . filter def showextrawhitespace ( value ) : value = extraWhitespace . sub ( u'<span class="ew">\\1</span>' , value ) return value . replace ( u' DCTB ' , u'<span class="tb"> DCTB </span>' )
marks up any extra whitespace in the specified text .