talklittle / reddit-is-fun

OLD VERSION 1.3 of reddit is fun -- Android app to interact with reddit.com
GNU General Public License v3.0
370 stars 158 forks source link

Markdown links #4

Closed talklittle closed 14 years ago

talklittle commented 14 years ago

Markdown needs to be at least partially implemented. For hyperlinks, bold, italics at least. (Not quite sure how hyperlinks would be done, since if they don't appear in the string, we might need to change behavior away from Android built-in "autoLink" feature.)

I'm not sure if using SpannableStringBuilder on every comment would be too slow. From comments on the Internet it looks like using WebViews for comments would definitely be too slow. So leave as TextViews for sure.

EDIT: Yes, markdown is SLOW for long comments (during JSON parse phase) EDIT2: It's now acceptable speed using dk.brics.automaton

talklittle commented 14 years ago

I just pushed the hyperlink markdown code, heavily borrowed from MarkdownJ. Started with links since they were the ugliest. Not yet uploaded to Android Market.

TODO: fix ordering of links (right now, markdown links and autolinks are segregated. They should show up in the popup in correct order by offset index)

talklittle commented 14 years ago

ordering of links is fixed.

talklittle commented 14 years ago

Adding "bug" label for now because markdown is SLOW for long comments (during JSON parse phase)

talklittle commented 14 years ago

Replaced the main markdown hyperlink regexes with faster ones from package dk.brics.automaton. Now the speed is acceptable. Unfortunately this adds about 150 KB to the package size.