https://kotlinlang.org logo
#compose
Title
# compose
m

myanmarking

01/04/2022, 12:13 PM
can any1 recommend a library for html text strings ?
b

Big Chungus

01/04/2022, 12:20 PM
kotlinx.html?
Are you after generating html or parsing html?
m

myanmarking

01/04/2022, 12:20 PM
parsing xml
<b>SomeText</> other text
b

Big Chungus

01/04/2022, 12:21 PM
I'm not aware of any kotlin-first HTML parsers out there.
You could try kotlinx.serialization with https://github.com/pdvrieze/xmlutil though
m

myanmarking

01/04/2022, 12:35 PM
this is compose channel. What i need is a text composable that parses xml strings into annotated strings. I’m sure some1 already has sth like that
b

Big Chungus

01/04/2022, 12:37 PM
I see. Your question could be a bit more clearly phrased then 😄 What you're after is a library for parsing rich text.
m

myanmarking

01/04/2022, 12:38 PM
ya sorry. This is compose channel so i would assume this was what i was looking for. What you suggested is kinda outside compose 😛 more related to kotlin
b

Big Chungus

01/04/2022, 12:38 PM
Indeed. I answered your question without #compose in the context.
c

Casey Brooks

01/04/2022, 3:02 PM
If you're not completely bought-in to XML as the "annotated string" format, you could try my library Thistle as an alternative syntax
m

myanmarking

01/04/2022, 3:04 PM
ya. but i already have xml annotated string. I cannot change atm unfortunatly
m

Michael Paus

01/04/2022, 6:30 PM
@myanmarking Just out of curiosity. In which context do you use “atm”. In my context this stands for Air Traffic Management.
m

myanmarking

01/04/2022, 6:32 PM
i just use atm to mean ‘at the moment’ 😛
🙃 1
b

Big Chungus

01/04/2022, 6:45 PM
AnTiMatter? 😀
m

myanmarking

01/04/2022, 7:00 PM
aha
g

gildor

01/05/2022, 2:06 AM
I never heard of ready to use solution, also really depends on what kind html you have. Probably this article will be useful, it shows how to create simple markdown support, which looks similar, also it easier for html/xml than for markdown https://www.hellsoft.se/rendering-markdown-with-jetpack-compose/
8 Views