fix: error when parsing tables with only headers in docx/pdf (#271)

This commit is contained in:
N3ko 2025-07-29 21:16:17 +08:00 committed by GitHub
parent 0d83a5e7bc
commit 02b4171576
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -249,6 +249,11 @@ func formatTablesInDocument(input []*schema.Document) (output []*schema.Document
values = append(values, col.Name) values = append(values, col.Name)
} }
write(values) write(values)
if colOnly, err := document.GetDocumentColumnsOnly(doc); err != nil {
return nil, err
} else if colOnly {
break
}
} }
data, err := document.GetDocumentColumnData(doc) data, err := document.GetDocumentColumnData(doc)