pull/32/head
kunfei 5 years ago
parent 190eb6eff5
commit 5d0462c2f7
  1. 10
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt

@ -51,7 +51,7 @@ class AnalyzeByJSoup {
val textS = getStringList(ruleStr) val textS = getStringList(ruleStr)
return if (textS.isEmpty()) { return if (textS.isEmpty()) {
null null
} else join("\n", textS).trim { it <= ' ' } } else join(",", textS).trim { it <= ' ' }
} }
/** /**
@ -360,13 +360,15 @@ class AnalyzeByJSoup {
textS.add(text) textS.add(text)
} }
"textNodes" -> for (element in elements) { "textNodes" -> for (element in elements) {
val tn = arrayListOf<String>()
val contentEs = element.textNodes() val contentEs = element.textNodes()
for (i in contentEs.indices) { for (item in contentEs) {
val temp = contentEs[i].text().trim { it <= ' ' } val temp = item.text().trim { it <= ' ' }
if (!isEmpty(temp)) { if (!isEmpty(temp)) {
textS.add(temp) tn.add(temp)
} }
} }
textS.add(join("\n", tn))
} }
"ownText", "html" -> { "ownText", "html" -> {
elements.select("script").remove() elements.select("script").remove()

Loading…
Cancel
Save