Update AnalyzeRule.kt

isJSON为真时先替换内嵌{$.},再考虑是否为XPath,避免XPath写法与链接写法冲突。
注:链接可以用//或/开头。
非发现处的链接,要么通过规则获取,要么包含内嵌规则。
非发现处直接写个固定链接的书源比较少
pull/1191/head
bushixuanqi 3 years ago committed by GitHub
parent 339f3507bd
commit aa0b6ff497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt

@ -436,10 +436,6 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions {
mode = Mode.XPath
ruleStr.substring(7)
}
ruleStr.startsWith("/") -> {//XPath特征很明显,无需配置单独的识别标头
mode = Mode.XPath
ruleStr
}
ruleStr.startsWith("@Json:", true) -> {
mode = Mode.Json
ruleStr.substring(6)
@ -448,6 +444,10 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions {
mode = Mode.Json
ruleStr
}
ruleStr.startsWith("/") -> {//XPath特征很明显,无需配置单独的识别标头
mode = Mode.XPath
ruleStr
}
else -> ruleStr
}
//分离put

Loading…
Cancel
Save