react-ninja / react-text-format Goto Github PK
View Code? Open in Web Editor NEWReact component to parse urls, emails, credit cards, phone in text into clickable links or required format
License: MIT License
React component to parse urls, emails, credit cards, phone in text into clickable links or required format
License: MIT License
This is just a feature request to support spaces in phone numbers such as (206) 782-8410
Currently this is not picked up as a phone number because of the space
Great library,
would you be open to publishing a release without the console.log calls enabled by default?
Cheers
I was trying to create a highlight for a search text but it din't work if I am searching by the words in the url. Can a hierarchy over the decorators be created, to overwrite if it is both URL and term for instance?
If the string passed to component children contains %
, it will crash the component hence crashing the whole renderer.
This happens because decodeURIComponent used on src/parsers/scrapper.js line 20 will throw an error URIError if the string contains %
not followed by two hex digits or it does not produce valid UTF-8 character (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent).
So if the string contains something like It's 5% of the whole
, it will crash.
Remove console.log from existing code and add a wrapper method which perform console.*** operations for local environment.
https://github.com/react-ninja/react-text-format/blob/master/src/decorators/defaultMatchDecorator.js#L136
it should not fail but there is a check there that throws a null exception.
if (string === '') {
throw null
}
Hi, Thanks for this awesome add on.
I ran into an issue where If the link contains white space "%20", (I know right people should never be using white space in their URL's)
Then the link gets trimmed short and thus incorrect
for example using the encoded link: http://go%2Emsn%2Ecom/nl/133942%20Easp
it renders as
<a href="http://go.msn.com/nl/133942" target="_blank" rel="noopener" >http://go.msn.com/nl/133942</a> Easp
Is there a temporary workaround for this to include %20 in the regex to match the whitespace?
Thanks for a great lib!
Is there any way to extend this? For example to discern youtube, or vimeo links for embedding?
Are there plans to support React 18?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.