SimonHalvdansson / Harmonic-HN

Modern Android client for Hacker News
https://play.google.com/store/apps/details?id=com.simon.harmonichackernews
Apache License 2.0
611 stars 40 forks source link

Issue rendering code blocks where words would break unexpetedly #139

Closed naitgacem closed 8 months ago

naitgacem commented 8 months ago

Html.fromHtml() formats code blocks by inserting non-breaking spaces, \u00A0. This made words break unexpectedly since the entire line is considered a single word.

The old behavior was to fit as much as possible on one line, then jump to the next, disregarding word boundaries, which is much harder to read. This reverts non-breaking spaces to regular spaces.

SimonHalvdansson commented 8 months ago

This looks very reasonable - I think I recall being annoyed at this at some point. I'll build this and try it out over the weekend and merge as long as things look good, thanks for you work!

naitgacem commented 8 months ago

At first your workflow wouldn't build because of a linter warning. For now it is suppressed and it builds fine. Feel free to push further commits as I believe I enabled that option.

SimonHalvdansson commented 8 months ago

Managed to verify this on a real comment and was an actual improvement, thanks again! 👍

naitgacem commented 8 months ago

It was a real nuisance for a while. Pleasure to help! Thanks for sharing the app as well.