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

Consider foo-\nBar as a compound word

Fixes #18693.
This commit is contained in:
Calixte Denizet 2024-09-10 22:00:04 +02:00
parent 0ac7f294cd
commit 06f9d8002d
4 changed files with 48 additions and 17 deletions

View file

@ -666,3 +666,4 @@
!highlight.pdf
!bug1708040.pdf
!issue18694.pdf
!issue18693.pdf

BIN
test/pdfs/issue18693.pdf Executable file

Binary file not shown.

View file

@ -1062,6 +1062,26 @@ describe("pdf_find_controller", function () {
await testOnFind({ eventBus });
});
it("performs a search in a text with compound word on two lines", async function () {
const { eventBus, pdfFindController } =
await initPdfFindController("issue18693.pdf");
await testSearch({
eventBus,
pdfFindController,
state: {
query: "hel-Lo",
},
matchesPerPage: [1],
selectedMatch: {
pageIndex: 0,
matchIndex: 0,
},
pageMatches: [[6]],
pageMatchesLength: [[7]],
});
});
describe("custom matcher", () => {
it("calls to the matcher with the right arguments", async () => {
const QUERY = "Foo bar";