From 08982358b93130ca7cc9fa6753605cc322b688e1 Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Fri, 23 Jul 2021 18:31:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=AD=A3=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [^>]+ 连"也匹配,当src后有属性时会被匹配多有个属性,现在优化一下。 --- 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 8ff24006c..c19b229ec 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+著")