Skip to content

Commit 06b1c96

Browse files
nkryuchkovgunnsth
authored andcommitted
Add tables loop to document's Paragraphs func (#280)
1 parent c01764e commit 06b1c96

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

document/document.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ func (d *Document) StructuredDocumentTags() []StructuredDocumentTag {
430430
return ret
431431
}
432432

433-
// Paragraphs returns all of the paragraphs in the document body.
433+
// Paragraphs returns all of the paragraphs in the document body including tables.
434434
func (d *Document) Paragraphs() []Paragraph {
435435
ret := []Paragraph{}
436436
if d.x.Body == nil {
@@ -443,6 +443,14 @@ func (d *Document) Paragraphs() []Paragraph {
443443
}
444444
}
445445
}
446+
447+
for _, t := range d.Tables() {
448+
for _, r := range t.Rows() {
449+
for _, c := range r.Cells() {
450+
ret = append(ret, c.Paragraphs()...)
451+
}
452+
}
453+
}
446454
return ret
447455
}
448456

0 commit comments

Comments
 (0)