From f7c0f98214719ad9e531cf972c492579536c099d Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 23 Oct 2020 17:19:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AE=80=E7=B9=81=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E6=B2=A1=E6=9C=89=E8=BD=AC=E6=8D=A2=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/help/BookHelp.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index 59359fbc7..6380d44ed 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -355,16 +355,6 @@ object BookHelp { } } } - try { - when (AppConfig.chineseConverterType) { - 1 -> c = HanLP.convertToSimplifiedChinese(c) - 2 -> c = HanLP.convertToTraditionalChinese(c) - } - } catch (e: Exception) { - withContext(Main) { - App.INSTANCE.toast("简繁转换出错") - } - } val contents = arrayListOf() c.split("\n").forEach { val str = it.replace("^[\\n\\s\\r]+".toRegex(), "") @@ -377,6 +367,16 @@ object BookHelp { contents.add("${ReadBookConfig.paragraphIndent}$str") } } + try { + when (AppConfig.chineseConverterType) { + 1 -> c = HanLP.convertToSimplifiedChinese(c) + 2 -> c = HanLP.convertToTraditionalChinese(c) + } + } catch (e: Exception) { + withContext(Main) { + App.INSTANCE.toast("简繁转换出错") + } + } return contents } } \ No newline at end of file