Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/display/font_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ class FontFaceObject {
} catch (ex) {
warn(`getPathGenerator - ignoring character: "${ex}".`);
}
const path = makePathFromDrawOPS(cmds.path);
const path = makePathFromDrawOPS(cmds?.path);

if (!this.fontExtraProperties) {
// Remove the raw path-string, since we don't need it anymore.
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -765,4 +765,5 @@
!two_paragraphs.pdf
!paragraph_and_link.pdf
!issue20225.pdf
!issue20513.pdf
!issue20516.pdf
Binary file added test/pdfs/issue20513.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13099,5 +13099,12 @@
"enableXfa": true,
"lastPage": 1,
"type": "eq"
},
{
"id": "issue20513",
"file": "pdfs/issue20513.pdf",
"md5": "19a3a347773518242fa3cf1c04a9a1e4",
"rounds": 1,
"type": "eq"
}
]
8 changes: 2 additions & 6 deletions web/pdf_find_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const DIACRITICS_EXCEPTION = new Set([
let DIACRITICS_EXCEPTION_STR; // Lazily initialized, see below.

const DIACRITICS_REG_EXP = /\p{M}+/gu;
const SPECIAL_PUNCTUATION_CHARACTERS = /[.?*{}()[\]\\]/g;
const SPECIAL_CHARS_REG_EXP = /([+^$|])|(\p{P}+)|(\s+)|(\p{M})|(\p{L})/gu;
const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u;
const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u;
Expand Down Expand Up @@ -735,14 +734,11 @@ class PDFFindController {

if (p1) {
// Escape characters like *+?... to not interfere with regexp syntax.
return addExtraWhitespaces(p1, `\\${p1}`);
return addExtraWhitespaces(p1, RegExp.escape(p1));
}
if (p2) {
// Allow whitespaces around group of punctuation signs.
return addExtraWhitespaces(
p2,
p2.replaceAll(SPECIAL_PUNCTUATION_CHARACTERS, "\\$&")
);
return addExtraWhitespaces(p2, RegExp.escape(p2));
}
if (p3) {
// Replace spaces by \s+ to be sure to match any spaces.
Expand Down
1 change: 0 additions & 1 deletion web/pdf_thumbnail_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ class PDFThumbnailView {
*/
setPageLabel(label) {
this.pageLabel = typeof label === "string" ? label : null;
this.anchor.setAttribute("data-l10n-args", this.#pageL10nArgs);
this.image.setAttribute("data-l10n-args", this.#pageL10nArgs);
}
}
Expand Down
Loading