From 5c89c3953929fd491d7f5ecc464cdd68fabf8079 Mon Sep 17 00:00:00 2001 From: bushixuanqi <2208877960@qq.com> Date: Sun, 18 Jul 2021 13:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= 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 | 7 ++++--- 1 file changed, 4 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 a15cbedcf..87feb374a 100644 --- a/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt +++ b/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt @@ -34,9 +34,10 @@ object HtmlFormatter { while (matcher.find()) { val url = matcher.group(1)!! val urlBefore = url.substringBefore(',') + val StrBefore = keepImgHtml.substring(appendPos, matcher.start()) sb.append( - keepImgHtml.substring(appendPos, matcher.start()).replace("\n", "\n  ") - ) //缩进换行下个非图片段落 + if(StrBefore.isBlank()) StrBefore else StrBefore.replace("\n", "\n  ") //缩进图片之间的非空白段落 + ) sb.append( "