glebpopov/Hacker-News-Droid-App — Issue #10: Preformatted text in comments is a mess
Author: suan
Created: 2012-02-24 06:33:01+00:00
State: open

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 `

` or `` 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")