From b1d73f9bc231a1405c04c45a4f59c6bd864f7eb9 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 18 Jul 2021 20:18:07 +0800 Subject: [PATCH] HtmlFormatter.kt --- app/src/main/java/io/legado/app/utils/HtmlFormatter.kt | 5 +---- 1 file changed, 1 insertion(+), 4 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 2fa883f4d..10a7659f4 100644 --- a/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt +++ b/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt @@ -22,10 +22,7 @@ object HtmlFormatter { fun formatKeepImg(html: String?, redirectUrl: URL?): String { html ?: return "" - val keepImgHtml = html.replace(wrapHtmlRegex, "\n") - .replace(notImgHtmlRegex, "") - .replace("[\\n\\s]+\$|^[\\n\\s]+".toRegex(), "") - .replace("\\s*\\n+\\s*".toRegex(), "\n") + val keepImgHtml = format(html, notImgHtmlRegex) var str = StringBuffer() var endPos = 0