File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33* Ignore style definitions using a style ID that has already been used.
44
5+ * Fix conversion of unmerged table cells.
6+
57# 1.10.0
68
79* Add "Heading" and "Body" styles, as found in documents created by Apple Pages,
Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ class TableCellUnmerged:
9292 rowspan = cobble .field ()
9393 vmerge = cobble .field ()
9494
95+ def _accept1 (self , visitor , arg0 ):
96+ return visitor .visit_table_cell (self , arg0 )
97+
9598 def copy (self , ** kwargs ):
9699 return cobble .copy (self , ** kwargs )
97100
Original file line number Diff line number Diff line change @@ -386,6 +386,25 @@ def test_docx_table_is_converted_to_table_in_html():
386386 assert_equal (expected_html , result .value )
387387
388388
389+ def test_unmerged_table_cell_is_treated_as_table_cell ():
390+ table = documents .table ([
391+ documents .table_row ([
392+ documents .table_cell_unmerged (
393+ [_paragraph_with_text ("Cell" )],
394+ colspan = 1 ,
395+ rowspan = 1 ,
396+ vmerge = False ,
397+ ),
398+ ]),
399+ ])
400+ result = convert_document_element_to_html (table )
401+ expected_html = (
402+ "<table>" +
403+ "<tr><td><p>Cell</p></td></tr>" +
404+ "</table>" )
405+ assert_equal (expected_html , result .value )
406+
407+
389408def test_table_style_mappings_can_be_used_to_map_tables ():
390409 table = documents .table ([], style_name = "Normal Table" )
391410 result = convert_document_element_to_html (
You can’t perform that action at this time.
0 commit comments