Skip to content

Commit 4c22b99

Browse files
Collect all child nodes of lists and tables
1 parent de7179f commit 4c22b99

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/core/struct_tree.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,23 @@ class StructTreePage {
824824

825825
const element = new StructElementNode(this, dict);
826826
map.set(dict, element);
827+
switch (element.role) {
828+
case "L":
829+
case "LBody":
830+
case "LI":
831+
case "Table":
832+
case "THead":
833+
case "TBody":
834+
case "TFoot":
835+
case "TR": {
836+
// Always collect all child nodes of lists and tables, even empty ones
837+
for (const kid of element.kids) {
838+
if (kid.type === StructElementType.ELEMENT) {
839+
this.addNode(kid.dict, map, level - 1);
840+
}
841+
}
842+
}
843+
}
827844

828845
const parent = dict.get("P");
829846

0 commit comments

Comments
 (0)