fix: fail to remove duplicate title when content only has title

pull/1929/head
Xwite 3 years ago
parent a8131d5362
commit 72b0fd5a47
  1. 2
      app/src/main/java/io/legado/app/help/ContentProcessor.kt

@ -85,7 +85,7 @@ class ContentProcessor private constructor(
try { try {
val name = Pattern.quote(book.name) val name = Pattern.quote(book.name)
val title = Pattern.quote(chapter.title) 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, "") mContent = mContent.replace(titleRegex, "")
} catch (e: Exception) { } catch (e: Exception) {
AppLog.put("去除重复标题出错\n${e.localizedMessage}", e) AppLog.put("去除重复标题出错\n${e.localizedMessage}", e)

Loading…
Cancel
Save