mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
ffbd212666
commit
da689a3c4d
@ -108,6 +108,7 @@ class AnalyzeUrl(
|
||||
var start = 0
|
||||
var tmp: String
|
||||
val jsMatcher = JS_PATTERN.matcher(ruleUrl)
|
||||
var hasRule = true
|
||||
while (jsMatcher.find()) {
|
||||
if (jsMatcher.start() > start) {
|
||||
tmp =
|
||||
@ -118,8 +119,11 @@ class AnalyzeUrl(
|
||||
}
|
||||
ruleUrl = evalJS(jsMatcher.group(2) ?: jsMatcher.group(1), ruleUrl) as String
|
||||
start = jsMatcher.end()
|
||||
if (jsMatcher.group(0)!!.startsWith("@js:", true)) {
|
||||
hasRule = false
|
||||
}
|
||||
}
|
||||
if (ruleUrl.length > start) {
|
||||
if (ruleUrl.length > start && hasRule) {
|
||||
tmp = ruleUrl.substring(start).trim { it <= ' ' }
|
||||
if (tmp.isNotEmpty()) {
|
||||
ruleUrl = tmp.replace("@result", ruleUrl)
|
||||
|
Loading…
Reference in New Issue
Block a user