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

[Editor] Don't try to add data to the struct tree when there is no accessibilityData (bug 1855157)

This commit is contained in:
Calixte Denizet 2023-09-26 11:02:14 +02:00
parent 5f75404bc3
commit 3ee5268a23
2 changed files with 76 additions and 1 deletions

View file

@ -313,11 +313,16 @@ class StructTreeRoot {
for (const [pageIndex, elements] of newAnnotationsByPage) {
const { ref: pageRef } = await pdfManager.getPage(pageIndex);
for (const {
accessibilityData: { type, title, lang, alt, expanded, actualText },
accessibilityData,
ref,
parentTreeId,
structTreeParent,
} of elements) {
if (!accessibilityData?.type) {
continue;
}
const { type, title, lang, alt, expanded, actualText } =
accessibilityData;
nextKey = Math.max(nextKey, parentTreeId);
const tagRef = xref.getNewTemporaryRef();