mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Catch and ignore any errors during auto-linking parsing (PR 19110 follow-up)
While investigating a bug, that I've not yet had time to fully investigate and report, I found that if there's ever an error thrown from the `Autolinker` class it'll prevent the annotationEditorLayer from rendering *and* the renderTask itself will be treated as having failed.
This commit is contained in:
parent
de1c2146b8
commit
357ff4afde
1 changed files with 11 additions and 6 deletions
|
@ -1112,12 +1112,17 @@ class PDFPageView {
|
|||
await this.#renderAnnotationLayer();
|
||||
|
||||
if (this.#enableAutoLinking) {
|
||||
await textLayerPromise;
|
||||
this.annotationLayer?.injectLinkAnnotations({
|
||||
inferredLinks: Autolinker.processLinks(this),
|
||||
viewport: this.viewport,
|
||||
structTreeLayer: this.structTreeLayer,
|
||||
});
|
||||
try {
|
||||
await textLayerPromise;
|
||||
|
||||
this.annotationLayer?.injectLinkAnnotations({
|
||||
inferredLinks: Autolinker.processLinks(this),
|
||||
viewport: this.viewport,
|
||||
structTreeLayer: this.structTreeLayer,
|
||||
});
|
||||
} catch (ex) {
|
||||
console.error("enableAutoLinking:", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue