Hi guys, How can we support `html` tag in `Text` ?...
# compose
k
Hi guys, How can we support
html
tag in
Text
?
Copy code
val text = "Your result will be available <strong>shortly</strong>"
Any example/suggestion?
m
I'm working on something for that purpose, it will be out these days. I will share it with you
k
Thanks for the information.
j
I developed something simple for our internal use case to support simple markdown.
j
This comment in issueTracker has a pretty comprehensive solution. You can use whatever styles you need from it. I’ve been using this in my app at work and it works well. This example doesn’t include it, but can be tweaked to support anchor tags as well if needed.
m
I’d just like to point out that this is an Android only solution due to the many Android dependencies.
e
I have a private project that uses jsoup to parse html, plus a custom css parser for styles, and converts it to AnnotatedString, but it's pretty tailored to the specific subset of html that our backend sends. in general html is too varied to handle everything, so just focus on what you need
(even markdown has a variety of different dialects... 😞)