From 2ddacfd06bb9e3886abc92cc10bf4ea88d017a25 Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Wed, 25 Jan 2023 11:20:29 +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 --- .../java/io/legado/app/help/book/BookHelp.kt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/book/BookHelp.kt b/app/src/main/java/io/legado/app/help/book/BookHelp.kt index a4e2c4c80..9089e2329 100644 --- a/app/src/main/java/io/legado/app/help/book/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/book/BookHelp.kt @@ -118,15 +118,13 @@ object BookHelp { content: String ) = coroutineScope { val awaitList = arrayListOf>() - content.split("\n").forEach { - val matcher = AppPattern.imgPattern.matcher(it) - while (matcher.find()) { - matcher.group(1)?.let { src -> - val mSrc = NetworkUtils.getAbsoluteURL(bookChapter.url, src) - awaitList.add(async { - saveImage(bookSource, book, mSrc) - }) - } + val matcher = AppPattern.imgPattern.matcher(content) + while (matcher.find()) { + matcher.group(1)?.let { src -> + val mSrc = NetworkUtils.getAbsoluteURL(bookChapter.url, src) + awaitList.add(async { + saveImage(bookSource, book, mSrc) + }) } } awaitList.forEach {