mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -80,7 +80,8 @@ object ReplaceRuleController {
|
||||
if (rule.isRegex) {
|
||||
text.replace(
|
||||
rule.pattern.toRegex(),
|
||||
rule.replacement, rule.timeoutMillisecond
|
||||
rule.replacement,
|
||||
rule.getValidTimeoutMillisecond()
|
||||
)
|
||||
} else {
|
||||
text.replace(rule.pattern, rule.replacement)
|
||||
|
||||
@@ -103,7 +103,7 @@ data class BookChapter(
|
||||
displayTitle.replace(
|
||||
item.pattern.toRegex(),
|
||||
item.replacement,
|
||||
item.timeoutMillisecond
|
||||
item.getValidTimeoutMillisecond()
|
||||
)
|
||||
} else {
|
||||
displayTitle.replace(item.pattern, item.replacement)
|
||||
|
||||
@@ -88,6 +88,7 @@ data class ReplaceRule(
|
||||
return true
|
||||
}
|
||||
|
||||
@Throws(NoStackTraceException::class)
|
||||
fun checkValid() {
|
||||
if (!isValid()) {
|
||||
throw NoStackTraceException(appCtx.getString(R.string.replace_rule_invalid))
|
||||
|
||||
@@ -163,7 +163,7 @@ class ContentProcessor private constructor(
|
||||
mContent.replace(
|
||||
item.pattern.toRegex(),
|
||||
item.replacement,
|
||||
item.timeoutMillisecond
|
||||
item.getValidTimeoutMillisecond()
|
||||
)
|
||||
} else {
|
||||
mContent.replace(item.pattern, item.replacement)
|
||||
|
||||
Reference in New Issue
Block a user