Merged in fix/original-url (pull request #759)
fix: CMS field 'original_url' should not be manipulated, render as-is.
This commit is contained in:
@@ -92,7 +92,7 @@ export function transform(data: Data) {
|
|||||||
system: data.system,
|
system: data.system,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
url: data.web.original_url
|
url: data.web.original_url
|
||||||
? removeMultipleSlashes(data.web.original_url)
|
? data.web.original_url
|
||||||
: removeMultipleSlashes(`/${data.system.locale}/${data.url}`),
|
: removeMultipleSlashes(`/${data.system.locale}/${data.url}`),
|
||||||
web: data.web,
|
web: data.web,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export function removeMultipleSlashes(str: string) {
|
export function removeMultipleSlashes(pathname: string) {
|
||||||
return str.replaceAll(/\/\/+/g, "/")
|
return pathname.replaceAll(/\/\/+/g, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removeTrailingSlash(pathname: string) {
|
export function removeTrailingSlash(pathname: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user