manmal/hn-android — pull request #77 by maltzj (2013-11-08 10:18:26+00:00)
Title: Fixed up a bug where newlines weren't getting properly inserted into comments

This has been pissing me off for a while, and I finally realized it was because of how Hacker News embeds their HTML.

Basically, what the structure is that at first there is a `` tag wrapping a bunch of `

` tags, and then a set of `

` wrapping `` tags. Since the previous query just grabbed the direct children of the `.comment` element, this caused the latter type of comment to not have it's proper line breaks inserted because of how the `html` method in Jsoup works.

Anyway, this should fix that problem by just grabbing all the `` tags in the selector and then wrapping all but the first element in `

` tags, which is what the HN website basically does.