Merge remote-tracking branch 'origin/master'

pull/182/head
kunfei 5 years ago
commit a35afa87ad
  1. 1
      app/src/main/java/io/legado/app/help/BookHelp.kt
  2. 2
      app/src/main/java/io/legado/app/help/storage/OldRule.kt
  3. 1
      app/src/main/java/io/legado/app/model/webBook/BookContent.kt

@ -237,6 +237,5 @@ object BookHelp {
} }
return c return c
.replace("\\s*\\n+\\s*".toRegex(), "\n${ReadBookConfig.bodyIndent}") .replace("\\s*\\n+\\s*".toRegex(), "\n${ReadBookConfig.bodyIndent}")
.replace("[\\n\\s]+$".toRegex(), "") //移除尾部空行
} }
} }

@ -19,7 +19,7 @@ object OldRule {
source = GSON.fromJsonObject<BookSource>(json.trim()) source = GSON.fromJsonObject<BookSource>(json.trim())
} }
runCatching { runCatching {
if (source == null || source?.searchUrl.isNullOrBlank()) { if (source == null || source?.ruleToc.isNullOrBlank()) {
source = BookSource().apply { source = BookSource().apply {
val jsonItem = jsonPath.parse(json.trim()) val jsonItem = jsonPath.parse(json.trim())
bookSourceUrl = jsonItem.readString("bookSourceUrl") ?: "" bookSourceUrl = jsonItem.readString("bookSourceUrl") ?: ""

@ -101,6 +101,7 @@ object BookContent {
} }
} }
content.deleteCharAt(content.length - 1)
Debug.log(bookSource.bookSourceUrl, "┌获取章节名称") Debug.log(bookSource.bookSourceUrl, "┌获取章节名称")
Debug.log(bookSource.bookSourceUrl, "${bookChapter.title}") Debug.log(bookSource.bookSourceUrl, "${bookChapter.title}")
Debug.log(bookSource.bookSourceUrl, "┌获取正文内容") Debug.log(bookSource.bookSourceUrl, "┌获取正文内容")

Loading…
Cancel
Save