from typing import List


def strip_extra_newlines(text: str) -> List[str]:
    """
    Strips any extra newlines, as well as any other unnecessary characters.
    :param text: multi-line text to strip
    :return: new-line-joined text with the excess newlines removed
    """
    return [y for y in (x.rstrip() for x in text.splitlines()) if y]