|
|
|
@ -31,13 +31,12 @@ class ContentProcessor(private val bookName: String, private val bookOrigin: Str |
|
|
|
|
var content1 = content |
|
|
|
|
if (book.getUseReplaceRule()) { |
|
|
|
|
replaceRules.forEach { item -> |
|
|
|
|
item.pattern.let { |
|
|
|
|
if (it.isNotEmpty()) { |
|
|
|
|
if (item.pattern.isNotEmpty()) { |
|
|
|
|
try { |
|
|
|
|
content1 = if (item.isRegex) { |
|
|
|
|
content1.replace(it.toRegex(), item.replacement) |
|
|
|
|
content1.replace(item.pattern.toRegex(), item.replacement) |
|
|
|
|
} else { |
|
|
|
|
content1.replace(it, item.replacement) |
|
|
|
|
content1.replace(item.pattern, item.replacement) |
|
|
|
|
} |
|
|
|
|
} catch (e: Exception) { |
|
|
|
|
withContext(Dispatchers.Main) { |
|
|
|
@ -47,7 +46,6 @@ class ContentProcessor(private val bookName: String, private val bookOrigin: Str |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (isRead) { |
|
|
|
|
if (book.getReSegment()) { |
|
|
|
|
content1 = ContentHelp.reSegment(content1, title) |
|
|
|
|