Merge pull request #4912 from andrewthauer/fix/link-to-mailto
fix(core): ensure link component works with mailto
This commit is contained in:
@@ -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'],
|
||||
|
||||
@@ -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 & {
|
||||
|
||||
Reference in New Issue
Block a user