mirror of
https://github.com/gedoor/legado.git
synced 2024-07-04 23:36:56 +08:00
优化
This commit is contained in:
parent
2f2ba9a751
commit
e081b4b470
|
@ -188,6 +188,7 @@ class ContentProcessor private constructor(
|
||||||
mContent = mContent.replace('\u00A0', ' ')
|
mContent = mContent.replace('\u00A0', ' ')
|
||||||
}
|
}
|
||||||
val contents = arrayListOf<String>()
|
val contents = arrayListOf<String>()
|
||||||
|
val paragraphIndent = ReadBookConfig.paragraphIndent
|
||||||
mContent.split("\n").forEach { str ->
|
mContent.split("\n").forEach { str ->
|
||||||
val paragraph = str.trim {
|
val paragraph = str.trim {
|
||||||
it.code <= 0x20 || it == ' '
|
it.code <= 0x20 || it == ' '
|
||||||
|
@ -196,10 +197,14 @@ class ContentProcessor private constructor(
|
||||||
if (contents.isEmpty() && includeTitle) {
|
if (contents.isEmpty() && includeTitle) {
|
||||||
contents.add(paragraph)
|
contents.add(paragraph)
|
||||||
} else {
|
} else {
|
||||||
contents.add("${ReadBookConfig.paragraphIndent}$paragraph")
|
contents.add("$paragraphIndent$paragraph")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (contents.isEmpty()) {
|
||||||
|
contents.add("${paragraphIndent}加载正文失败")
|
||||||
|
contents.add("${paragraphIndent}内容处理后为空")
|
||||||
|
}
|
||||||
return BookContent(sameTitleRemoved, contents, effectiveReplaceRules)
|
return BookContent(sameTitleRemoved, contents, effectiveReplaceRules)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user