UweTrottmann / SeriesGuide

Track your favorite TV shows and movies on Android devices.
https://seriesgui.de
Apache License 2.0
1.96k stars 400 forks source link

Trim multiple consecutive spaces in text #883

Open JohnVeness opened 2 years ago

JohnVeness commented 2 years ago

Describe the bug SeriesGuide displays double-spaces in episode descriptions as wider than single-spaces, unlike the TMDB site.

Screenshots SeriesGuide episode with a double space between sentences: Screenshot_20221020-192938

Firefox/TMDB view of same episode - double space is not visible: Screenshot_20221020-192952

For comparison, SeriesGuide episode with a single space between sentences: Screenshot_20221020-193018

Firefox/TMDB view of same episode: Screenshot_20221020-193033

Smartphone (please complete the following information):

Additional context I have been editing descriptions on TMDB to remove double-spaces where I find them, but given that they don't appear on that website (unless in editing mode), this is quite tricky!

It seems TMDB renders spaces in the "normal" HTML manner, where multiple consecutive spaces are reduced down to one. It seems SeriesGuide is rendering them as if they are " " (I haven't actually checked SeriesGuide's code on this).

Given that TMDB is the data source, I think SeriesGuide should match the TMDB rendering rather than the other way round (that is, I'm not minded to suggest TMDB change so that they start displaying multiple spaces when present). In other words, I think SeriesGuide should trim double-spaces (and presumably any multiple number of spaces) within descriptions down to just one, or not replace them with " ", or whatever the cause is for this issue.

I haven't checked if the same problem happens in other fields, such as episode titles, season titles, season descriptions, so you might want to check that.

UweTrottmann commented 1 year ago

Thanks for the detailed report! If it's easy to do I'll do it. But my experience here is limited. I'm not sure if just removing all double spaces does lead to side effects in some languages (right now I could not think of any).

JohnVeness commented 1 year ago

Thanks. Yes, I wouldn't want there to be bad side-effects.

Given that a summary of my report is "render text the same as the TMDB website does", maybe you can reach out to some contacts there? Maybe they can show any code (or pseudocode) they use for processing text before it is output.