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

Merge pull request #16807 from calixteman/bug1847733

[Annotation] Strip out the array index in the path only when the path is from a terminal node (bug 1847733)
This commit is contained in:
calixteman 2023-08-08 16:14:23 +02:00 committed by GitHub
commit 007b46279d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 2 deletions

View file

@ -1630,7 +1630,8 @@ class WidgetAnnotation extends Annotation {
if (
data.fieldName &&
/\[\d+\]$/.test(data.fieldName) &&
!dict.has("Kids")
!dict.has("Kids") &&
dict.has("T")
) {
data.baseFieldName = data.fieldName.substring(
0,

View file

@ -1711,7 +1711,7 @@ class PDFDocument {
name = name === "" ? partName : `${name}.${partName}`;
}
if (!field.has("Kids") && /\[\d+\]$/.test(name)) {
if (!field.has("Kids") && field.has("T") && /\[\d+\]$/.test(name)) {
// We've a terminal node: strip the index.
name = name.substring(0, name.lastIndexOf("["));
}