pull/32/head
kunfei 5 years ago
parent cc7816949f
commit 190eb6eff5
  1. 8
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt
  2. 4
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt
  3. 8
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByXPath.kt

@ -62,17 +62,17 @@ class AnalyzeByJSonPath {
return result
}
} else {
val sb = StringBuilder()
val textList = arrayListOf<String>()
for (rl in rules) {
val temp = getString(rl)
if (!TextUtils.isEmpty(temp)) {
sb.append(temp)
if (!temp.isNullOrEmpty()) {
textList.add(temp)
if (elementsType == "|") {
break
}
}
}
return sb.toString()
return TextUtils.join(",", textList)
}
}

@ -75,7 +75,7 @@ class AnalyzeByJSoup {
//拆分规则
val sourceRule = SourceRule(ruleStr)
if (isEmpty(sourceRule.elementsRule)) {
textS.add(element!!.data())
textS.add(element?.data() ?: "")
} else {
val elementsType: String
val ruleStrS: Array<String>
@ -105,7 +105,7 @@ class AnalyzeByJSoup {
} else {
getResultList(ruleStrX)
}
if (temp != null && temp.isNotEmpty()) {
if (!temp.isNullOrEmpty()) {
results.add(temp)
if (results.isNotEmpty() && elementsType == "|") {
break

@ -154,17 +154,17 @@ class AnalyzeByXPath {
}
return null
} else {
val sb = StringBuilder()
val textList = arrayListOf<String>()
for (rl in rules) {
val temp = getString(rl)
if (!TextUtils.isEmpty(temp)) {
sb.append(temp)
if (!temp.isNullOrEmpty()) {
textList.add(temp)
if (elementsType == "|") {
break
}
}
}
return sb.toString()
return TextUtils.join(",", textList)
}
}
}

Loading…
Cancel
Save