Skip to content

Commit 380f98e

Browse files
authored
Merge pull request #305 from anjanvb/layout-linearizer-tables-fix
Fix for #291 - Markdown issue with Tables in multi-page documents
2 parents 97389b3 + 1d2aade commit 380f98e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prettyprinter/textractprettyprinter/t_pretty_print_layout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _dfs(self, root, id2block):
9393
table_data = []
9494
# Find the matching TABLE block for the LAYOUT_TABLE
9595
table_block = None
96-
for potential_table in [b for b in self.j['Blocks'] if b['BlockType'] == 'TABLE']:
96+
for potential_table in [b for b in self.j['Blocks'] if b['BlockType'] == 'TABLE' and b.get('Page',1) == block.get('Page', 1)]:
9797
if self._geometry_match(block['Geometry']['BoundingBox'], potential_table['Geometry']['BoundingBox']):
9898
table_block = potential_table
9999
break

0 commit comments

Comments
 (0)