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 hook that allows customization of link text #40

Closed
dpup opened this issue Jun 19, 2017 · 3 comments
Closed

Add hook that allows customization of link text #40

dpup opened this issue Jun 19, 2017 · 3 comments

Comments

@dpup
Copy link

dpup commented Jun 19, 2017

URLs can be long and not very human readable. It would be nice to have an option where-by the link text can be customized, either by extracting context from the URL or making a background request to fetch metadata.

https://www.google.ru/maps/@59.9393895,30.3165389,15z
--> <a href="https://www.google.ru/maps/@59.9393895,30.3165389,15z">Map (59.9393895N 30.3165389E)</a>

https://www.google.com/maps/place/New+York,+NY
--> <a href="https://www.google.com/maps/place/New+York,+NY">New York, NY</a>

Usage could be something like:

<Linkify tranform={fn}>{text}</Linkify>
@yarnball
Copy link

yarnball commented Jul 2, 2017

+1 on this.

For example, it could do a fetch of the link, then return the page title. I'm trying this here- https://codesandbox.io/s/9rjD5X9xz

@pablolmiranda
Copy link

pablolmiranda commented Jul 31, 2017

It should be ok to add a hook, tansformAnchorText, where you can receive the text before create the anchor element.

@tasti tasti mentioned this issue Jan 6, 2018
16 tasks
@tasti
Copy link
Owner

tasti commented Jan 7, 2018

See #46 (comment).

@tasti tasti closed this as completed Jan 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants