修改JSOUP最后的规则

pull/106/head
Celeter 5 years ago
parent 872745d366
commit 84c358b45b
  1. 12
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt

@ -359,8 +359,7 @@ class AnalyzeByJSoup {
try {
when (lastRule) {
"text" -> for (element in elements) {
val text = element.text()
textS.add(text)
textS.add(element.text())
}
"textNodes" -> for (element in elements) {
val tn = arrayListOf<String>()
@ -373,12 +372,15 @@ class AnalyzeByJSoup {
}
textS.add(join("\n", tn))
}
"ownText", "html" -> {
elements.select("script").remove()
"ownText" -> for (element in elements) {
textS.add(element.ownText())
}
"html" -> {
elements.select("script, style").remove()
val html = elements.html()
textS.add(html)
}
"all" -> textS.add(elements.html())
"all" -> textS.add(elements.outerHtml())
else -> for (element in elements) {
val url = element.attr(lastRule)
if (!isEmpty(url) && !textS.contains(url)) {

Loading…
Cancel
Save