mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
fix:错误净化章节标题
This commit is contained in:
parent
c515f0cf58
commit
86f6adba06
@ -80,6 +80,7 @@ data class BookChapter(
|
||||
chineseConvert: Boolean = true,
|
||||
): String {
|
||||
var displayTitle = title.replace(AppPattern.rnRegex, "")
|
||||
val mDisplayTitle = displayTitle
|
||||
if (useReplace && replaceRules != null) {
|
||||
replaceRules.forEach { item ->
|
||||
if (item.pattern.isNotEmpty()) {
|
||||
@ -95,6 +96,7 @@ data class BookChapter(
|
||||
}
|
||||
}
|
||||
}
|
||||
if (displayTitle.isBlank()) displayTitle = mDisplayTitle
|
||||
if (chineseConvert) {
|
||||
when (AppConfig.chineseConverterType) {
|
||||
1 -> displayTitle = ChineseUtils.t2s(displayTitle)
|
||||
|
@ -77,10 +77,6 @@ class ContentProcessor private constructor(
|
||||
//重新分段
|
||||
mContent = ContentHelp.reSegment(mContent, chapter.title)
|
||||
}
|
||||
if (includeTitle) {
|
||||
//重新添加标题
|
||||
mContent = chapter.getDisplayTitle() + "\n" + mContent
|
||||
}
|
||||
if (useReplace && book.getUseReplaceRule()) {
|
||||
//替换
|
||||
mContent = replaceContent(mContent)
|
||||
@ -96,6 +92,10 @@ class ContentProcessor private constructor(
|
||||
appCtx.toastOnUi("简繁转换出错")
|
||||
}
|
||||
}
|
||||
if (includeTitle) {
|
||||
//重新添加标题
|
||||
mContent = chapter.getDisplayTitle() + "\n" + mContent
|
||||
}
|
||||
val contents = arrayListOf<String>()
|
||||
mContent.split("\n").forEach { str ->
|
||||
val paragraph = str.trim {
|
||||
|
Loading…
Reference in New Issue
Block a user