From 3d237680309bc01d827e2123c982f17381a13409 Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Sun, 18 Jul 2021 18:29:27 +0800 Subject: [PATCH] Update HtmlFormatter.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正 --- app/src/main/java/io/legado/app/utils/HtmlFormatter.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt b/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt index 3e6fa92b1..72c7c252f 100644 --- a/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt +++ b/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt @@ -50,10 +50,10 @@ object HtmlFormatter { var appendPos0 = 0 val matcher0 = Pattern.compile("]*src *= *\"([^\"]+)\"[^>]*>", Pattern.CASE_INSENSITIVE).matcher(strBefore) //格式化普通图片标签 while (matcher0.find()) { - val strBefore0 = strBefore.substring(appendPos0, matcher.start()) + val strBefore0 = strBefore.substring(appendPos0, matcher0.start()) sb.append( if (strBefore0.isBlank()) strBefore0 else strBefore0.replace("\n","\n  ")) - sb.append("") - appendPos0 = matcher.end() + sb.append("") + appendPos0 = matcher0.end() } strBefore = if (appendPos0 < strBefore.length) strBefore.substring(appendPos0, strBefore.length) else "" }