-
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
Roadmap to v1.0.0 💯 #24
Comments
One thing I'd like to achieve is to do custom things with the text depending on the URL. For example: // calling it "textProxy" but it can be "textDecorator" or "whatEver"
<Linkify textProxy={(text, href) => {
if (youtubeURLregex.test(href)) {
return <span>Watch on YouTube <img src="/static/youtube.png"/></span>
} else {
return text
}
}}>
...
</Linkify> In other words, I think I should be able to "intervene" both the |
It would be super dandy if this would identify and link telephone numbers as well (US as a first step). |
Is react native supported yet? |
What is the breaking change for moving from 0.2.2 to 1.0.0? |
Based on the recent feature request, I've been brainstorming how we could incorporate them into this package and solidify the API.
Since there are similarities between these features, it would be best if we synchronize these ideas and lay them out here. Below is what I imagine the package to look like. Anyone's input is more than welcome!
Overview
Let's begin with the end in mind. Here's what the directory structure would potentially look like:
Requirements
There are several components to get this done.
Custom Handlers
Related: #10, #20
File:
src/components/LinkifyIt.jsx
To allow flexibility of and prevent convoluting the base
Linkify
component, we will introduce aLinkifyIt
component. This would allow us to take advantage of existing logic from linkify-it without tightly coupling this package to it.Href Decorator
Related: #21
File:
src/decorators/hrefDecorator.js
To support modifying a matched href. This would be more so a collection of utility implementations that would commonly be used for the examples below.
Examples:
Text Decorator
Related: #22
File:
src/decorators/textDecorator.js
Similar to the above, except modifying the actual text that is displayed.
Examples:
Miscellaneous
I'd love to hear some feedback and get some extra hands on this roadmap!
The text was updated successfully, but these errors were encountered: