feat: 优化代码

pull/190/head
kunfei 5 years ago
parent 657a8ea159
commit e6502674d4
  1. 6
      app/src/main/java/io/legado/app/help/BookHelp.kt

@ -231,10 +231,16 @@ object BookHelp {
if (!c.substringBefore("\n").contains(title)) {
c = "$title\n$c"
}
try {
when (AppConfig.chineseConverterType) {
1 -> c = ZhConvertBootstrap.newInstance().toSimple(c)
2 -> c = ZhConvertBootstrap.newInstance().toTraditional(c)
}
} catch (e: Exception) {
withContext(Main) {
App.INSTANCE.toast("简繁转换出错")
}
}
return c
.replace("\\s*\\n+\\s*".toRegex(), "\n${ReadBookConfig.bodyIndent}")
}

Loading…
Cancel
Save