fix: prevent frontmatter_side_zone on/near reference boundary page

Blocks on ref page and 1 page before no longer get frontmatter_side_zone.
Fixes 'Conflict of Interest' heading on P21 (4AG67PBH) being assigned to
frontmatter_side_zone via _is_explicit_frontmatter_support_furniture path
that bypassed _is_heading_like_block check.

Adds page gate: first_reference_page is not None and page >= first_reference_page - 1
This commit is contained in:
Research Assistant 2026-06-29 00:02:35 +08:00
parent 172c3b2590
commit bea122b36f

View file

@ -1460,6 +1460,10 @@ def infer_zones(
and first_surviving_page is not None
and int(block.get("page", 0) or 0) == first_surviving_page
)
and not (
first_reference_page is not None
and int(block.get("page", 0) or 0) >= first_reference_page - 1
)
]
# Blocks on the first surviving page excluded from frontmatter_side_zone
# because body has started are real body content -- collect their ids so