From f18ff8a1ff7a95cbcd16701fc871d15178937f71 Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Tue, 6 Jul 2021 11:30:44 +0800 Subject: [PATCH] Update AnalyzeByJSoup.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 简化 --- .../java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt | 5 ++--- 1 file changed, 2 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 b11ada682..fecbd396e 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 @@ -1,6 +1,5 @@ package io.legado.app.model.analyzeRule -import android.text.TextUtils.join import androidx.annotation.Keep import org.jsoup.Jsoup import org.jsoup.nodes.Element @@ -230,7 +229,7 @@ class AnalyzeByJSoup(doc: Any) { tn.add(temp) } } - textS.add(join("\n", tn)) + textS.add(tn.joinToString("\n")) } "ownText" -> for (element in elements) { textS.add(element.ownText()) @@ -290,7 +289,7 @@ class AnalyzeByJSoup(doc: Any) { /** * 获取所有元素 * */ - var elements = if (beforeRule.isEmpty()) temp.children() //允许索引直接作为根元素,此时前置规则为空,效果与children相同 + var elements:Elements = if (beforeRule.isEmpty()) temp.children() //允许索引直接作为根元素,此时前置规则为空,效果与children相同 else { val rules = beforeRule.split(".") when (rules[0]) {