When I'm traversing a layout object, after visiting a layout list, the iterator then moves on to individual list items, causing duplication of nodes visited. Is this intended?
This happens in .html() function as well. I know that you can use the childBlockIds of LayoutList to mark down which nodes have been visited and skip them later, but wanted to confirm this behaviour.
Thank you, you guys are awesome!
const ignoredBlocks: ApiBlockType[] = [
ApiBlockType.LayoutHeader,
ApiBlockType.LayoutFooter,
ApiBlockType.LayoutPageNumber
]
for (const page of doc.iterPages()) {
for (const layItem of page.layout.iterItems()) {
if (!ignoredBlocks.includes(layItem.blockType)) {
console.log(layItem.blockType)
console.log(layItem.text + "\n")
}
}
}