pull/37/head
kunfei 5 years ago
parent 401b55883d
commit fc64ceed60
  1. 11
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt

@ -103,11 +103,16 @@ class AnalyzeUrl(
} }
for (rule in ruleList) { for (rule in ruleList) {
var ruleStr = rule var ruleStr = rule
if (ruleStr.startsWith("<js>")) { when {
ruleStr.startsWith("<js>") -> {
ruleStr = ruleStr.substring(4, ruleStr.lastIndexOf("<")) ruleStr = ruleStr.substring(4, ruleStr.lastIndexOf("<"))
ruleUrl = evalJS(ruleStr, ruleUrl, page, key, book) as String ruleUrl = evalJS(ruleStr, ruleUrl, page, key, book) as String
} else { }
ruleUrl = ruleStr.replace("@result", ruleUrl) ruleStr.startsWith("@js", true) -> {
ruleStr = ruleStr.substring(4)
ruleUrl = evalJS(ruleStr, ruleUrl, page, key, book) as String
}
else -> ruleUrl = ruleStr
} }
} }
} }

Loading…
Cancel
Save