diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt index d5d9b9b66..c68db66a1 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt @@ -77,15 +77,10 @@ class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_r val url = NetworkUtils.getAbsoluteURL(it.origin, it.link) val html = viewModel.clHtml(content) if (viewModel.rssSource?.loadWithBaseUrl == true) { - webView.loadDataWithBaseURL( - url, - html, - "text/html", - "utf-8", - url - )//不想用baseUrl进else + webView.loadDataWithBaseURL(url, html, "text/html", "utf-8", url)//不想用baseUrl进else } else { - webView.loadData(html, "text/html;charset=utf-8", "utf-8")//经测试可以解决中文乱码 + //webView.loadData(html, "text/html;charset=utf-8", "utf-8")//经测试可以解决中文乱码 + webView.loadDataWithBaseURL(null, html, "text/html;charset=utf-8", "utf-8", url) } } }) diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt index 0ace44358..17b66f41c 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt @@ -86,7 +86,7 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application), } fun clHtml(content: String): String { - return if (content.contains("