Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-minor] Highlight search results correctly for normalized text (PR 9448) #12855

Merged
merged 1 commit into from
Jan 12, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Jan 12, 2021

This patch is a rebased and refactored version of PR 9448, such that it applies cleanly given that PDFFindController has changed since that PR was opened; obviously keeping the original author information intact.

This patch will thus ensure that e.g. fractions, and other things that we normalize before searching, will still be highlighted correctly in the textLayer.

Furthermore, this patch also adds basic unit-tests for this functionality.

Note: The [api-minor] tag is added, since third-party implementations of the PDFFindController must now always use the pageMatchesLength property to get accurate length information (see the web/text_layer_builder.js changes).

Fixes #5668
Fixes #7230
Fixes #10708
Fixes bug 1680858

@Snuffleupagus Snuffleupagus force-pushed the find-normalization branch 6 times, most recently from 26fe850 to acc9761 Compare January 12, 2021 16:45
@Snuffleupagus Snuffleupagus changed the title Highlight search results correctly for normalized text (PR 9448) [api-minor] Highlight search results correctly for normalized text (PR 9448) Jan 12, 2021
…R 9448)

This patch is a rebased *and* refactored version of PR 9448, such that it applies cleanly given that `PDFFindController` has changed since that PR was opened; obviously keeping the original author information intact.

This patch will thus ensure that e.g. fractions, and other things that we normalize before searching, will still be highlighted correctly in the textLayer.

Furthermore, this patch also adds basic unit-tests for this functionality.

*Note:* The `[api-minor]` tag is added, since third-party implementations of the `PDFFindController` must now always use the `pageMatchesLength` property to get accurate length information (see the `web/text_layer_builder.js` changes).

Co-authored-by: Ross Johnson <[email protected]>
Co-authored-by: Jonas Jenwald <[email protected]>
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://3.101.106.178:8877/2ea5340b7b9270a/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/ef68d172aa8acd4/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/ef68d172aa8acd4/output.txt

Total script time: 3.58 mins

  • Unit Tests: FAILED

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/2ea5340b7b9270a/output.txt

Total script time: 4.70 mins

  • Unit Tests: Passed

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/c56e4310bf39e0a/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/c56e4310bf39e0a/output.txt

Total script time: 4.06 mins

Published

@timvandermeij timvandermeij merged commit dcd1589 into mozilla:master Jan 12, 2021
@timvandermeij
Copy link
Contributor

Thanks a lot for fixing up this old PR! I found this version easier to follow, and with the added unit tests I have much more trust in that the functionality is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants