From a2001061171fbd698a092799f528e853affb3604 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 18 Jul 2021 19:46:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/activity_replace_rule.xml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/activity_replace_rule.xml b/app/src/main/res/layout/activity_replace_rule.xml index 8b918b280..b244fc3d9 100644 --- a/app/src/main/res/layout/activity_replace_rule.xml +++ b/app/src/main/res/layout/activity_replace_rule.xml @@ -15,11 +15,17 @@ app:contentLayout="@layout/view_search" app:title="@string/replace_purify" /> - + android:layout_weight="1"> + + + + Date: Sun, 18 Jul 2021 20:18:07 +0800 Subject: [PATCH 2/2] 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