Skip to content

Commit 8f34d5e

Browse files
fix: add legacyBehavior for next/link
1 parent 581647d commit 8f34d5e

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

packages/notion-utils/src/map-image-url.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export const defaultMapImageUrl = (
3333
return url
3434
}
3535
}
36+
37+
if (u.hostname === 'img.notionusercontent.com') {
38+
return url
39+
}
3640
} catch {
3741
// ignore invalid urls
3842
}

packages/react-notion-x/src/components/asset.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ export function Asset({
275275
}
276276
} else if (block.type === 'image') {
277277
// console.log('image', block)
278-
//kind of a hack for now. New file.notion.so images aren't signed correctly
278+
// TODO: kind of a hack for now. New file.notion.so images aren't signed correctly
279279
if (source.includes('file.notion.so')) {
280280
source = block.properties?.source?.[0]?.[0]
281281
}

packages/react-notion-x/src/next.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export function wrapNextLink(NextLink: any) {
9090
scroll={scroll}
9191
shallow={shallow}
9292
locale={locale}
93+
legacyBehavior
9394
>
9495
<a {...linkProps} />
9596
</NextLink>

0 commit comments

Comments
 (0)