pull/783/head
gedoor 4 years ago
parent ad3eca3a55
commit 28623487e5
  1. 4
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt
  2. 5
      app/src/main/java/io/legado/app/utils/StringUtils.kt

@ -231,7 +231,9 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions {
if (result == null) result = ""
val str = kotlin.runCatching {
Entities.unescape(result.toString())
}.getOrDefault(result.toString())
}.getOrElse {
result.toString()
}
if (isUrl) {
return if (str.isBlank()) {
baseUrl ?: ""

@ -214,12 +214,11 @@ object StringUtils {
fun stringToInt(str: String?): Int {
if (str != null) {
val num = fullToHalf(str).replace("\\s+".toRegex(), "")
return try {
return kotlin.runCatching {
Integer.parseInt(num)
} catch (e: Exception) {
}.getOrElse {
chineseNumToInt(num)
}
}
return -1
}

Loading…
Cancel
Save