-
Notifications
You must be signed in to change notification settings - Fork 106
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
The properties don't work when in Semantic UI <Comments> #78
Comments
really could use the ability to set target to _blank 😬 |
anybody find a solution? |
Solution:
|
@steverecio Good solution! |
@steverecio Thank you! |
@steverecio Really helpful. Many thanks |
This bug was introduced in 1.0.0-alpha. Release 0.2.2 does not have this issue. |
Thanks @steverecio, this solution saved the day! This is what I ended up with to get noopener and punycode going:
|
Seems properties doesn't work at all. Maybe it's missing to pass them to the default componentDecorator. |
react-linkify v1.0.0-alpha has a bug that `properties` doesn't work. This is a workaround to specify target for now. tasti/react-linkify#78 (comment)
You can create a decorator like some of the other comments here have mentioned. If you want to open new tabs securely, especially if the links are leaving the site you control, I suggest implementing the following: TypeScript supported CodeSandbox: https://codesandbox.io/s/cool-montalcini-vkmtb?file=/src/App.tsx
...then... import { SecureLink } from "react-secure-link"
<Linkify componentDecorator={(decoratedHref, decoratedText, key) => (
<SecureLink href={decoratedHref} key={key}>{decoratedText}</SecureLink>
)}>
Here is a link that will open securely in a new tab: www.github.com.
</Linkify> |
@dbudwin is the gist here to add |
@steverecio yes, that's effectively what it does. Just abstracts away the "how" of creating a secure link in a new tab. Nothing fancy. |
I'm using Semantic UI to output a users comment and want to convert any links they enter innto hyperlniks. The link gets converted, but it ignores all the properties so the link doesn't open in a new tab, change, color, etc. Here is simple snippet.
I've also tried moving the tag inside the <Comment.Text> and it made no difference. Any possible solution?
The text was updated successfully, but these errors were encountered: