Fix: abnormal cell mergeing. (#6991)

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2025-04-14 11:00:11 +08:00 committed by GitHub
parent 23c5ce48d1
commit ed5f81b02e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -133,7 +133,7 @@ class TableStructureRecognizer(Recognizer):
return "Ot"
@staticmethod
def construct_table(boxes, is_english=False, html=False, **kwargs):
def construct_table(boxes, is_english=False, html=True, **kwargs):
cap = ""
i = 0
while i < len(boxes):

View File

@ -162,6 +162,8 @@ class Docx(DocxParser):
if c.text == r.cells[j].text:
span += 1
i = j
else:
break
i += 1
html += f"<td>{c.text}</td>" if span == 1 else f"<td colspan='{span}'>{c.text}</td>"
html += "</tr>"