优化规则解析

pull/423/head 3.20.101616
gedoor 4 years ago
parent f5c919302d
commit fdedaee337
  1. 14
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt

@ -25,16 +25,10 @@ class AnalyzeByJSoup {
private lateinit var element: Element private lateinit var element: Element
fun parse(doc: Any): AnalyzeByJSoup { fun parse(doc: Any): AnalyzeByJSoup {
element = if (doc is Element) { element = when (doc) {
doc is Element -> doc
} else if (doc is JXNode) { is JXNode -> if (doc.isElement) doc.asElement() else Jsoup.parse(doc.toString())
if (doc.isElement) { else -> Jsoup.parse(doc.toString())
doc.asElement()
} else {
Jsoup.parse(doc.value().toString())
}
} else {
Jsoup.parse(doc.toString())
} }
return this return this
} }

Loading…
Cancel
Save