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 6a02206bc..cdfa03d7b 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 @@ -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 }