From e1e606952ff47d097718dee42cd922edcf7782f6 Mon Sep 17 00:00:00 2001 From: Arvid Lunnemark Date: Tue, 26 Jul 2022 21:43:14 -0400 Subject: [PATCH] fix link thing --- .../components/Compose/Plugins/AsphrAutoLinkPlugin.tsx | 8 +++++++- gui/src/renderer/components/Read.tsx | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gui/src/renderer/components/Compose/Plugins/AsphrAutoLinkPlugin.tsx b/gui/src/renderer/components/Compose/Plugins/AsphrAutoLinkPlugin.tsx index 8b2f4fa6..d0da8b19 100644 --- a/gui/src/renderer/components/Compose/Plugins/AsphrAutoLinkPlugin.tsx +++ b/gui/src/renderer/components/Compose/Plugins/AsphrAutoLinkPlugin.tsx @@ -21,7 +21,13 @@ const urlMatcher: LinkMatcher = (text: string) => { return null; } - const url = match[0]; + let url = match[0]; + + if (!(url.substring(0, 4) === "http" || url.substring(0, 3) === "ftp")) { + url = "https://" + url; + } + + console.log(url); return { index: match.index, diff --git a/gui/src/renderer/components/Read.tsx b/gui/src/renderer/components/Read.tsx index e6a90fdf..698463f6 100644 --- a/gui/src/renderer/components/Read.tsx +++ b/gui/src/renderer/components/Read.tsx @@ -96,7 +96,7 @@ function Read({