fix(BOOK-413): Respecting original_url inside RTE for entry links
Approved-by: Matilda Landström
This commit is contained in:
@@ -451,17 +451,22 @@ export const renderOptions: RenderOptions = {
|
||||
) {
|
||||
// If entry is not an ImageContainer, it is a page and we return it as a link
|
||||
const { className, ...props } = extractPossibleAttributes(node.attrs)
|
||||
const entryHref = entry.node.url
|
||||
|
||||
const href = node.attrs?.locale
|
||||
const nodeHref = node.attrs?.locale
|
||||
? `/${node.attrs.locale}${node.attrs.href ?? node.attrs.url}`
|
||||
: ((node.attrs.href ?? node.attrs.url) as string)
|
||||
|
||||
if (!entryHref && !nodeHref) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<Link
|
||||
key={node.uid}
|
||||
className={className}
|
||||
{...props}
|
||||
href={href}
|
||||
href={entryHref ?? nodeHref}
|
||||
textDecoration="underline"
|
||||
>
|
||||
{next(
|
||||
|
||||
@@ -6,8 +6,4 @@ fragment HotelPageLink on HotelPage {
|
||||
}
|
||||
title
|
||||
url
|
||||
# TODO: Might need to add this if this is needed for hotel pages.
|
||||
# web {
|
||||
# original_url
|
||||
# }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user