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 4417d8fba..f20be3f87 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 @@ -59,10 +59,11 @@ class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_r viewModel.rssArticle?.let { upJavaScriptEnable() val url = NetworkUtils.getAbsoluteURL(it.origin, it.link) + val html = viewModel.clHtml(content) if (viewModel.rssSource?.loadWithBaseUrl == true) { - webView.loadDataWithBaseURL(url, content, "text/html", "utf-8", url) + webView.loadDataWithBaseURL(url, html, "text/html", "utf-8", url) } else { - webView.loadData(content, "text/html", "utf-8") + webView.loadData(html, "text/html", "utf-8") } } }) 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 52c090072..8c6f56279 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 @@ -77,6 +77,19 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application) { } } + fun clHtml(content: String): String { + return """ + + + + + + + $content + + """ + } + interface CallBack { fun upStarMenu() }