pull/1128/head^2
gedoor 3 years ago
parent ef46ae8022
commit 9cac73f303
  1. 13
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt

@ -445,7 +445,13 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions {
var tmp: String
val evalMatcher = evalPattern.matcher(rule)
while (evalMatcher.find()) {
if (evalMatcher.find()) {
if (mode != Mode.Js && mode != Mode.Regex
&& evalMatcher.start() == 0
) {
mode = Mode.Regex
}
do {
if (evalMatcher.start() > start) {
tmp = rule.substring(start, evalMatcher.start())
if (mode != Mode.Js && mode != Mode.Regex
@ -454,10 +460,6 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions {
mode = Mode.Regex
}
splitRegex(tmp)
} else if (mode != Mode.Js && mode != Mode.Regex
&& evalMatcher.start() == 0
) {
mode = Mode.Regex
}
tmp = evalMatcher.group()
when {
@ -474,6 +476,7 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions {
}
}
start = evalMatcher.end()
} while (evalMatcher.find())
}
if (rule.length > start) {
tmp = rule.substring(start)

Loading…
Cancel
Save