ericberman / MyFlightbookAndroid

Android client app for MyFlightbook.com
http://myflightbook.com
GNU General Public License v3.0
21 stars 8 forks source link

Need to encode comments before linkifying #292

Closed ericberman closed 1 year ago

ericberman commented 1 year ago

E.g., if a comment has "Altitude < 14k", the "< 14k" part doesn't show.

ericberman commented 1 year ago

Hmmm…it’s actually deeper than that, and it’s not related to the HTML stuff. I’m actually getting “alt < 14K” down the wire, but at that point, I’m doing the following transformations, the reasons for which are likely lost to the mists of time:

szComments = HtmlCompat.fromHtml(readNullableString(so, "Comment"), HtmlCompat.FROM_HTML_MODE_LEGACY).toString() I.e., “readNullableString is returning “High alt < 14k…” just fine. But I think what I’m doing here is trying to extract plain text out of potential HTML, and so HtmlCompat.fromHtml (an Android based function) is giving up after the “<”. What I don’t recall is why I think there’s even a possibility of getting html. I don’t store HTML on the server (at least not flagged as such).

This is going to be a deeper dive than I had realized to fix. Trivial to remove the “fromHtml” call, but a lot harder to figure out why it was there in the first place…