From fc64ceed60da3adc34687e377b654b48896bbd23 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 13 Oct 2019 19:28:41 +0800 Subject: [PATCH] up --- .../io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 } } }