From 1b7b1307b19f4059282dee02322601d9b9cee1e5 Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Fri, 16 Jul 2021 14:03:03 +0800 Subject: [PATCH] Update AnalyzeRule.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化 --- .../main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt | 3 +-- 1 file changed, 1 insertion(+), 2 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 41a62f3d5..1402fa795 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 @@ -49,7 +49,6 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { if (content == null) throw AssertionError("内容不可空(Content cannot be null)") this.content = content setBaseUrl(baseUrl) - isJSON = content.toString().isJson() objectChangedXP = true objectChangedJS = true objectChangedJP = true @@ -384,7 +383,7 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { isRegex = true ruleStr0.substring(1) } - ( ruleStr0[1] == '.' || ruleStr0[1] == '[') && ruleStr0[0] == '$' -> { + ( ruleStr0[1] == '.' || ruleStr0[1] == '[') && ruleStr0[0] == '$' || content.toString().isJson() -> { mMode = Mode.Json ruleStr0 }