From 72b0fd5a4700d69de5c3e81a7609d973ce5bb7d3 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Tue, 31 May 2022 14:04:18 +0800 Subject: [PATCH] fix: fail to remove duplicate title when content only has title --- app/src/main/java/io/legado/app/help/ContentProcessor.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/ContentProcessor.kt b/app/src/main/java/io/legado/app/help/ContentProcessor.kt index 466b348a6..d479a58f8 100644 --- a/app/src/main/java/io/legado/app/help/ContentProcessor.kt +++ b/app/src/main/java/io/legado/app/help/ContentProcessor.kt @@ -85,7 +85,7 @@ class ContentProcessor private constructor( try { val name = Pattern.quote(book.name) val title = Pattern.quote(chapter.title) - val titleRegex = "^(\\s|\\p{P}|${name})*${title}(\\s)+".toRegex() + val titleRegex = "^(\\s|\\p{P}|${name})*${title}(\\s)*".toRegex() mContent = mContent.replace(titleRegex, "") } catch (e: Exception) { AppLog.put("去除重复标题出错\n${e.localizedMessage}", e)