Updated URL editing to not automatically force everything to URLs

refs https://github.com/TryGhost/Team/issues/3433
This commit is contained in:
Jono Mingard 2023-06-20 12:01:34 +10:00
parent f5c78221a6
commit 4fd0473f1b

View File

@ -20,6 +20,11 @@ const formatUrl = (value: string, baseUrl: string) => {
return {save: url, display: url};
}
// If it doesn't look like a URL, leave it as is rather than assuming it's a pathname etc
if (!url.match(/^[a-zA-Z0-9-]+:/) && !url.match(/^(\/|\?)/)) {
return {save: url, display: url};
}
let parsedUrl: URL;
try {