Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLDR-773 docx table bug fix #480

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions dedoc/readers/docx_reader/data_structures/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,14 @@ def to_table(self) -> Table:
if cell.vMerge:
value = cell.vMerge.get("w:val", "continue")
if value == "continue":
cell_lines = cell_list[-1][cell_ind].lines
cell_row_list.append(CellWithMeta(lines=cell_lines, colspan=1, rowspan=1, invisible=True))
last_cell_rowspan = cell_list[rowspan_start_info[cell_ind]][cell_ind]
last_cell_rowspan.rowspan += 1
cell_list[rowspan_start_info[cell_ind]][cell_ind] = last_cell_rowspan
if cell_ind in rowspan_start_info:
cell_lines = cell_list[-1][cell_ind].lines
cell_row_list.append(CellWithMeta(lines=cell_lines, colspan=1, rowspan=1, invisible=True))
last_cell_rowspan = cell_list[rowspan_start_info[cell_ind]][cell_ind]
last_cell_rowspan.rowspan += 1
cell_list[rowspan_start_info[cell_ind]][cell_ind] = last_cell_rowspan
else:
cell_row_list.append(CellWithMeta(lines=cell_lines, colspan=grid_span, rowspan=1, invisible=False))
elif value == "restart":
rowspan_start_info[cell_ind] = row_index
cell_row_list.append(CellWithMeta(lines=cell_lines, colspan=grid_span, rowspan=1, invisible=False))
Expand Down
Loading