Skip to content

Instantly share code, notes, and snippets.

@groovecoder
Created May 14, 2013 19:57
Show Gist options
  • Save groovecoder/5578980 to your computer and use it in GitHub Desktop.
Save groovecoder/5578980 to your computer and use it in GitHub Desktop.
def get_excerpt(self):
stripped_matches = []
for match in self._highlight['content']:
stripped_matches.append(bleach.clean(match,
tags=['em',],
strip=True))
return u'...'.join(stripped_matches)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment