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