Update AnalyzeRule.kt

优化
pull/1121/head
bushixuanqi 3 years ago committed by GitHub
parent b4ea0ee8ab
commit 1b7b1307b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      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
}

Loading…
Cancel
Save