pull/478/head
gedoor 4 years ago
parent 8728d4cba1
commit 4c74c85566
  1. 8
      app/src/main/java/io/legado/app/help/ContentProcessor.kt

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

Loading…
Cancel
Save