From 3de7ec5e3da281a4f6c1fb98b6856b9c89557569 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 19 Jul 2021 19:59:00 +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 --- .../legado/app/model/analyzeRule/AnalyzeRule.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 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 a727ce40c..473f3a145 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 @@ -413,14 +413,6 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { init { rule = when { mode == Mode.Js || mode == Mode.Regex -> ruleStr - isRegex -> { - mode = Mode.Regex - ruleStr - } - isJSON || ruleStr.startsWith("$.") || ruleStr.startsWith("$[") -> { - mode = Mode.Json - ruleStr - } ruleStr.startsWith("@CSS:", true) -> { mode = Mode.Default ruleStr @@ -441,6 +433,14 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { mode = Mode.Json ruleStr.substring(6) } + isJSON || ruleStr.startsWith("$.") || ruleStr.startsWith("$[") -> { + mode = Mode.Json + ruleStr + } + isRegex -> { + mode = Mode.Regex + ruleStr + } else -> ruleStr } //分离put