This commit is contained in:
Horis 2023-08-11 10:15:59 +08:00
parent 90b16b7f74
commit 31264e1122
2 changed files with 9 additions and 3 deletions

View File

@ -10,6 +10,7 @@ import io.legado.app.data.entities.BookChapter
import io.legado.app.help.book.BookHelp
import io.legado.app.utils.FileUtils
import io.legado.app.utils.HtmlFormatter
import io.legado.app.utils.isXml
import io.legado.app.utils.printOnDebug
import me.ag2s.epublib.domain.EpubBook
import me.ag2s.epublib.domain.Resource
@ -246,7 +247,7 @@ class EpubFile(var book: Book) {
getElementsByTag("h4").remove()
getElementsByTag("h5").remove()
getElementsByTag("h6").remove()
//getElementsMatchingOwnText(chapter.title)?.remove()
//getElementsMatchingOwnText(chapter.title)?.remove()
}
}
return bodyElement
@ -275,7 +276,12 @@ class EpubFile(var book: Book) {
book.author = author
}
if (metadata.descriptions.size > 0) {
book.intro = Jsoup.parse(metadata.descriptions[0]).text()
val desc = metadata.descriptions[0]
book.intro = if (desc.isXml()) {
Jsoup.parse(metadata.descriptions[0]).text()
} else {
desc
}
}
}
}

View File

@ -59,7 +59,7 @@ public class EpubWriter {
epubWriterProcessor.setTotalProgress(epubWriterProcessor.getTotalProgress() + book.getResources().size());
book = processBook(book);
ZipOutputStream resultStream = new ZipOutputStream(out);
resultStream.setLevel(ZipOutputStream.STORED);
//resultStream.setLevel(ZipOutputStream.STORED);
writeMimeType(resultStream);
writeContainer(resultStream);
initTOCResource(book);