We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94ef9d7 commit f13fed4Copy full SHA for f13fed4
src/core.ts
@@ -1013,8 +1013,8 @@ export const safeJSON = (text: string) => {
1013
}
1014
};
1015
1016
-// https://stackoverflow.com/a/19709846
1017
-const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i');
+// https://url.spec.whatwg.org/#url-scheme-string
+const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
1018
const isAbsoluteURL = (url: string): boolean => {
1019
return startsWithSchemeRegexp.test(url);
1020
0 commit comments