-
Notifications
You must be signed in to change notification settings - Fork 864
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 "mention" in comments was rendered as link with channel URL #3351
Fix "mention" in comments was rendered as link with channel URL #3351
Conversation
src/renderer/helpers/api/local.js
Outdated
// In comments, mention can be `@Channel Name` (not handle, but name) | ||
if (CHANNEL_HANDLE_REGEX.test(trimmedText) || (options.looseChannelNameDetection && /^@/.test(trimmedText))) { | ||
// Extra space at the end due to YT tend to include one space afterward into "channel run" `text` for "mentions" | ||
parsedRuns.push(`<a href="https://www.youtube.com/channel/${endpoint.payload.browseId}">${trimmedText}</a> `) |
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.
Please only add the extra space for the comments mentions, for channel handles, the space is usually in the other text segments, so this creates double spaces in video descriptions e.g. https://youtu.be/QtwEO9aDhHw (taken from #3011 before the local API migration)
14dd653
@absidue Sorry that's me being lazy, updated to extra spaces from original text and add back on output text |
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.
The spacing works correctly now, thanks :). Just a few small code nitpicks.
@absidue Done |
@ChunkyProgrammer @efb4f5ff-1298-471a-8973-3d47447115dc Please review and approve again 🥺. |
* development: Fix extracting chapters with handles from description (FreeTubeApp#3456) * Update video list display & watch page to not use stored watch progress when progress saving disabled (FreeTubeApp#3453) Update invidious-instances.json (FreeTubeApp#3440) Prevent loading for ever in web builds in live chat (FreeTubeApp#3449) Bump postcss from 8.4.21 to 8.4.22 (FreeTubeApp#3435) Bump html-webpack-plugin from 5.5.0 to 5.5.1 (FreeTubeApp#3432) Bump webpack from 5.78.0 to 5.79.0 (FreeTubeApp#3436) Bump sass from 1.61.0 to 1.62.0 (FreeTubeApp#3433) Fix "mention" in comments was rendered as link with channel URL (FreeTubeApp#3351) Fix live premieres being treated as non-live videos (FreeTubeApp#3358) Bump eslint-plugin-vue from 9.10.0 to 9.11.0 (FreeTubeApp#3434) Bump webpack-dev-server from 4.13.2 to 4.13.3 (FreeTubeApp#3437) Bump youtubei.js from 4.2.0 to 4.3.0 (FreeTubeApp#3438) Bump lefthook from 1.3.9 to 1.3.10 (FreeTubeApp#3439)
Pull Request Type
Related issue
N/A
Description
With local API, some mentions (with channel name not channel handle) in comments are rendered as URLs due to incorrect assumption of only channel handle would be displayed
Screenshots
Before fix
After fix
Testing
A. Video comments
B. Video description
Desktop
Additional context