1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Normalize fullwidth, halfwidth and circled chars when searching

This commit is contained in:
Calixte Denizet 2022-11-14 18:14:08 +01:00
parent bfe6ff5893
commit 2be64d63e1
4 changed files with 60 additions and 15 deletions

View file

@ -554,3 +554,4 @@
!bug1796741.pdf
!textfields.pdf
!freetext_no_appearance.pdf
!issue15690.pdf

BIN
test/pdfs/issue15690.pdf Executable file

Binary file not shown.

View file

@ -647,4 +647,25 @@ describe("pdf_find_controller", function () {
pageMatchesLength: [[4]],
});
});
it("performs a search in a text containing fullwidth chars", async function () {
const { eventBus, pdfFindController } = await initPdfFindController(
"issue15690.pdf"
);
await testSearch({
eventBus,
pdfFindController,
state: {
query: "o",
},
matchesPerPage: [13],
selectedMatch: {
pageIndex: 0,
matchIndex: 0,
},
pageMatches: [[0, 10, 13, 30, 39, 41, 55, 60, 66, 84, 102, 117, 134]],
pageMatchesLength: [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]],
});
});
});