Skip to content

Commit 7e9ba4c

Browse files
committed
Fix colspan issue
1 parent f0b0d99 commit 7e9ba4c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jsondoc/convert/html.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,10 +841,15 @@ def convert_td(self, el, convert_as_inline):
841841
paragraph_block.rich_text will be extracted to form table_row.cells.
842842
"""
843843
# Get colspan
844-
colspan = el.get("colspan", 1)
844+
colspan = el.get("colspan", "1")
845845
# Get rowspan
846846
# rowspan = el.get("rowspan", 1)
847847
# We need to come up with a much different way to handle rowspan
848+
if not isinstance(colspan, int):
849+
try:
850+
colspan = int(colspan)
851+
except ValueError:
852+
colspan = 1
848853

849854
next_objects = []
850855
if colspan > 1:

0 commit comments

Comments
 (0)