docx2html/core.py
def get_single_list_nodes_data(li, meta_data):
    """
    Find consecutive li tags that have content that have the same list id.
    """
    yield li
    w_namespace = get_namespace(li, 'w')
    current_numId = get_numId(li, w_namespace)
    starting_ilvl = get_ilvl(li, w_namespace)
    el = li
    while True:
        el = el.getnext()
        if el is None:
            break
        # If the tag has no content ignore it.
        if not has_text(el):
            continue

        # Stop the lists if you come across a list item that should be a
        # heading.
        if _is_top_level_upper_roman(el, meta_data):
            break

        if (
                is_li(el, meta_data) and
                (starting_ilvl > get_ilvl(el, w_namespace))):
            break

        new_numId = get_numId(el, w_namespace)
        if new_numId is None or new_numId == -1:
            # Not a p tag or a list item
            yield el
            continue
        # If the list id of the next tag is different that the previous that
        # means a new list being made (not nested)
        if current_numId != new_numId:
            # Not a subsequent list.
            break
        if is_last_li(el, meta_data, current_numId):
            yield el
            break
        yield el
def get_single_list_nodes_data(li, meta_data):
    yield li
    w_namespace = get_namespace(li, 'w')
    current_numId = get_numId(li, w_namespace)
    starting_ilvl = get_ilvl(li, w_namespace)
    el = li
    while True:
        el = el.getnext()
        if el is None:
            break
        # If the tag has no content ignore it.
        if not has_text(el):
            continue

        # Stop the lists if you come across a list item that should be a
        # heading.
        if _is_top_level_upper_roman(el, meta_data):
            break

        if (
                is_li(el, meta_data) and
                (starting_ilvl > get_ilvl(el, w_namespace))):
            break

        new_numId = get_numId(el, w_namespace)
        if new_numId is None or new_numId == -1:
            # Not a p tag or a list item
            yield el
            continue
        # If the list id of the next tag is different that the previous that
        # means a new list being made (not nested)
        if current_numId != new_numId:
            # Not a subsequent list.
            break
        if is_last_li(el, meta_data, current_numId):
            yield el
            break
        yield el
def get_single_list_nodes_data ( li , meta_data ) : yield li w_namespace = get_namespace ( li , 'w' ) current_numId = get_numId ( li , w_namespace ) starting_ilvl = get_ilvl ( li , w_namespace ) el = li while True : el = el . getnext ( ) if el is None : break # If the tag has no content ignore it. if not has_text ( el ) : continue # Stop the lists if you come across a list item that should be a # heading. if _is_top_level_upper_roman ( el , meta_data ) : break if ( is_li ( el , meta_data ) and ( starting_ilvl > get_ilvl ( el , w_namespace ) ) ) : break new_numId = get_numId ( el , w_namespace ) if new_numId is None or new_numId == - 1 : # Not a p tag or a list item yield el continue # If the list id of the next tag is different that the previous that # means a new list being made (not nested) if current_numId != new_numId : # Not a subsequent list. break if is_last_li ( el , meta_data , current_numId ) : yield el break yield el
Find consecutive li tags that have content that have the same list id.
Find consecutive li tags that have content that have the same list id .