|
|
@ -138,17 +138,28 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun clHtml(content: String): String { |
|
|
|
fun clHtml(content: String): String { |
|
|
|
return if (content.contains("<style>".toRegex())) { |
|
|
|
return when { |
|
|
|
content |
|
|
|
!rssSource?.style.isNullOrEmpty() -> { |
|
|
|
} else { |
|
|
|
""" |
|
|
|
""" |
|
|
|
<style> |
|
|
|
<style> |
|
|
|
${rssSource?.style} |
|
|
|
img{max-width:100% !important; width:auto; height:auto;} |
|
|
|
</style> |
|
|
|
video{object-fit:fill; max-width:100% !important; width:auto; height:auto;} |
|
|
|
$content |
|
|
|
body{word-wrap:break-word; height:auto;max-width: 100%; width:auto;} |
|
|
|
""".trimIndent() |
|
|
|
</style> |
|
|
|
} |
|
|
|
$content |
|
|
|
content.contains("<style>".toRegex()) -> { |
|
|
|
""".trimIndent() |
|
|
|
content |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else -> { |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
<style> |
|
|
|
|
|
|
|
img{max-width:100% !important; width:auto; height:auto;} |
|
|
|
|
|
|
|
video{object-fit:fill; max-width:100% !important; width:auto; height:auto;} |
|
|
|
|
|
|
|
body{word-wrap:break-word; height:auto;max-width: 100%; width:auto;} |
|
|
|
|
|
|
|
</style> |
|
|
|
|
|
|
|
$content |
|
|
|
|
|
|
|
""".trimIndent() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|