import typing
import re


def string_split_newlines(string: str) -> typing.List[str]:
    """Split a string into words while keeping newline characters.

    Args:
        string (str): The string to split.

    Returns:
        typing.List[str]: A list of words.
    """
    return re.findall(r"\S+|\n", string)