Preformatted text in comments is a mess #10

Open
suan opened this Issue Feb 24, 2012 · 2 comments

Projects

None yet

2 participants

@suan
Contributor
suan commented Feb 24, 2012

Whenever there are preformatted blocks in comments (especially code snippets), its an unreadable mess. My idea is to put in a special tag when a <pre> or <code> tag is detected (like what you do with __BR__) on the API side, and use a monospaced font on the app side.

This doesn't solve the issue of the code block wrapping due to the small width on phones though. To address that one thing that could be done is to embed a simple scrollview with the code block in it when the app displays that comment. Might be hard to ensure that the rest of the comment fits the screen width though...

Another idea would be to have the preformatted text "disappear" off the side of the screen, and if you tap it a scrollview would appear where you can view it properly.

There was an article today thats a good example of why this is needed =) http://news.ycombinator.com/item?id=3625710 (titled "what's wrong with the for loop")

Owner

I was thinking about reverting back to HTML approach..it didn't work out initially that's why I was doing weird stuff with like BR characters. The easiest way would be to have API return HTML and on the app side we just Html.fromHtml when setting TextView value

Contributor
suan commented Feb 25, 2012

Sounds like a good idea. The API is so depdendent on the formatting of the Hacker News HTML anyways, and it seems the other APIs out there just pass along the HTML as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment