This commit is contained in:
kunfei
2023-03-19 13:03:40 +08:00
parent f70db7704b
commit df83e24074
4 changed files with 5 additions and 3 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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))

View File

@@ -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)