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 2f4e126dc..77eb6ad2a 100644 --- a/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt +++ b/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt @@ -18,12 +18,12 @@ object HtmlFormatter { .replace("\\s*\\n+\\s*".toRegex(), "\n  ") } - fun formatKeepImg(html: String?) = format(html,notImgHtmlRegex) + fun formatKeepImg(html: String?) = format(html, notImgHtmlRegex) fun formatKeepImg(html: String?, redirectUrl: URL?): String { html ?: return "" val sb = StringBuffer() - val matcher = AppPattern.imgPattern.matcher(html) + val matcher = AppPattern.imgPattern.matcher(formatKeepImg(html)) var appendPos = 0 while (matcher.find()) { val urlArray = matcher.group(1)!!.split(AnalyzeUrl.splitUrlRegex) @@ -38,7 +38,7 @@ object HtmlFormatter { if (appendPos < html.length) { sb.append(html.substring(appendPos, html.length)) } - return formatKeepImg(sb.toString()) + return sb.toString() } }