From 4c22b99df32ceafa65e296c7777adcc036731583 Mon Sep 17 00:00:00 2001 From: Edoardo Cavazza Date: Thu, 2 Oct 2025 10:53:19 +0200 Subject: [PATCH] Collect all child nodes of lists and tables --- src/core/struct_tree.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/core/struct_tree.js b/src/core/struct_tree.js index 539ae008f..fa2d6e98c 100644 --- a/src/core/struct_tree.js +++ b/src/core/struct_tree.js @@ -824,6 +824,23 @@ class StructTreePage { const element = new StructElementNode(this, dict); map.set(dict, element); + switch (element.role) { + case "L": + case "LBody": + case "LI": + case "Table": + case "THead": + case "TBody": + case "TFoot": + case "TR": { + // Always collect all child nodes of lists and tables, even empty ones + for (const kid of element.kids) { + if (kid.type === StructElementType.ELEMENT) { + this.addNode(kid.dict, map, level - 1); + } + } + } + } const parent = dict.get("P");