-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Linkify comments #504
Linkify comments #504
Conversation
@aakash2330 is attempting to deploy a commit to the Elegance Team on Vercel. A member of the Team first needs to authorize it. |
const parts = text.split(urlPattern); | ||
return parts.map((part, index) => { | ||
if (part.match(urlPattern)) { | ||
return <a href={part} key={index} target="_blank" rel="noopener noreferrer" className="hover:underline">{part}</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.
I would also recommend adding a "nofollow" to the rel
attribute to avoid link spammers.
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.
Hey @aakash2330, excited to help with your PR code review!
-
Thinking about making the
<LinkifyText />
component even more modular by moving it to thepackages/ui
module. What do you think? Also, we can tweak the filename to match the component name, maybe something likelinkify-text
. -
Noticed the Hyperlink Links in Comments #431 issue author mentioned an ideal scenario: allowing URLs without protocols to transform into hyperlinks.
ideally not even requiring entering https:// but open to having that if it makes this easier
Currently, it seems to support only
http(s)
protocols. Any challenges with this? Maybe check out existing solutions like linkify.js.org? Let me know your thoughts! 😊
Hey @tuffz @unrenamed thanks for reviewing my pr . 1 . Added the "nofollow" to the rel attribute as suggested by @tuffz . |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks a lot for the PR @aakash2330 + feedback from @tuffz & @unrenamed 🙏 re: |
No top level dependency changes detected. Learn more about Socket for GitHub ↗︎ |
@steven-tey added linkifyjs to support more URL protocols as well as allowing URLs without protocols to transform into hyperlinks. |
Great work on this PR @aakash2330 – also shoutout to @unrenamed for the linkify tip as well! Will be merging this now – also updated our changelog & help docs to include this too :) |
Hyperlink Links in Comments #431
Turn Links within comments clickable .
(Please ignore the first commit )