pull/457/head
gedoor 4 years ago
parent 24537f1a48
commit 028fe35fb3
  1. 6
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt

@ -255,7 +255,7 @@ class AnalyzeByJSoup {
} }
"class" -> { "class" -> {
var elementsByClass = temp.getElementsByClass(rules[1]) var elementsByClass = temp.getElementsByClass(rules[1])
if (rules.size == 3) { if (rules.size == 3 && rules[2].isNotEmpty()) {
val index = Integer.parseInt(rules[2]) val index = Integer.parseInt(rules[2])
if (index < 0) { if (index < 0) {
elements.add(elementsByClass[elementsByClass.size + index]) elements.add(elementsByClass[elementsByClass.size + index])
@ -270,7 +270,7 @@ class AnalyzeByJSoup {
} }
"tag" -> { "tag" -> {
var elementsByTag = temp.getElementsByTag(rules[1]) var elementsByTag = temp.getElementsByTag(rules[1])
if (rules.size == 3) { if (rules.size == 3 && rules[2].isNotEmpty()) {
val index = Integer.parseInt(rules[2]) val index = Integer.parseInt(rules[2])
if (index < 0) { if (index < 0) {
elements.add(elementsByTag[elementsByTag.size + index]) elements.add(elementsByTag[elementsByTag.size + index])
@ -285,7 +285,7 @@ class AnalyzeByJSoup {
} }
"id" -> { "id" -> {
var elementsById = Collector.collect(Evaluator.Id(rules[1]), temp) 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]) val index = Integer.parseInt(rules[2])
if (index < 0) { if (index < 0) {
elements.add(elementsById[elementsById.size + index]) elements.add(elementsById[elementsById.size + index])

Loading…
Cancel
Save