From 028fe35fb3e028063b84c83d5862f5ae55eee391 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 30 Oct 2020 15:55:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 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 59fc6952b..4976bc14a 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 @@ -255,7 +255,7 @@ class AnalyzeByJSoup { } "class" -> { var elementsByClass = temp.getElementsByClass(rules[1]) - if (rules.size == 3) { + if (rules.size == 3 && rules[2].isNotEmpty()) { val index = Integer.parseInt(rules[2]) if (index < 0) { elements.add(elementsByClass[elementsByClass.size + index]) @@ -270,7 +270,7 @@ class AnalyzeByJSoup { } "tag" -> { var elementsByTag = temp.getElementsByTag(rules[1]) - if (rules.size == 3) { + if (rules.size == 3 && rules[2].isNotEmpty()) { val index = Integer.parseInt(rules[2]) if (index < 0) { elements.add(elementsByTag[elementsByTag.size + index]) @@ -285,7 +285,7 @@ class AnalyzeByJSoup { } "id" -> { var elementsById = Collector.collect(Evaluator.Id(rules[1]), temp) - if (rules.size == 3) { + if (rules.size == 3 && rules[2].isNotEmpty()) { val index = Integer.parseInt(rules[2]) if (index < 0) { elements.add(elementsById[elementsById.size + index])