替换净化应该在简繁转换之后进行
This commit is contained in:
@@ -81,6 +81,12 @@ data class BookChapter(
|
||||
): String {
|
||||
var displayTitle = title.replace(AppPattern.rnRegex, "")
|
||||
val mDisplayTitle = displayTitle
|
||||
if (chineseConvert) {
|
||||
when (AppConfig.chineseConverterType) {
|
||||
1 -> displayTitle = ChineseUtils.t2s(displayTitle)
|
||||
2 -> displayTitle = ChineseUtils.s2t(displayTitle)
|
||||
}
|
||||
}
|
||||
if (useReplace && replaceRules != null) {
|
||||
replaceRules.forEach { item ->
|
||||
if (item.pattern.isNotEmpty()) {
|
||||
@@ -97,12 +103,6 @@ data class BookChapter(
|
||||
}
|
||||
}
|
||||
if (displayTitle.isBlank()) displayTitle = mDisplayTitle
|
||||
if (chineseConvert) {
|
||||
when (AppConfig.chineseConverterType) {
|
||||
1 -> displayTitle = ChineseUtils.t2s(displayTitle)
|
||||
2 -> displayTitle = ChineseUtils.s2t(displayTitle)
|
||||
}
|
||||
}
|
||||
return when {
|
||||
!isVip -> displayTitle
|
||||
isPay -> appCtx.getString(R.string.payed_title, displayTitle)
|
||||
|
||||
@@ -77,10 +77,6 @@ class ContentProcessor private constructor(
|
||||
//重新分段
|
||||
mContent = ContentHelp.reSegment(mContent, chapter.title)
|
||||
}
|
||||
if (useReplace && book.getUseReplaceRule()) {
|
||||
//替换
|
||||
mContent = replaceContent(mContent)
|
||||
}
|
||||
if (chineseConvert) {
|
||||
//简繁转换
|
||||
try {
|
||||
@@ -92,6 +88,10 @@ class ContentProcessor private constructor(
|
||||
appCtx.toastOnUi("简繁转换出错")
|
||||
}
|
||||
}
|
||||
if (useReplace && book.getUseReplaceRule()) {
|
||||
//替换
|
||||
mContent = replaceContent(mContent)
|
||||
}
|
||||
if (includeTitle) {
|
||||
//重新添加标题
|
||||
mContent = chapter.getDisplayTitle(getReplaceRules()) + "\n" + mContent
|
||||
|
||||
Reference in New Issue
Block a user