pull/32/head
kunfei 5 years ago
parent 31f22b5288
commit 16d2c9bfa0
  1. 3
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt

@ -17,6 +17,8 @@ import java.util.*
*/ */
class AnalyzeByJSoup { class AnalyzeByJSoup {
private val validKeys = listOf("class", "id", "tag", "text")
private var element: Element? = null private var element: Element? = null
fun parse(doc: Any): AnalyzeByJSoup { fun parse(doc: Any): AnalyzeByJSoup {
@ -211,7 +213,6 @@ class AnalyzeByJSoup {
if (needFilterElements) { if (needFilterElements) {
filterRules = rulePc[1].trim { it <= ' ' }.splitNotBlank(".") filterRules = rulePc[1].trim { it <= ' ' }.splitNotBlank(".")
filterRules[0] = filterRules[0].trim { it <= ' ' } filterRules[0] = filterRules[0].trim { it <= ' ' }
val validKeys = listOf("class", "id", "tag", "text")
if (filterRules.size < 2 || !validKeys.contains(filterRules[0]) || isEmpty(filterRules[1].trim { it <= ' ' })) { if (filterRules.size < 2 || !validKeys.contains(filterRules[0]) || isEmpty(filterRules[1].trim { it <= ' ' })) {
needFilterElements = false needFilterElements = false
} }

Loading…
Cancel
Save