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