From ed759dbe3e02d43ec1834b23ccb28accf310e719 Mon Sep 17 00:00:00 2001 From: syomie Date: Fri, 4 Mar 2022 19:10:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A1=A5=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 减少错误补全 --- app/src/main/java/io/legado/app/help/RuleComplete.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/RuleComplete.kt b/app/src/main/java/io/legado/app/help/RuleComplete.kt index 0984992a5..e90574420 100644 --- a/app/src/main/java/io/legado/app/help/RuleComplete.kt +++ b/app/src/main/java/io/legado/app/help/RuleComplete.kt @@ -49,10 +49,10 @@ object RuleComplete { val imgText: String // 分离尾部规则 - val regexSplit=rules.split("##|,".toRegex(),2) + val regexSplit=rules.split("""##|,\{""".toRegex(),2) val cleanedRule=regexSplit[0] if (regexSplit.size>1){ - splitStr="##|,".toRegex().find(rules)?.value ?: "" + splitStr="""##|,\{""".toRegex().find(rules)?.value ?: "" tailStr = splitStr + regexSplit[1] }else{ tailStr = "" From 74324f71db1fd28210d56fe0109744246c0e0eb8 Mon Sep 17 00:00:00 2001 From: syomie Date: Sat, 5 Mar 2022 13:22:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A1=A5=E5=85=A8at?= =?UTF-8?q?=E7=BB=84null=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/RuleComplete.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/RuleComplete.kt b/app/src/main/java/io/legado/app/help/RuleComplete.kt index e90574420..41afc75ed 100644 --- a/app/src/main/java/io/legado/app/help/RuleComplete.kt +++ b/app/src/main/java/io/legado/app/help/RuleComplete.kt @@ -10,7 +10,7 @@ object RuleComplete { private val notComplete = Regex("""^:|^##|\{\{|@js:||@Json:|\$\.""") // 修正从图片获取信息 - private val fixImgInfo = Regex("""(?<=(^|tag\.|[\+/@>~| &]))img(?\[@?.+\]|\.[-\w]+)?[@/]+text(\(\))?(?\&{2}|%%|\|{2}|$)""") + private val fixImgInfo = Regex("""(?<=(^|tag\.|[\+/@>~| &]))img(?(\[@?.+\]|\.[-\w]+)?)[@/]+text(\(\))?(?\&{2}|%%|\|{2}|$)""") private val isXpath= Regex("^//|^@Xpath:")