优化
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user