Fix docx table issue. (#5117)

### 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-02-19 12:40:06 +08:00 committed by GitHub
parent 29a59ed7e2
commit c28bc41a96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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