From aa0b6ff497e6c38e4398574861c8e0451e457576 Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Fri, 30 Jul 2021 17:07:12 +0800 Subject: [PATCH] Update AnalyzeRule.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit isJSON为真时先替换内嵌{$.},再考虑是否为XPath,避免XPath写法与链接写法冲突。 注:链接可以用//或/开头。 非发现处的链接,要么通过规则获取,要么包含内嵌规则。 非发现处直接写个固定链接的书源比较少 --- .../java/io/legado/app/model/analyzeRule/AnalyzeRule.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index 7df8dbbcc..007fe1b4e 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -436,10 +436,6 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { mode = Mode.XPath ruleStr.substring(7) } - ruleStr.startsWith("/") -> {//XPath特征很明显,无需配置单独的识别标头 - mode = Mode.XPath - ruleStr - } ruleStr.startsWith("@Json:", true) -> { mode = Mode.Json ruleStr.substring(6) @@ -448,6 +444,10 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { mode = Mode.Json ruleStr } + ruleStr.startsWith("/") -> {//XPath特征很明显,无需配置单独的识别标头 + mode = Mode.XPath + ruleStr + } else -> ruleStr } //分离put