From a0e0dfd9eab567902f36b4bb315770e02a0367a3 Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Sun, 18 Jul 2021 20:35:29 +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 | 1 + 1 file changed, 1 insertion(+) 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 990422fa8..65ed42b80 100644 --- a/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt +++ b/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt @@ -24,6 +24,7 @@ object HtmlFormatter { html ?: return "" val keepImgHtml = html.replace(wrapHtmlRegex, "\n") .replace(notImgHtmlRegex, "") + .replace("\\n\\s*$|^\\s*\\n".toRegex(), "") .replace("\\n\\s*\\n|\\n\\s*$|^\\s*\\n".toRegex(), "\n") var str = StringBuffer()