doc2json/tex2json/xml_to_json.py
def process_body_text_from_tex(sp: BeautifulSoup, bib_map: Dict, ref_map: Dict) -> List[Dict]:
    """
    Parse body text from tag recursively
    :param sp:
    :param bib_map:
    :param ref_map:
    :return:
    """
    body_text = []
    for tag in sp.body:
        # skip navigable string
        if type(tag) == NavigableString:
            continue
        else:
            sec_list = get_seclist_for_el(tag, ref_map, [])
            for cld in tag:
                # skip navigable string
                if type(tag) == NavigableString:
                    continue
                else:
                    sec_list = get_seclist_for_el(cld, ref_map, sec_list)
                    if type(cld) == bs4.element.Tag:
                        body_text += process_div(cld, sec_list, sp, bib_map, ref_map)

    # decompose everything
    sp.body.decompose()

    return [para.__dict__ for para in body_text]

    Parse body text from tag recursively
    :param sp:
    :param bib_map:
    :param ref_map:
    :return:
    
Parse body text from tag recursively
Parse body text from tag recursively
def process_body_text_from_tex(sp: BeautifulSoup, bib_map: Dict, ref_map: Dict) -> List[Dict]:
    body_text = []
    for tag in sp.body:
        if type(tag) == NavigableString:
            continue
        else:
            sec_list = get_seclist_for_el(tag, ref_map, [])
            for cld in tag:
                if type(tag) == NavigableString:
                    continue
                else:
                    sec_list = get_seclist_for_el(cld, ref_map, sec_list)
                    if type(cld) == bs4.element.Tag:
                        body_text += process_div(cld, sec_list, sp, bib_map, ref_map)
    sp.body.decompose()
    return [para.__dict__ for para in body_text]
def process_body_text_from_tex ( sp : BeautifulSoup , bib_map : Dict , ref_map : Dict ) -> List [ Dict ] : body_text = [ ] for tag in sp . body : if type ( tag ) == NavigableString : continue else : sec_list = get_seclist_for_el ( tag , ref_map , [ ] ) for cld in tag : if type ( tag ) == NavigableString : continue else : sec_list = get_seclist_for_el ( cld , ref_map , sec_list ) if type ( cld ) == bs4 . element . Tag : body_text += process_div ( cld , sec_list , sp , bib_map , ref_map ) sp . body . decompose ( ) return [ para . __dict__ for para in body_text ]
Parse body text from tag recursively
Parse body text from tag recursively
"""
    Parse body text from tag recursively
    :param sp:
    :param bib_map:
    :param ref_map:
    :return:
    """ # skip navigable string # skip navigable string # decompose everything
None
sp
BeautifulSoup
None
bib_map
Dict
None
ref_map
Dict
None