From d8c2484d691ed6ea9399bf8aec6fd9b8cac0f877 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 2 Sep 2020 18:22:56 +0800 Subject: [PATCH] =?UTF-8?q?htmlFormat=E5=8F=AA=E7=94=A8=E5=9C=A8@html?= =?UTF-8?q?=E8=A7=84=E5=88=99=E4=B8=8A,=E9=98=B2=E6=AD=A2=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E8=BF=87=E5=BA=A6,=E6=9C=89=E4=BA=9B=E4=B8=9C?= =?UTF-8?q?=E8=A5=BF=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt | 3 ++- app/src/main/java/io/legado/app/model/webBook/BookContent.kt | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt index bf00f0d43..8dfe92acc 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt @@ -3,6 +3,7 @@ package io.legado.app.model.analyzeRule import android.text.TextUtils.isEmpty import android.text.TextUtils.join import androidx.annotation.Keep +import io.legado.app.utils.htmlFormat import io.legado.app.utils.splitNotBlank import org.jsoup.Jsoup import org.jsoup.nodes.Element @@ -379,7 +380,7 @@ class AnalyzeByJSoup { "html" -> { elements.select("script").remove() elements.select("style").remove() - val html = elements.outerHtml() + val html = elements.outerHtml().htmlFormat() textS.add(html) } "all" -> textS.add(elements.outerHtml()) diff --git a/app/src/main/java/io/legado/app/model/webBook/BookContent.kt b/app/src/main/java/io/legado/app/model/webBook/BookContent.kt index b17c5e4ff..ffcc09bd5 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookContent.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookContent.kt @@ -10,7 +10,6 @@ import io.legado.app.model.Debug import io.legado.app.model.analyzeRule.AnalyzeRule import io.legado.app.model.analyzeRule.AnalyzeUrl import io.legado.app.utils.NetworkUtils -import io.legado.app.utils.htmlFormat import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.withContext @@ -96,7 +95,7 @@ object BookContent { } } content.deleteCharAt(content.length - 1) - var contentStr = content.toString().htmlFormat() + var contentStr = content.toString() val replaceRegex = bookSource.ruleContent?.replaceRegex?.trim() if (!replaceRegex.isNullOrEmpty()) { contentStr = AnalyzeRule(book).setContent(contentStr).getString(replaceRegex)