mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
fix regex
This commit is contained in:
@@ -96,7 +96,7 @@ export function getPageIcon(icon: string, size = 18): string | ReactNode {
|
|||||||
|
|
||||||
export const normalizeUrl = (url: string): string => {
|
export const normalizeUrl = (url: string): string => {
|
||||||
if (!url) return url;
|
if (!url) return url;
|
||||||
if (url.startsWith("/") || /^(\S+):(\/\/)?\S+$/.test(url)) return url;
|
if (url.startsWith("/") || /^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(url)) return url;
|
||||||
return `https://${url}`;
|
return `https://${url}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user