fix: CMS field 'original_url' should not be manipulated, render as-is.

This commit is contained in:
Michael Zetterberg
2024-10-24 13:28:52 +02:00
parent bbab8aa4f8
commit 6c8301ecea
2 changed files with 3 additions and 3 deletions

View File

@@ -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,
}

View File

@@ -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) {