def _split(text: str, sep: str, length: int) -> list[str]:
    """
    Split given text into smaller chunks inside given size limit.
    :param text: Text to split
    :param sep: Separator at which the text can be split
    :param length: Maximal length of split text lines
    :return: Split text lines
    """
    separated = []
    words = text.split(sep)
    counter = 0
    iterator = 0

    while len(words) > 0:
        if len(words[iterator]) > length:
            words[iterator] = words[iterator][:length - 5] + '...'
        while counter + len(words[iterator]) + 1 < length:
            counter += len(words[iterator]) + 1
            iterator += 1
            if iterator == len(words):
                break
        separated.append(sep.join(words[:iterator]))
        words = words[iterator:]
        iterator = 0
        counter = 0
    return separated