SeriesGuide icon indicating copy to clipboard operation
SeriesGuide copied to clipboard

Trim multiple consecutive spaces in text

Open JohnVeness opened this issue 2 years ago • 2 comments

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):

  • Device: FxTec Pro1
  • OS: Android 9.0
  • Browser: Firefox 106.1.0
  • SeriesGuide Version: 65.0.5

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.

JohnVeness avatar Oct 20 '22 22:10 JohnVeness

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).

UweTrottmann avatar Nov 10 '22 07:11 UweTrottmann

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.

JohnVeness avatar Nov 10 '22 12:11 JohnVeness