feat: 优化

pull/209/head
kunfei 5 years ago
parent bcb0d592e3
commit 2a4fbce079
  1. 3
      app/src/main/java/io/legado/app/help/BookHelp.kt

@ -241,9 +241,10 @@ object BookHelp {
val contents = arrayListOf<String>() val contents = arrayListOf<String>()
c.split("\n").forEach { c.split("\n").forEach {
val str = it.replace("^\\s+".toRegex(), "") val str = it.replace("^\\s+".toRegex(), "")
.replace("\r", "")
if (contents.isEmpty()) { if (contents.isEmpty()) {
contents.add(title) contents.add(title)
if (it != title && it.isNotEmpty()) { if (str != title && it.isNotEmpty()) {
contents.add("${ReadBookConfig.bodyIndent}$str") contents.add("${ReadBookConfig.bodyIndent}$str")
} }
} else if (str.isNotEmpty()) { } else if (str.isNotEmpty()) {

Loading…
Cancel
Save