From 046158be54cebc3a43b65d0e54731d5635cfbedb Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Mon, 30 Oct 2023 22:39:21 +0000 Subject: [PATCH] Include URL for outline item --- src/core/text/analyzer.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/text/analyzer.js b/src/core/text/analyzer.js index d8ae3869abdb8..a23488446c719 100644 --- a/src/core/text/analyzer.js +++ b/src/core/text/analyzer.js @@ -465,12 +465,16 @@ export class OutlineAnalyzer { for (let item of items) { let newItem = { title: item.title, - location: { - dest: item.dest, - }, items: transformItems(item.items), expanded: false, }; + if (item.dest) { + newItem.location = { + dest: item.dest, + }; + } else if (item.unsafeUrl) { + newItem.url = item.unsafeUrl; + } newItems.push(newItem); } return newItems;