From 5cda2125d8434348266811409da8070118d00a61 Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Mon, 15 Jul 2024 00:08:50 +0800 Subject: [PATCH] MOBI6: empty string instead of undefined in TOC Should fix https://github.com/johnfactotum/foliate/issues/1347 --- mobi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobi.js b/mobi.js index bc5b988..86bc994 100644 --- a/mobi.js +++ b/mobi.js @@ -720,7 +720,7 @@ class MOBI6 { .reduce((arr, a) => { const indent = getIndent(a) const item = { - label: a.innerText?.trim(), + label: a.innerText?.trim() ?? '', href: `filepos:${a.getAttribute('filepos')}`, } const level = indent > lastIndent ? lastLevel + 1