pull/48/head
kunfei 5 years ago
parent 9d6d051e12
commit e3cce8cafd
  1. 6
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt

@ -470,7 +470,7 @@ class AnalyzeRule(private var book: BaseBook? = null) {
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.Default) { if (mode != Mode.Js) {
mode = Mode.Regex mode = Mode.Regex
} }
if (evalMatcher.start() > start) { if (evalMatcher.start() > start) {
@ -560,9 +560,9 @@ class AnalyzeRule(private var book: BaseBook? = null) {
private fun isRule(ruleStr: String): Boolean { private fun isRule(ruleStr: String): Boolean {
return when { return when {
ruleStr.startsWith("$.") -> true ruleStr.startsWith("$.") -> true
ruleStr.startsWith("@XPath:", true) -> true
ruleStr.startsWith("//") -> true
ruleStr.startsWith("@Json:", true) -> true ruleStr.startsWith("@Json:", true) -> true
ruleStr.startsWith("//") -> true
ruleStr.startsWith("@XPath:", true) -> true
ruleStr.startsWith("@CSS:", true) -> true ruleStr.startsWith("@CSS:", true) -> true
ruleStr.startsWith("@@") -> true ruleStr.startsWith("@@") -> true
else -> false else -> false

Loading…
Cancel
Save