-
Notifications
You must be signed in to change notification settings - Fork 877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix raw HTML in video descriptions #3946
Conversation
Where in FreeTube did you find those hashtags parsed to links? I tried both the search results and on the channel page, with both the local and Invidious API (restarting in between, so it didn't use the search results cache), they all just have pure text hashtags (no raw html or links). I checked that I'm definitely on this branch because the source code uses v-html instead of the escaped syntax. |
@absidue I'm glad you brought this up, because it seems like it's Occam's razor saving the day: weirdly enough, YT just doesn't HTML-ify hashtag links on those screens, so ours don't either. I'm not aware on the top of my head how Invidious and our local API grab data for the History section, but that apparently does pass the HTML-ified links, and this change fixes the bug in both cases. You can test with this video. So, needless to say, this fixes the issue of when we do get that information, but YouTube is just simply not treating most things as links in descriptions. Additionally, the only links YouTube cares to HTML-ify at the moment are hashtag links, so I'll add that clarification. |
The history page only uses cached data, so if the video is marked watched from the watch page, it uses the watch page description which contains links and formatting, however if you marked it as watched from a video list, it only uses the short description snippet that YouTube provides in its search/channel/trending/other API response, which doesn't contain any links. (I have watch history disabled, not for privacy reasons, it's just an annoyance to me, so this is an issue I would never have noticed without you mentioning it 🙈). |
Thanks for the info! Yeah, I don't end up using it much, but it seems like grid vs list view and the history section keep coming up in usability testing. Is there anything that should be altered in this PR before moving forward? |
Haven't tested it yet but the code looks good, please don't let my review hold back anyone else's. |
@jasonhenriquez My steps:
|
I'm so sorry for that, thank you for the call-out! I will make sure to put replication steps for these types of issues going forward. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* development: (65 commits) Make constants imported from @fortawesome/free-solid-svg-icons ordered by name again (FreeTubeApp#3958) Replace labeler workflow with GH labeler (FreeTubeApp#3966) Fix HTML styling (e.g., hashtag links) showing up as raw HTML in descriptions (FreeTubeApp#3946) Make certain controls non-selectable / non-draggable - Part II (FreeTubeApp#3957) Translated using Weblate (German) Show video list buttons on hover or focus (FreeTubeApp#3954) Bump @babel/eslint-parser from 7.22.10 to 7.22.11 (FreeTubeApp#3962) Bump youtubei.js from 6.0.0 to 6.1.0 (FreeTubeApp#3965) Bump eslint-plugin-n from 16.0.1 to 16.0.2 (FreeTubeApp#3964) Bump eslint from 8.47.0 to 8.48.0 (FreeTubeApp#3963) Bump marked from 7.0.4 to 7.0.5 (FreeTubeApp#3961) Bump @babel/core from 7.22.10 to 7.22.11 (FreeTubeApp#3959) Make certain controls non-selectable / non-draggable (FreeTubeApp#3947) Add updated video resolution to auto selector (FreeTubeApp#3935) Fix Save icon blocking issue (FreeTubeApp#3951) * Update URL parser to recognize youtube.com/live/xxxxxxx (FreeTubeApp#3930) Translated using Weblate (Czech) Translated using Weblate (Portuguese) Translated using Weblate (Polish) Translated using Weblate (Arabic) ... # Conflicts: # src/renderer/main.js # src/renderer/scss-partials/_ft-list-item.scss
* feature/playlist-2023-05: (77 commits) * Update add to playlist prompt to add sort options ! Fix user playlist view incorrectly sorted playlists by latest updated first when filtered ! Fix add to play prompt max width * Update sorting options labels Make constants imported from @fortawesome/free-solid-svg-icons ordered by name again (FreeTubeApp#3958) Replace labeler workflow with GH labeler (FreeTubeApp#3966) ! Fix unable to visit previous video when playing first video in a playlist * Update upcoming video to allow saving in playlist * Show filtering input & sorting element when no. of playlist > 1 Fix HTML styling (e.g., hashtag links) showing up as raw HTML in descriptions (FreeTubeApp#3946) Make certain controls non-selectable / non-draggable - Part II (FreeTubeApp#3957) Translated using Weblate (German) Show video list buttons on hover or focus (FreeTubeApp#3954) Bump @babel/eslint-parser from 7.22.10 to 7.22.11 (FreeTubeApp#3962) Bump youtubei.js from 6.0.0 to 6.1.0 (FreeTubeApp#3965) Bump eslint-plugin-n from 16.0.1 to 16.0.2 (FreeTubeApp#3964) Bump eslint from 8.47.0 to 8.48.0 (FreeTubeApp#3963) Bump marked from 7.0.4 to 7.0.5 (FreeTubeApp#3961) Bump @babel/core from 7.22.10 to 7.22.11 (FreeTubeApp#3959) Make certain controls non-selectable / non-draggable (FreeTubeApp#3947) ...
Fix raw HTML in video descriptions
Pull Request Type
Related issue
closes #3945
Description
Updates channel and video descriptions to use
v-html
instead of passing the text as-is, thus resolving issues with links, etc. being displayed as raw HTML.Edit: As far as I can see, this currently only seems to apply to hashtag links in video descriptions in the History section, because YT itself does not display any HTML in its video descriptions on its main site. That said, this should also futureproof us if/when they send more links or data in descriptions in HTML form.
Screenshots
Before:
After:
Testing
Replication steps (thank you to @PikachuEXE):
Desktop