def ellipsis_after(text, length):
    """ Truncates text and adds ellipses at the end. Does not truncate words in the middle. """
    if not text or len(text) <= length:
        return text
    else:
        return text[:length].rsplit(' ', 1)[0]+u"\u2026"