Repository navigation
Compare drawn text in the text check, not the old structure's ActualText - #15
Merged
Merged
Conversation
A tagged source can give a glyph ActualText through its structure tree, such as a soft hyphen at a line break. Tagging replaces that tree, so the same glyph then extracted differently and the gate reported it lost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
No blocking findings.
Non-blocking notes
- I checked whether
ignore-actualtext(src/verify/text.ts:43) hides real loss: a word drawn as one glyph but spelled out only by the old structure's/ActualText(for example, a glyph with no Unicode mapping). It does not hide it. On base, such a page fails withtext_lost. On this head, the source word is reported asunmatched_textand the HTML word goes into the overlay, so the output's structure still reads the HTML's text. That case has no test. A test asserting the HTML word reaches the structure would keep this from regressing if the alignment ever starts reading ActualText.
Accessibility impact: none negative. The structure still reads the HTML's text, and a soft hyphen in a source's old ActualText no longer stops a correctly tagged PDF from being written.
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.
A false
text_loston prod, reported by the Iris maintainer: a tagged Canva PDF failed with "Page 5 lost text", though its pixels were identical.Cause. The source's structure tree gives the hyphen glyph at a wrapped URL a
/HyphenSpanwith ActualText U+00AD. mupdf's extraction swaps that in. Tagging replaces the old tree, so the same glyph then extracts as-. The word compare saw…2022-PAbefore and…2022-PA-after.Fix. The text check extracts with
ignore-actualtext, so both sides compare only the text that is drawn. A glyph or word really lost still fails, and the test checks that.Test: a tagged PDF whose line ends in a hyphen glyph under ActualText U+00AD passes. The same document with the next word removed still reports it missing.
🤖 Generated with Claude Code