From ac125965eb4bbe74a5c9b6757b0d631b3f9d7f43 Mon Sep 17 00:00:00 2001 From: Dakshesh Jain <65905942+dakshesh14@users.noreply.github.com> Date: Wed, 19 Apr 2023 15:40:47 +0530 Subject: [PATCH] fix: add tlds (#851) --- apps/app/components/rich-text-editor/index.tsx | 7 ++++++- apps/app/package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/app/components/rich-text-editor/index.tsx b/apps/app/components/rich-text-editor/index.tsx index 32b4931f1..701a96562 100644 --- a/apps/app/components/rich-text-editor/index.tsx +++ b/apps/app/components/rich-text-editor/index.tsx @@ -29,6 +29,8 @@ import { OnChangeHTML, } from "@remirror/react"; import { TableExtension } from "@remirror/extension-react-tables"; +// tlds +import tlds from "tlds"; // services import fileService from "services/file.service"; // ui @@ -136,7 +138,10 @@ const RemirrorRichTextEditor: FC = (props) => { new CodeExtension(), new PlaceholderExtension({ placeholder: placeholder || "Enter text..." }), new HistoryExtension(), - new LinkExtension({ autoLink: true }), + new LinkExtension({ + autoLink: true, + autoLinkAllowedTLDs: tlds, + }), new ImageExtension({ enableResizing: true, uploadHandler: uploadImageHandler, diff --git a/apps/app/package.json b/apps/app/package.json index 5374c6363..823541cb2 100644 --- a/apps/app/package.json +++ b/apps/app/package.json @@ -38,6 +38,7 @@ "recharts": "^2.3.2", "remirror": "^2.0.23", "swr": "^1.3.0", + "tlds": "^1.238.0", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 99ac4cf56..1e8bb41f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7763,6 +7763,11 @@ tinycolor2@^1.4.1: resolved "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz" integrity sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw== +tlds@^1.238.0: + version "1.238.0" + resolved "https://registry.yarnpkg.com/tlds/-/tlds-1.238.0.tgz#ffe7c19c8940c35b497cda187a6927f9450325a4" + integrity sha512-lFPF9pZFhLrPodaJ0wt9QIN0l8jOxqmUezGZnm7BfkDSVd9q667oVIJukLVzhF+4oW7uDlrLlfJrL5yu9RWwew== + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz"