def skip_range()

in src/simplify_docx/iterators/generic.py [0:0]


def skip_range(x: xmlFragment,
               id_attr: str,
               waitfor: str) -> Optional[xmlFragment]:
    """
    A utility which returns the element at the end of the range
    """

    _id: str = x.attrib[id_attr]
    current: Optional[xmlFragment] = x.getnext()

    while True:
        if current is None:
            return current
        if get_tag(current).tag == waitfor and current.attrib[id_attr] == _id:
            return current
        current = current.getnext()