def shorten(string: str, width: int, placeholder: str = "...") -> str:
    """Same as textwrap.shorten(), but compatible with string without whitespaces."""
    return string[:width] + (placeholder if string[width:] else "")