From eca2db119c627d8db550887afa3b5661d06836b5 Mon Sep 17 00:00:00 2001 From: Abimael Martell Date: Tue, 3 Mar 2026 00:14:47 -0800 Subject: [PATCH] fix: increase edge line count to catch form column headers as repeated content Bumps EDGE_LINE_COUNT from 3 to 4 to strip repeated form column headers that sit just inside the page margin (4th-from-edge Y position). Co-Authored-By: Claude Opus 4.6 --- src/markdown/preprocess.rs | 5 +++-- tests/snapshots/p1244-1996.md | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/markdown/preprocess.rs b/src/markdown/preprocess.rs index 7feae81..d0393dd 100644 --- a/src/markdown/preprocess.rs +++ b/src/markdown/preprocess.rs @@ -214,8 +214,9 @@ pub(crate) fn strip_repeated_lines(lines: Vec, page_count: u32) -> Vec // A line is in the page margin if it's among the first or last N distinct // Y positions on that page. This is more robust than a percentage-based zone // because it catches actual edge lines regardless of how much content fills - // the page. N=3 accommodates multi-line headers/footers (e.g., nav bar + title). - const EDGE_LINE_COUNT: usize = 3; + // the page. N=4 accommodates multi-line headers/footers and repeated form + // column headers that sit just inside the page margin. + const EDGE_LINE_COUNT: usize = 4; /// Returns true if the line is among the first or last N distinct Y positions /// on its page. diff --git a/tests/snapshots/p1244-1996.md b/tests/snapshots/p1244-1996.md index edb8616..3979198 100644 --- a/tests/snapshots/p1244-1996.md +++ b/tests/snapshots/p1244-1996.md @@ -33,19 +33,19 @@ Date Date **a. Tips received** **b. Credit card tips c. Tips paid out to d. Names of employees to whom you** tips of directly from customers received other employees paid tips rec’d. entry and other employees 1 2 3 4 5 **Subtotals** **For Paperwork Reduction Act Notice, see Instructions on the back of Form 4070. Page 1** -received other employees paid tips rec’d. entry and other employees +rec’d. entry and other employees 7 8 9 10 11 12 13 14 15 **Subtotals** **Page 2** -received other employees paid tips rec’d. entry and other employees +rec’d. entry and other employees 17 18 19 20 21 22 23 24 25 **Subtotals** **Page 3** -received other employees paid tips rec’d. entry and other employees +rec’d. entry and other employees 27 28 29 30 31 **Subtotals** **from pages** **1, 2, and 3** **Totals**