From 21a3fb70f9cb60ba78a0223a0de17d99a75578e5 Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 2 Sep 2021 22:58:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=B8=8D=E5=86=8D=E9=98=BB?= =?UTF-8?q?=E5=A1=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/ContentProcessor.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 ac1521ea3..7c973633e 100644 --- a/app/src/main/java/io/legado/app/help/ContentProcessor.kt +++ b/app/src/main/java/io/legado/app/help/ContentProcessor.kt @@ -34,7 +34,7 @@ class ContentProcessor private constructor( } - private var replaceRules = arrayListOf() + private val replaceRules = arrayListOf() init { upReplaceRules() @@ -47,6 +47,10 @@ class ContentProcessor private constructor( } @Synchronized + fun getReplaceRules(): Array { + return replaceRules.toTypedArray() + } + fun getContent( book: Book, title: String, //已经经过简繁转换 @@ -56,7 +60,7 @@ class ContentProcessor private constructor( ): List { var content1 = content if (useReplace) { - replaceRules.forEach { item -> + getReplaceRules().forEach { item -> if (item.pattern.isNotEmpty()) { try { content1 = if (item.isRegex) {