|
|
@ -138,9 +138,19 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun clHtml(content: String): String { |
|
|
|
fun clHtml(content: String): String { |
|
|
|
return if (content.contains("<style>".toRegex())) { |
|
|
|
return when { |
|
|
|
|
|
|
|
!rssSource?.style.isNullOrEmpty() -> { |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
<style> |
|
|
|
|
|
|
|
${rssSource?.style} |
|
|
|
|
|
|
|
</style> |
|
|
|
|
|
|
|
$content |
|
|
|
|
|
|
|
""".trimIndent() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
content.contains("<style>".toRegex()) -> { |
|
|
|
content |
|
|
|
content |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
else -> { |
|
|
|
""" |
|
|
|
""" |
|
|
|
<style> |
|
|
|
<style> |
|
|
|
img{max-width:100% !important; width:auto; height:auto;} |
|
|
|
img{max-width:100% !important; width:auto; height:auto;} |
|
|
@ -151,6 +161,7 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application), |
|
|
|
""".trimIndent() |
|
|
|
""".trimIndent() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Synchronized |
|
|
|
@Synchronized |
|
|
|
override fun onInit(status: Int) { |
|
|
|
override fun onInit(status: Int) { |
|
|
|