darklinkpower / PlayniteExtensionsCollection

Collection of extensions made for Playnite.
MIT License
331 stars 29 forks source link

[Steam News and Players Viewer] Body text formatting is being lost due to Steam specific XML RSS Feed formatting. #444

Closed Jas-SinghFSU closed 1 year ago

Jas-SinghFSU commented 1 year ago

Extension name

Steam News and Players Viewer

Bug Description

The News section doesn't seem to apply formatting such as Headers because the XML RSS Feed formatting data from Steam contains Steam specific styling. Headers are using styled divs <div class="bb_h1"> instead of the standard headers <h1>. This means that unless the extension has imported all of the styling, then the body text just displays as regular text; without the formatting.

I have found a JSON RSS Feed for Steam news https://api.steampowered.com/ISteamNews/GetNewsForApp/v0002/?appid=899770&count=20

The documentation for the API can be found here https://partner.steamgames.com/doc/webapi/ISteamNews . The documentation also contains a list of all URL parameters supported the API.

You'll notice that the body text in this contains standard formatting that is not specific to Steam so this can be plugged in and used anywhere. Hopefully this is sufficient enough to fix the formatting issues.

To Reproduce

Open any game that has Steam news. Click the link at the bottom of the news to open in the browser. Notice that the browser shows proper formatting for news that contains things such as header. Meanwhile the same news in the extension has no formatting.

Screenshots

Notice how the Headers display properly in this snippet of news.

Correct News Formatting

Notice that the same Headers from above are not formatted properly here. All formatting is lost and all text looks the same.

Incorrect Extension Formatting - Notice the Headers

darklinkpower commented 1 year ago

Done with https://github.com/darklinkpower/PlayniteExtensionsCollection/commit/39ef67e61a956a3c2fb6f16b1d418a19f17198d1 and https://github.com/darklinkpower/PlayniteExtensionsCollection/commit/d5ba01987c21e161f6770e9b7bd824d195966935

I reworked the extension to use that API endpoint but at the end of it I saw why I didn't use it initially: The news is in bbcode, which is very difficult to convert to html to display in the extension and had to rework it to use the current RSS method.

Please let me know if it's displaying as it should to close the issue.

Jas-SinghFSU commented 1 year ago

Apologies for the late reply. Yes, all the formatting seems to be spot on now. Thank you for such a quick turnaround!

darklinkpower commented 1 year ago

No worries, thanks for confirming it

Jas-SinghFSU commented 1 year ago

It seems that for certain games (Diablo IV) almost all of the formatting is replaced by an underline. I just discovered this today. Screenshot 2023-11-02 215353

darklinkpower commented 1 year ago

That discrepancy is from Steam itself, the source the extension uses is setting the underline: https://store.steampowered.com/feeds/news/app/2344520/l=english

image

And checking the game community hub, it seems they also have this discrepancy where it shows like this before opening:

image

Jas-SinghFSU commented 1 year ago

Ah gotcha, yea in that case that's on Steam then. Tough to "guess" when their underlines are incorrect so nothing to fix here I suppose.