pull/2706/head
kunfei 2 years ago
parent 1da18a994f
commit 802515715c
  1. 7
      app/src/main/java/io/legado/app/help/book/ContentProcessor.kt

@ -86,8 +86,11 @@ class ContentProcessor private constructor(
//去除重复标题 //去除重复标题
if (BookHelp.removeSameTitle(book, chapter)) try { if (BookHelp.removeSameTitle(book, chapter)) try {
val name = Pattern.quote(book.name) val name = Pattern.quote(book.name)
val title = Pattern.quote(chapter.title) val title0 = Pattern.quote(chapter.title)
val titleRegex = "^(\\s|\\p{P}|${name})*${title}(\\s)*" val title1 = Pattern.quote(
chapter.getDisplayTitle(contentReplaceRules, chineseConvert = false)
)
val titleRegex = "^(\\s|\\p{P}|${name})*(${title0}|${title1})(\\s)*"
val matcher = Pattern.compile(titleRegex) val matcher = Pattern.compile(titleRegex)
.matcher(mContent) .matcher(mContent)
if (matcher.find()) { if (matcher.find()) {

Loading…
Cancel
Save