diff --git a/app/src/main/java/io/legado/app/model/webBook/BookContent.kt b/app/src/main/java/io/legado/app/model/webBook/BookContent.kt index 9e5336b62..b17c5e4ff 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookContent.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookContent.kt @@ -97,11 +97,9 @@ object BookContent { } content.deleteCharAt(content.length - 1) var contentStr = content.toString().htmlFormat() - val replaceRegex = bookSource.ruleContent?.replaceRegex - replaceRegex?.trim { it <= ' ' }?.split("##")?.let { - if (it.size > 1) { - contentStr = contentStr.replace(it[1].toRegex(), it.getOrNull(2) ?: "") - } + val replaceRegex = bookSource.ruleContent?.replaceRegex?.trim() + if (!replaceRegex.isNullOrEmpty()) { + contentStr = AnalyzeRule(book).setContent(contentStr).getString(replaceRegex) } Debug.log(bookSource.bookSourceUrl, "┌获取章节名称") Debug.log(bookSource.bookSourceUrl, "└${bookChapter.title}")