From d01d77fc4ffda227221a9a4919cb4bc196230d5d Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Sun, 4 Jul 2021 15:22:38 +0800 Subject: [PATCH] Update AnalyzeByJSoup.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 扩大索引向前的匹配范围,索引前无规则时相当于前面的规则是children --- .../java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt index be1615a46..3bb2e4e33 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt @@ -219,7 +219,7 @@ class AnalyzeByJSoup(doc: Any) { len-- //跳过尾部']' - while (len-- > 0) { //逆向遍历,至少有一位前置字符,如 [ + while (len-- >= 0) { //逆向遍历,可以无前置规则 var rl = rus[len] if (rl == ' ') continue //跳过空格 @@ -265,7 +265,7 @@ class AnalyzeByJSoup(doc: Any) { curMinus = false //重置 } } - } else while (len --> 0) { //阅读原本写法,逆向遍历,至少两位前置字符,如 . + } else while (len-- >= 0) { //阅读原本写法,逆向遍历,可以无前置规则 val rl = rus[len] if (rl == ' ') continue //跳过空格