Is native markdown coming to Compose? All chatbots...
# compose
u
Is native markdown coming to Compose? All chatbots use it. SwiftUI has it.
m
s
There are multiple 3p Markdown renderers for Compose. The one that's most used is https://halilibo.com/compose-richtext/ and its forks (e.g., used by Claude and OpenAI's Android apps)
u
Well thats the issue, that the 3rd party ones have bugs and limitations and dont move that much By native I meant 1st party sorry, same as the html rendering in Text Consolidating this to 1st party would be helpful
e
Thanks, I hadn't seen them. I created my own based on the JetBrains MD analyzer, it wasn't complicated.
s
There is no 1p markdown renderer and as far as things stand I wouldn't expect one coming any time soon
u
Why not? Is this fundamentally different from annotatedString.fromHtml (or whatever is the api)?
s
Don't shoot the messenger 😁 it's not as simple as that and there are many reasons not to ship an API that is so limited it's useless, so the scope is a lot larger than that
u
Im definitely not pressing anyone 😀 Im just reporting from trenches that ios people press for markdown since its 1st party, android usually presses for html, and the chatbots have collapsed the choice to md, which leaves android with suboptomal 3rd party libs. And thr AI labs wont upstream their forks ever, since its winner takes all now
s
My personal opinion is that Markdown is the better choice as it doesn't let you encode style, only structure, unlike HTML. And I also have my own Markdown renderer that we use extensively in Android Studio's Compose-based UIs. I'd love not having to maintain it myself, but I understand why the Compose team isn't running to — there's a lot of complexity involved and what "Markdown" even means is different for different people. A basic bold + italic + links support can be implemented in 10 minutes by everyone, but anything beyond that starts getting dicey
u
Yea I mean the ios one also doesnt have tables or whatnot
s
Yeah, but that's definitely not enough for a chatbot use case :)
u
Does recycling work for you in the halilibo lib?
s
I do not use it, not sure. As I said I wrote my own renderer for Android Studio use
u
Btw originally I was talking about the simple formatting of descriptions etc, not necessarily every md feature (but there I had the upper hand over ios and managed to land on html)
s
Halil's library is also pretty much in maintenance mode; you may wanna try using OpenAI's fork
u
hmm its ossed? wasnt aware
s
I mean, Halil takes contributions in but he's not actively working on it
u
hmm okay im gonna check it out, but there were major issues with recycling last time i checked
m
FYI, in addition to the ones listed above, there are https://github.com/shivvrat12/markdown-compose and https://github.com/NadeemIqbal/llm-typewriter, both published within the past year.
z
Also fyi the html support in compose just wraps HtmlCompat on Android. Android(x) doesn't support markdown so “native” compose support would have to be entirely from scratch.
u
I'm aware, but the way things are going markdown won for simple formatting
z
Well bringing HTML support to Compose was an uphill battle for a while, believe it or not, and that was trivial compared to what markdown support would require, so i wouldn't hold my breath.
u
Why is this a bigger job than html? The html support its a small subset of whole html anyways. People mostly want text formatting, i..e exactly what the html support does
s
My understanding is that it is mainly a lack of resourcing thing than anything that's preventing this from happening
👍 1
z
What I just said: HTML support is just wrapping whatever support was already in Android. Android(x) doesn't have any markdown support, so it would require doing everything from scratch.
☝️ 1
u
I know, I'm not demanding anything, I'm just saying md won so eventually to support it would be smart
z
I'm not disagreeing with you