Skip to content

Commit 4840dd1

Browse files
committed
Simply implementation
1 parent 59c507f commit 4840dd1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/block-editor/src/components/link-control/is-url-like.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ export default function isURLLike( val ) {
2727
const mayBeTLD = hasPossibleTLD( val );
2828

2929
const isWWW = val?.startsWith( 'www.' );
30-
const isHTTPProtocol = /^(http|https)/.test( val ) && protocolIsValid;
31-
const isMailTo = val?.startsWith( 'mailto:' ) && protocolIsValid;
32-
const isTel = val?.startsWith( 'tel:' ) && protocolIsValid;
30+
3331
const isInternal = val?.startsWith( '#' ) && isValidFragment( val );
3432

35-
return (
36-
isHTTPProtocol || isWWW || isMailTo || isTel || isInternal || mayBeTLD
37-
);
33+
return protocolIsValid || isWWW || isInternal || mayBeTLD;
3834
}
3935

4036
/**

0 commit comments

Comments
 (0)