Repository navigation
🐛 Include adjacent OCR-misread footnote markers in Markdown copy - #200
Merged
Merged
Conversation
Co-authored-by: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Markdown copying when a PDF text selection ends at a sentence's punctuation but stops before the immediately following raised footnote marker. In the Securities Transfer Association's August 4, 2009 petition, PDF page 14 (printed page 13) displays note 25 after “self-regulatory organizations.”, while the enhanced text layer extracts the raised marker as
2s. The citation and its recovered note definition can therefore be omitted from the copied passage.sorS, and normalize those characters to5when matching an indexed footnote number. This affects citation recognition, not general OCR text.selectionToMarkdown, include an otherwise unselected superscript when it immediately follows a fully selected span in text-layer order on the same page, only when Markdown copying is enabled and the marker is outside indexed footnote regions. Preserve native copying for untagged plain-text selections.organizations.²⁵is followed by the recovered[25]: Allowing DTC…definition, which ends withsame functions as transfer agents., without leaking2sor creating an incorrect[5]:note. Also check Markdown-disabled behavior.This extends the indexed-note recovery introduced in #183 and the Unicode-superscript, paragraph-adjacent footnote output refined in #187. It complements the terminal-punctuation drag-selection fix in #188 by handling the following citation marker during Markdown serialization instead of changing the drag endpoint.