From e7b27ec264b8e7230a34189309dafed869a737db Mon Sep 17 00:00:00 2001 From: Alexey Rodionov Date: Thu, 29 Apr 2021 19:42:54 +0300 Subject: [PATCH] Fix #89 --- src/components/Linkify.jsx | 4 +++- src/decorators/defaultMatchDecorator.js | 2 ++ src/index.js | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Linkify.jsx b/src/components/Linkify.jsx index a765494..7f4832f 100644 --- a/src/components/Linkify.jsx +++ b/src/components/Linkify.jsx @@ -4,7 +4,7 @@ import * as React from 'react'; import defaultComponentDecorator from 'decorators/defaultComponentDecorator'; import defaultHrefDecorator from 'decorators/defaultHrefDecorator'; -import defaultMatchDecorator from 'decorators/defaultMatchDecorator'; +import defaultMatchDecorator, { linkify } from 'decorators/defaultMatchDecorator'; import defaultTextDecorator from 'decorators/defaultTextDecorator'; type Props = { @@ -78,4 +78,6 @@ class Linkify extends React.Component { } } +export { linkify }; + export default Linkify; diff --git a/src/decorators/defaultMatchDecorator.js b/src/decorators/defaultMatchDecorator.js index 1150218..842b7d7 100644 --- a/src/decorators/defaultMatchDecorator.js +++ b/src/decorators/defaultMatchDecorator.js @@ -6,6 +6,8 @@ import tlds from 'tlds'; const linkify = new LinkifyIt(); linkify.tlds(tlds); +export { linkify }; + export default (text: string): Array => { return linkify.match(text); }; diff --git a/src/index.js b/src/index.js index 9119c85..7007df4 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,5 @@ -import Linkify from 'components/Linkify'; +import Linkify, { linkify } from 'components/Linkify'; + +export { linkify }; export default Linkify;