From 5d2eb919ae80afa8538cac0d02a4d7ef14c251ae Mon Sep 17 00:00:00 2001 From: Horis <8674809+821938089@users.noreply.github.com> Date: Sun, 15 Dec 2024 17:39:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/model/localBook/EpubFile.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt b/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt index 777b9e879..c979f9e46 100644 --- a/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt @@ -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()