修复规则解析bug

pull/392/head^2
gedoor 4 years ago
parent 796c217fa1
commit eee6a69cc7
  1. 5
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt

@ -451,9 +451,6 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions {
var tmp: String var tmp: String
val evalMatcher = evalPattern.matcher(rule) val evalMatcher = evalPattern.matcher(rule)
while (evalMatcher.find()) { while (evalMatcher.find()) {
if (mode != Mode.Js) {
mode = Mode.Regex
}
if (evalMatcher.start() > start) { if (evalMatcher.start() > start) {
tmp = rule.substring(start, evalMatcher.start()) tmp = rule.substring(start, evalMatcher.start())
ruleType.add(0) ruleType.add(0)
@ -461,7 +458,7 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions {
} }
tmp = evalMatcher.group() tmp = evalMatcher.group()
when { when {
tmp.startsWith("$") -> { tmp.startsWith("$") && !rule.contains("##") -> {
ruleType.add(tmp.substring(1).toInt()) ruleType.add(tmp.substring(1).toInt())
ruleParam.add(tmp) ruleParam.add(tmp)
} }

Loading…
Cancel
Save