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:
Jadin Heaston
2023-01-03 13:50:32 -06:00
parent d342c0a9af
commit 6358fbad30

View File

@ -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;
}