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,
|
||||
title: data.title,
|
||||
url: data.web.original_url
|
||||
? removeMultipleSlashes(data.web.original_url)
|
||||
? data.web.original_url
|
||||
: removeMultipleSlashes(`/${data.system.locale}/${data.url}`),
|
||||
web: data.web,
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export function removeMultipleSlashes(str: string) {
|
||||
return str.replaceAll(/\/\/+/g, "/")
|
||||
export function removeMultipleSlashes(pathname: string) {
|
||||
return pathname.replaceAll(/\/\/+/g, "/")
|
||||
}
|
||||
|
||||
export function removeTrailingSlash(pathname: string) {
|
||||
|
||||
Reference in New Issue
Block a user