From 315c275ab19496f13fc58cc4c22c4262bcfbd548 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 3 Sep 2021 16:46:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96:=E8=A7=84=E5=88=99bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/analyzeRule/AnalyzeRule.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index 3534161f6..47f0787f2 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -128,7 +128,7 @@ class AnalyzeRule( @JvmOverloads fun getStringList(rule: String?, isUrl: Boolean = false): List? { if (rule.isNullOrEmpty()) return null - val ruleList = splitSourceRule(rule, true) + val ruleList = splitSourceRule(rule, false) return getStringList(ruleList, isUrl) } @@ -256,7 +256,7 @@ class AnalyzeRule( fun getElement(ruleStr: String): Any? { if (TextUtils.isEmpty(ruleStr)) return null var result: Any? = null - val ruleList = splitSourceRule(ruleStr) + val ruleList = splitSourceRule(ruleStr, true) content?.let { o -> if (ruleList.isNotEmpty()) result = o for (sourceRule in ruleList) { @@ -370,13 +370,13 @@ class AnalyzeRule( /** * 分解规则生成规则列表 */ - fun splitSourceRule(ruleStr: String?, isList: Boolean = false): List { + fun splitSourceRule(ruleStr: String?, allInOne: Boolean = false): List { if (ruleStr.isNullOrEmpty()) return ArrayList() val ruleList = ArrayList() var mMode: Mode = Mode.Default var start = 0 //仅首字符为:时为AllInOne,其实:与伪类选择器冲突,建议改成?更合理 - if (isList && ruleStr.startsWith(":")) { + if (allInOne && ruleStr.startsWith(":")) { mMode = Mode.Regex isRegex = true start = 1