Merge pull request #4912 from andrewthauer/fix/link-to-mailto

fix(core): ensure link component works with mailto
This commit is contained in:
Fredrik Adelöw
2021-03-11 07:24:51 +01:00
committed by GitHub
2 changed files with 2 additions and 3 deletions
@@ -48,7 +48,7 @@ describe('<Link />', () => {
[true, 'https://some-host/path#fragment'],
[true, 'https://some-host/path?param1=value'],
[true, 'slack://'],
[true, 'mailto://'],
[true, 'mailto:foo@example.org'],
[true, 'ms-help://'],
[true, 'ms.help://'],
[true, 'ms+help://'],
@@ -56,7 +56,6 @@ describe('<Link />', () => {
[false, '123://'],
[false, 'abc&xzy://'],
[false, 'http'],
[false, 'https:/a'],
[false, 'path/to'],
[false, 'path/to/something#fragment'],
[false, 'path/to/something?param1=value'],
+1 -1
View File
@@ -24,7 +24,7 @@ import {
LinkProps as RouterLinkProps,
} from 'react-router-dom';
export const isExternalUri = (uri: string) => /^([a-z+.-]+):\/\//.test(uri);
export const isExternalUri = (uri: string) => /^([a-z+.-]+):/.test(uri);
export type LinkProps = MaterialLinkProps &
RouterLinkProps & {