优化规则解析

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
fun parse(doc: Any): AnalyzeByJSoup {
element = if (doc is Element) {
doc
} else if (doc is JXNode) {
if (doc.isElement) {
doc.asElement()
} else {
Jsoup.parse(doc.value().toString())
}
} else {
Jsoup.parse(doc.toString())
element = when (doc) {
is Element -> doc
is JXNode -> if (doc.isElement) doc.asElement() else Jsoup.parse(doc.toString())
else -> Jsoup.parse(doc.toString())
}
return this
}

Loading…
Cancel
Save