Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
refs #21: fixed a bug with list id and losing content
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Ward committed Mar 22, 2013
1 parent 0b017e8 commit bc9c3c1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docx2html/core.py
Expand Up @@ -313,13 +313,18 @@ def get_li_nodes(li, meta_data):
(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):
new_numId = get_numId(el, w_namespace)
if current_numId == new_numId:
# Not a subsequent list.
yield el
yield el
break
yield el

Expand Down

0 comments on commit bc9c3c1

Please sign in to comment.