修复html格式化问题

pull/1090/head
gedoor 3 years ago
parent e9fd3016c8
commit 3bb91bb5ab
  1. 4
      app/src/main/java/io/legado/app/utils/HtmlFormatter.kt

@ -13,9 +13,9 @@ object HtmlFormatter {
html ?: return "" html ?: return ""
return html.replace(wrapHtmlRegex, "\n") return html.replace(wrapHtmlRegex, "\n")
.replace(otherRegex, "") .replace(otherRegex, "")
.replace("^[\\n\\s]*".toRegex(), "  ")
.replace("[\\n\\s]+$".toRegex(), "")
.replace("\\s*\\n+\\s*".toRegex(), "\n  ") .replace("\\s*\\n+\\s*".toRegex(), "\n  ")
.replace("^[\\n\\s]+".toRegex(), "  ")
.replace("[\\n\\s]+$".toRegex(), "")
} }
fun formatKeepImg(html: String?) = format(html, notImgHtmlRegex) fun formatKeepImg(html: String?) = format(html, notImgHtmlRegex)

Loading…
Cancel
Save