Skip to content
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

Merged
merged 3 commits into from Apr 17, 2023

Conversation

PikachuEXE
Copy link
Collaborator

@PikachuEXE PikachuEXE commented Mar 24, 2023

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

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
Screenshot 2023-03-24 at 09 26 09
Screenshot 2023-03-24 at 09 26 26

After fix
Screenshot 2023-03-24 at 09 26 43
Screenshot 2023-03-24 at 09 27 07

Testing

A. Video comments

B. Video description

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 24, 2023 01:36
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 24, 2023
// 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> `)
Copy link
Member

@absidue absidue Mar 30, 2023

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)

before:
before

after:
after

@absidue absidue added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Mar 30, 2023
@PikachuEXE
Copy link
Collaborator Author

@absidue Sorry that's me being lazy, updated to extra spaces from original text and add back on output text

Copy link
Member

@absidue absidue left a 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.

src/renderer/helpers/api/local.js Outdated Show resolved Hide resolved
src/renderer/helpers/api/local.js Outdated Show resolved Hide resolved
@PikachuEXE
Copy link
Collaborator Author

@absidue Done

@PikachuEXE PikachuEXE added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Apr 2, 2023
@absidue
Copy link
Member

absidue commented Apr 7, 2023

@ChunkyProgrammer @efb4f5ff-1298-471a-8973-3d47447115dc Please review and approve again 🥺.

@FreeTubeBot FreeTubeBot merged commit 8be4b0d into FreeTubeApp:development Apr 17, 2023
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Apr 17, 2023
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Apr 21, 2023
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants