Skip to content

Commit

Permalink
Adding check for addHttp() to see if mailto: or `tel:
Browse files Browse the repository at this point in the history
…` is present.Signed-off-by: Jadin Heaston <[email protected]>
  • Loading branch information
JadinHeaston committed Jan 3, 2023
1 parent d342c0a commit 6358fba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/utils/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const formatLocation = (location?: Location): string => {
};

export const addHttp = (url: string) => {
if (url.search(/^http[s]?:\/\//) == -1) {
if (url.search(/^http[s]?:\/\//) == -1 && url.search(/^mailto:/) == -1 && url.search(/^tel:/) == -1) {
url = 'http://' + url;
}

Expand Down

0 comments on commit 6358fba

Please sign in to comment.