Skip to content

🐝 Restore wrapped footnote highlighting - #219

Open
JFWooten4 wants to merge 4 commits into
mainfrom
amethyst-star-footnote-wrap
Open

JFWooten4 wants to merge 4 commits into
mainfrom
amethyst-star-footnote-wrap

Conversation

@JFWooten4

Copy link
Copy Markdown
Member

Problem

In NBER working paper w9126, printed page 19, the viewer highlights only the first line of footnote 19, stopping after “annual” despite two wrapped continuation lines. The footnote selector should highlight the complete footnote without including note 18 or the page number.

Changes

  • Extend the fallback lookup from one PDF.js text item to consecutive, similarly sized continuation lines, stopping at subsequent numbered notes and footers.
  • Recover indexed notes when PDF.js reports taller spans for wrapped lines and the preview would otherwise be truncated.
  • Register and add three regression tests covering three-line fallback, adjacent footnote boundaries, and differing font-height extraction.

Verification

  • The branch differs from its parent and contains only the intended indexer, regression test, and test-command changes.
  • Tests are registered in npm test; GitHub CI and interactive PDF verification are still required. The source PDF could not be downloaded for an interactive reproduction in this environment.
  • Existing PR descriptions and branches were left unchanged.

Write PR descriptions automatically.

JFWooten4 and others added 4 commits October 31, 2026 11:55
Collect wrapped continuation lines when a note cannot be confidently indexed, stopping before adjacent notes and the page footer. Add regression coverage for a three-line footnote and its next numbered note.

Co-authored-by: ChatGPT GPT-6 <noreply@openai.com>
Include the wrapped-footnote regression suite in the repository's explicit npm test command so CI exercises the new cases.

Co-authored-by: ChatGPT GPT-6 <noreply@openai.com>
Repair indexed notes when PDF.js reports taller wrapped lines than the first footnote line. Preserve adjacent-note and footer boundaries, with a regression for the mixed-height case.

Co-authored-by: ChatGPT GPT-6 <noreply@openai.com>
Fix escaped numeric-marker expressions so wrapped footnote highlights stop before the next numbered note and printed page counter.

Co-authored-by: ChatGPT GPT-6 <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant