1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #19122 from calixteman/issue19120

Correctly compute the mapping between text and normalized text when it contains a compound word on two lines
This commit is contained in:
calixteman 2024-11-28 17:13:09 +01:00 committed by GitHub
commit c784a24d45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 5 deletions

View file

@ -282,8 +282,7 @@ function normalize(text) {
if (p5) {
// Compound word with a line break after the hyphen.
positions.push([i - shift + 3, 1 + shift]);
shift += 1;
// Since the \n isn't in the original text, o = 3 and n = 3.
shiftOrigin += 1;
eol += 1;
return p5.replace("\n", "");