diff --git a/frontend/src/ts/elements/profile.ts b/frontend/src/ts/elements/profile.ts index 09d35b84f..0ee328951 100644 --- a/frontend/src/ts/elements/profile.ts +++ b/frontend/src/ts/elements/profile.ts @@ -119,9 +119,14 @@ export async function update( } const website = profile.details?.socialProfiles.website; + + //regular expression to get website name from url + const regex = /^https?:\/\/(?:www\.)?([^/]+)/; + const websiteName = website?.match(regex)?.[1] ?? website; + if (website) { socialsEl.append( - `` + `` ); } }