fix #2862
This commit is contained in:
@@ -148,18 +148,22 @@ class EpubFile(var book: Book) {
|
|||||||
for (res in epubBook.contents) {
|
for (res in epubBook.contents) {
|
||||||
if (!findChapterFirstSource) {
|
if (!findChapterFirstSource) {
|
||||||
if (chapter.url == res.href) findChapterFirstSource = true
|
if (chapter.url == res.href) findChapterFirstSource = true
|
||||||
// add first resource to elements
|
// 第一个xhtml文件
|
||||||
elements.add(
|
elements.add(
|
||||||
/* pass endFragmentId if only has one resource */
|
|
||||||
getBody(res, startFragmentId, endFragmentId)
|
getBody(res, startFragmentId, endFragmentId)
|
||||||
)
|
)
|
||||||
if (chapter.url == nextUrl) break
|
if (chapter.url == nextUrl) break
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (nextUrl != res.href) {
|
if (nextUrl != res.href) {
|
||||||
|
// 其余部分
|
||||||
elements.add(getBody(res, null, null))
|
elements.add(getBody(res, null, null))
|
||||||
} else {
|
} else {
|
||||||
elements.add(getBody(res, null, endFragmentId))
|
// 下一章节的第一个xhtml
|
||||||
|
if (!endFragmentId.isNullOrBlank()) {
|
||||||
|
//有Fragment 则添加到上一章节
|
||||||
|
elements.add(getBody(res, null, endFragmentId))
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user