diff --git a/lemmy-translations b/lemmy-translations index 866e4056..b2de37b3 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 866e4056656755f7b31e20094b46391e6931e3e7 +Subproject commit b2de37b31ea6294fdcd7f41492ea241b62ee9099 diff --git a/src/shared/components/common/url-list-textarea.tsx b/src/shared/components/common/url-list-textarea.tsx index 5063e101..8c6b6bea 100644 --- a/src/shared/components/common/url-list-textarea.tsx +++ b/src/shared/components/common/url-list-textarea.tsx @@ -14,6 +14,12 @@ function handleTextChange(i: UrlListTextarea, event: any) { i.setState({ text: event.target.value }); } +const URL_SCHEME = "https://"; + +function processUrl(str: string) { + return new URL(str).toString().replace(URL_SCHEME, ""); +} + function handleTextBlur(i: UrlListTextarea, event: any) { const inputValue: string = event.currentTarget?.value ?? ""; @@ -24,10 +30,10 @@ function handleTextBlur(i: UrlListTextarea, event: any) { let url: string; try { - url = new URL(str).toString(); + url = processUrl(str); } catch { try { - url = new URL("https://" + str).toString(); + url = processUrl(URL_SCHEME + str); } catch { continue; }