Skip to content

Commit

Permalink
Fix tables with no number
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed May 27, 2020
1 parent a0167c4 commit 6211f87
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/imxml2epub.py
Original file line number Diff line number Diff line change
Expand Up @@ -1527,12 +1527,12 @@ class FootnoteError(Exception):
for xmlChild in xmlTable.find(".//EOAtablecaption").iterchildren():
xmlTableCaption.append(xmlChild)
xmlRawTable.addnext(xmlTableCaption)
xmlTable.find(".//EOAtablelabel").clear()
xmlTable.remove(xmlTable.find(".//EOAtablelabel"))
else:
logging.info("Table has no caption")
xmlTable.find(".//EOAtablecaption").clear()
xmlTable.remove(xmlTable.find(".//EOAtablecaption"))
xmlTable.find(".//EOAtablelabel").clear()
xmlTable.remove(xmlTable.find(".//EOAtablelabel"))
# Analyze Width and Alignment of the Columns
strColumnString = xmlTable.find(".//EOAtablecolumns").text
strColumnString = re.sub(r"\|", "", strColumnString)
Expand Down Expand Up @@ -1561,7 +1561,10 @@ class FootnoteError(Exception):
del xmlRawTable.attrib["rend"]
del xmlRawTable.attrib["id-text"]
del xmlRawTable.attrib["id"]
del xmlRawTable.attrib["place"]
try:
del xmlRawTable.attrib["place"]
except KeyError:
pass
# Figure out and deal with the Header
xmlHeader = xmlRawTable.find(".//row/cell/tableheader")
if xmlHeader is not None:
Expand Down

0 comments on commit 6211f87

Please sign in to comment.