diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index 5608f6e9d..c2ecf699b 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -103,11 +103,16 @@ class AnalyzeUrl( } for (rule in ruleList) { var ruleStr = rule - if (ruleStr.startsWith("")) { - ruleStr = ruleStr.substring(4, ruleStr.lastIndexOf("<")) - ruleUrl = evalJS(ruleStr, ruleUrl, page, key, book) as String - } else { - ruleUrl = ruleStr.replace("@result", ruleUrl) + when { + ruleStr.startsWith("") -> { + ruleStr = ruleStr.substring(4, ruleStr.lastIndexOf("<")) + ruleUrl = evalJS(ruleStr, ruleUrl, page, key, book) as String + } + ruleStr.startsWith("@js", true) -> { + ruleStr = ruleStr.substring(4) + ruleUrl = evalJS(ruleStr, ruleUrl, page, key, book) as String + } + else -> ruleUrl = ruleStr } } }