Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Dec 15, 2024
1 parent 4865a72 commit 5d2eb91
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/main/java/io/legado/app/model/localBook/EpubFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5d2eb91

Please sign in to comment.