From 388d29f445d25c427a0a41251f0e780892703324 Mon Sep 17 00:00:00 2001
From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com>
Date: Sun, 25 Jul 2021 08:18:01 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
将“[^"]*”之后的正则更改为"开头,避免出现前面的正则抢占后面正则匹配的序列,导致带参数的图片“捕获分组1”得到的链接不包含全部参数的问题。
---
app/src/main/java/io/legado/app/constant/AppPattern.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/java/io/legado/app/constant/AppPattern.kt b/app/src/main/java/io/legado/app/constant/AppPattern.kt
index c19b229ec..006a4224f 100644
--- a/app/src/main/java/io/legado/app/constant/AppPattern.kt
+++ b/app/src/main/java/io/legado/app/constant/AppPattern.kt
@@ -9,7 +9,7 @@ object AppPattern {
val EXP_PATTERN: Pattern = Pattern.compile("\\{\\{([\\w\\W]*?)\\}\\}")
//匹配格式化后的图片格式
- val imgPattern: Pattern = Pattern.compile("]*src=\"([^\"]*(?:,\\{[^>]+\\})?)\"[^>]*>")
+ val imgPattern: Pattern = Pattern.compile("]*src=\"([^\"]*(?:\"[^>]+\\})?)\"[^>]*>")
val nameRegex = Regex("\\s+作\\s*者.*|\\s+\\S+\\s+著")
val authorRegex = Regex("^.*?作\\s*者[::\\s]*|\\s+著")