This commit is contained in:
Horis 2024-12-15 17:39:19 +08:00
parent 4865a72409
commit 5d2eb919ae

View File

@ -20,6 +20,7 @@ import me.ag2s.epublib.epub.EpubReader
import me.ag2s.epublib.util.zip.AndroidZipFile
import org.jsoup.Jsoup
import org.jsoup.nodes.Element
import org.jsoup.parser.Parser
import org.jsoup.select.Elements
import java.io.FileOutputStream
import java.io.IOException
@ -229,6 +230,10 @@ class EpubFile(var book: Book) {
//getElementsMatchingOwnText(chapter.title)?.remove()
}
}
bodyElement.select("image").forEach {
it.tagName("img", Parser.NamespaceHtml)
it.attr("src", it.attr("xlink:href"))
}
bodyElement.select("img").forEach {
val src = it.attr("src").encodeURI()
val href = res.href.encodeURI()