<s> try : <EOL> from django . template import Library <EOL> from django . template . defaultfilters import stringfilter <EOL> except : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> from twitter_text import TwitterText <EOL> register = Library ( ) <EOL> @ register . filter ( name = '<STR_LIT>' ) <EOL> @ stringfilter <EOL> def twitter_text ( text , search_query = False ) : <EOL> """<STR_LIT>""" <EOL> tt = TwitterText ( text ) <EOL> if search_query : <EOL> tt . text = tt . highlighter . hit_highlight ( query = search_query ) <EOL> tt . text = tt . autolink . auto_link ( ) <EOL> return tt . text <EOL> twitter_text . is_safe = True </s>
