I have a string that contains html, how can I display this in a Jetpack compose Text?
In a TextView I would use a Spanned and do something like:
TextView.setText(Html.fromHtml("<p>something", HtmlCompat.FROM_HTML_MODE_LEGACY)
How can I do this with Text from Jetpack compose?
There is now an official way since version 1.7.0
of library androidx.compose.ui:ui
Here is a simple example:
Text(AnnotatedString.fromHtml("<b>Bold</b> text"))