mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 08:42:08 +10:00
Adding check for ``addHttp()` to see if `mailto:` or `tel:`` is present.Signed-off-by: Jadin Heaston <jadin.heaston@como.gov>
This commit is contained in:
@ -20,7 +20,7 @@ export const formatLocation = (location?: Location): string => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const addHttp = (url: 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;
|
url = 'http://' + url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user