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

feat(UI) : Extract urls from comments and link them to their correspoding sites - #1053 #1169

Conversation

MoulinaPradhan
Copy link

Closes- #1053

Used an npm package react-anchorme, which links the comment URLs to their corresponding site.

BREAKING CHANGE

The changes are made in the AlbumDetails file in the UI folder. There are changes in the package.json file due to the installation of the package react-anchorme.

20210612_110739.mp4

@deluan
Copy link
Member

deluan commented Jun 15, 2021

Hey @MoulinaPradhan, thanks for taking a stab at this!

I took a quick look and I see a couple of issues:

  1. You forgot to push the changes to the package.json file
  2. The links should have a "link" color.

But most important: I don't think it is worth to add a new dependency just for this. It would make more sense to create a simple component which could be used in a similar fashion as <Anchorme/>, and this component would basically uses the regex suggested by @metalheim here, and replace matches with a <Link> component, that already handles the styling for us.

What do you think?

@MoulinaPradhan
Copy link
Author

MoulinaPradhan commented Jun 18, 2021

Hi, I have created a component CommentLink, that works in a similar way like and made the changes as suggested.

nav.mp4

…sponding sites

Signed-off-by: Moulina Pradhan <pmoulina76@gmail.com>
@dheerajdlalwani
Copy link
Contributor

Hey @MoulinaPradhan, are you continuing on this PR?

@deluan
Copy link
Member

deluan commented Sep 3, 2021

Hey @MoulinaPradhan, sorry for not giving feedback on this before. The main issue with your implementation is that the comment can contain a mix of text and URL(s). Ex:

We are the best band in town!
Our website: https://theband.com
Buy our music: https://bandcamp.com/theband

In your implementation, you are considering that the comment only contains one URL and nothing more. That would not work with the example above.

deluan added a commit that referenced this pull request Oct 7, 2022
Simple approach, may be extended/enhanced in the future.
@deluan
Copy link
Member

deluan commented Oct 7, 2022

I've finished this up in c530ccf. Thanks for your effort!

@deluan deluan closed this Oct 7, 2022
@github-actions
Copy link

github-actions bot commented Mar 8, 2023

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants