saket / Dank

Here lies the greatest Reddit app that was never released
https://saket.me/dank
Apache License 2.0
813 stars 134 forks source link

Improve detection of markdown sent by Reddit #8

Open saket opened 5 years ago

saket commented 5 years ago

I decided to parse markdown in the app directly because I thought using custom spans would be easier if the app was in control of parsing markdown. That was a correct assumption, but I soon realized it was a bad idea because markdown on Reddit is a gigantic pile of broken markdown syntaxes. I tried correcting some of them in the app using regex, but is like a losing battle.

I'd like to switch back to using the "processed" markdown HTML that Reddit sends. Android offers an HTML parsing using Html.toHtml(), but it does not let us use custom spans. We'll have to figure out a way to do that.