MOBI6: empty string instead of undefined in TOC

Should fix https://github.com/johnfactotum/foliate/issues/1347
This commit is contained in:
John Factotum
2024-07-15 00:08:50 +08:00
parent 92964699af
commit 5cda2125d8
+1 -1
View File
@@ -720,7 +720,7 @@ class MOBI6 {
.reduce((arr, a) => { .reduce((arr, a) => {
const indent = getIndent(a) const indent = getIndent(a)
const item = { const item = {
label: a.innerText?.trim(), label: a.innerText?.trim() ?? '',
href: `filepos:${a.getAttribute('filepos')}`, href: `filepos:${a.getAttribute('filepos')}`,
} }
const level = indent > lastIndent ? lastLevel + 1 const level = indent > lastIndent ? lastLevel + 1