Skip to content

Commit 6b11e17

Browse files
authored
Properly handle empty fragments for MOBI (#107)
1 parent c49ded0 commit 6b11e17

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mobi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ class KF8 {
994994
const last = arr[arr.length - 1]
995995
const fragStart = last?.fragEnd ?? 0, fragEnd = fragStart + skel.numFrag
996996
const frags = fragTable.slice(fragStart, fragEnd)
997-
const length = skel.length + frags.map(f => f.length).reduce((a, b) => a + b)
997+
const length = skel.length + frags.map(f => f.length).reduce((a, b) => a + b, 0)
998998
const totalLength = (last?.totalLength ?? 0) + length
999999
return arr.concat({ skel, frags, fragEnd, length, totalLength })
10001000
}, [])

0 commit comments

Comments
 (0)