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

add target prop for opening in new tab #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

patrickkamcord
Copy link

Adds a new optional prop "target" - useful for opening links in a new tab

@jakubwolny
Copy link

I'd suggest to add more generic way to specify any additional html attributes. That's how you can achieve target="_blank" or rel=nofollow etc.

What do you think about it @patrickkamcord @joshthecoder ?

@patrickkamcord
Copy link
Author

Yeah or even a replacer function you can specify like the original autolinker this is based on: https://github.com/gregjacobs/Autolinker.js

That way you have full control.

@joshthecoder
Copy link
Contributor

The ability to provide a custom factory function that returns the link React elements might be nice.
This might also pave the way for supporting other renderers such as React Native.

@jakubwolny
Copy link

I created PR with my proposal - I just added support for custom html attributes, I didn't have to time to create custom transformer for link elements. But this shouldn't be an issue to pass function as attrs and then transform it accordingly.

#7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants