-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Feature: Link Twitter handles in the testimonial section #29
Comments
@bdougie Can I take it over? |
@bdougie I used some transformation to replace twitter handles into links : const regex = /(?<=@)\w+/g
const transformParagraph = (paragraph: string) => {
const words = paragraph.split(' ')
const transformedWords = words.map((word) => {
if (word.match(regex)) {
return `<a href="https://twitter.com/${word.replace(
'@',
''
)}" target="_blank" rel="noopener noreferrer">${word}</a>`
}
return word
})
return transformedWords.join(' ')
} After that I tried to use some libraries like markdown-it, marked and others but they transform the string to What are your thoughts about it? |
@takanome-dev Another possible solution could be to show the string content in |
Sorry, I'm not sure I understand what you mean. |
No worries. Let me open a PR for it. .take |
.take |
Thanks for being interested in this issue. It looks like this ticket is already assigned to a contributor. Please communicate with the assigned contributor to confirm the status of the issue. |
But before that, when I forked the repo and clicked on this file there was an issue already (this is not related to my code): This is how I set up the project:
After seeing the error I did the following:
It seems like there is some conflict with TypeScript. My final attempt at solving:
But the error remains: |
Thank you for your work! @wasimapinjari can you open a PR to check it from there? |
@a0m0rajab do you mind fixing this? |
I do not think that this problem would prevent you from opening your PR, but to fix it you can do the next: const transition = { duration: 0.5, delay: 0.2, ease: 'easeInOut', type: 'spring', stiffness: 50 };
return (
<motion.div
ref={refCard}
initial={{ opacity: 0, y: cardInView ? 100 : 0 }}
animate={{ opacity: cardInView ? 1 : 0 , y: cardInView ? 0 : 100 }}
transition={transition}
> or use transition={{ duration: 0.5, delay: 0.2, ease: 'easeInOut', type: 'spring', stiffness: 50} as Transition} |
@a0m0rajab Thanks, this will surely help me in the future if I encounter this type of error next time. 😀 |
You are welcome! it's great to see your contributions! |
Type of feature
🍕 Feature
Current behavior
When viewing testimonials, any @ mentioned uses are not linkable.
Suggested solution
Make them linkable through either a service or sanitizing through markdown.
Additional context
No response
Code of Conduct
Contributing Docs
The text was updated successfully, but these errors were encountered: