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

Loading…
Cancel
Save