From 3bb91bb5ab5861c916dbe4cc67c33043c72074de Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 29 Jun 2021 20:38:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhtml=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=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/utils/HtmlFormatter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 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 7d11df2b4..129d5018c 100644 --- a/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt +++ b/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt @@ -13,9 +13,9 @@ object HtmlFormatter { html ?: return "" return html.replace(wrapHtmlRegex, "\n") .replace(otherRegex, "") - .replace("^[\\n\\s]*".toRegex(), "  ") - .replace("[\\n\\s]+$".toRegex(), "") .replace("\\s*\\n+\\s*".toRegex(), "\n  ") + .replace("^[\\n\\s]+".toRegex(), "  ") + .replace("[\\n\\s]+$".toRegex(), "") } fun formatKeepImg(html: String?) = format(html, notImgHtmlRegex)