react-text-format
Advanced tools
Comparing version 2.0.21 to 2.0.22
{ | ||
"name": "react-text-format", | ||
"version": "2.0.21", | ||
"version": "2.0.22", | ||
"description": "React Component to find and parse links, emails, phone numbers, credit cards and keywords to required format.", | ||
"homepage": "https://react-ninja.github.io/react-text-format/", | ||
"author": "Ahsan Bilal", | ||
@@ -6,0 +7,0 @@ "license": "MIT", |
@@ -28,8 +28,8 @@ # react-text-format | ||
|terms| Array of strings | [] | | ||
|linkDecorator| React.Node (decoratedHref: string, decoratedText: string, linkTarget: string, key: number) | Output Format: ``<a href="{URL}" target="{target}" rel='noopener' className='rtfLink'> <URL> </a>`` | ||
|emailDecorator| React.Node (decoratedHref: string, decoratedText: string,key: number) | Output Format:``<a href="mailto: {EMAIL ADDRESS}" className='rtfEmail'> {EMAIL ADDRESS} </a>`` | | ||
|phoneDecorator| React.Node (decoratedText: string, key: number) | Output Format``<a href="tel:{PHONE NUMBER}" className='rtfEmail'> {PHONE NUMBER} </a>`` | | ||
|creditCardDecorator| React.Node (decoratedText: string, key: number) | Output Format: ``<span className='rtfCreditCard'> {CREDIT CARD NUMBER} </span>`` | | ||
|imageDecorator| React.Node (decoratedURL: string, key: number) | Output Format: ``<img src="{URL OF IMAGE}" rel='noopener' className='rtfImage' />`` | | ||
|termDecorator| React.Node (decoratedText: string, key: number) | Output Format: ``<span key={key} className='rtfTerm'>{decoratedText}</span>`` | | ||
|linkDecorator| React.Node (decoratedHref: string, decoratedText: string, linkTarget: string) | Output Format: ``<a href="{URL}" target="{target}" rel='noopener' className='rtfLink'> <URL> </a>`` | ||
|emailDecorator| React.Node (decoratedHref: string, decoratedText: string) | Output Format:``<a href="mailto: {EMAIL ADDRESS}" className='rtfEmail'> {EMAIL ADDRESS} </a>`` | | ||
|phoneDecorator| React.Node (decoratedText: string) | Output Format``<a href="tel:{PHONE NUMBER}" className='rtfEmail'> {PHONE NUMBER} </a>`` | | ||
|creditCardDecorator| React.Node (decoratedText: string) | Output Format: ``<span className='rtfCreditCard'> {CREDIT CARD NUMBER} </span>`` | | ||
|imageDecorator| React.Node (decoratedURL: string) | Output Format: ``<img src="{URL OF IMAGE}" rel='noopener' className='rtfImage' />`` | | ||
|termDecorator| React.Node (decoratedText: string) | Output Format: ``<span className='rtfTerm'>{decoratedText}</span>`` | | ||
@@ -73,4 +73,3 @@ ## Usage | ||
decoratedText: string, | ||
linkTarget: string, | ||
key: number | ||
linkTarget: string | ||
): React.Node => { | ||
@@ -80,3 +79,3 @@ return ( | ||
href={decoratedHref} | ||
key={key} | ||
target={linkTarget} | ||
@@ -92,8 +91,7 @@ rel='noopener' | ||
customImageDecorator = ( | ||
decoratedURL: string, | ||
key: number | ||
decoratedURL: string | ||
): React.Node => { | ||
return ( | ||
<div> | ||
<img src={decoratedURL} key={key} rel='noopener' width="100" className='customImage' /> | ||
<img src={decoratedURL} rel='noopener' width="100" className='customImage' /> | ||
</div> | ||
@@ -105,7 +103,6 @@ ) | ||
decoratedHref: string, | ||
decoratedText: string, | ||
key: number | ||
decoratedText: string | ||
): React.Node => { | ||
return ( | ||
<a href={decoratedHref} key={key} className='customEmail'> | ||
<a href={decoratedHref} className='customEmail'> | ||
{decoratedText} | ||
@@ -121,3 +118,3 @@ </a> | ||
return ( | ||
<a href={`tel:${decoratedText}`} key={key} className='customPhone'> | ||
<a href={`tel:${decoratedText}`} className='customPhone'> | ||
{decoratedText} | ||
@@ -129,7 +126,6 @@ </a> | ||
customCreditCardDecorator = ( | ||
decoratedText: string, | ||
key: number | ||
decoratedText: string | ||
): React.Node => { | ||
return ( | ||
<i key={key} className='customCreditCard'> | ||
<i className='customCreditCard'> | ||
<b>{decoratedText}</b> | ||
@@ -140,5 +136,5 @@ </i> | ||
customTermDecorator = (decoratedText: string, key: number): React.Node => { | ||
customTermDecorator = (decoratedText: string): React.Node => { | ||
return ( | ||
<b key={key} className="keyword"> | ||
<b className="keyword"> | ||
{decoratedText} | ||
@@ -145,0 +141,0 @@ </b> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
788254
8943
0
172