diff --git a/lib/map-image-url.ts b/lib/map-image-url.ts index c1f6330..06e1cd9 100644 --- a/lib/map-image-url.ts +++ b/lib/map-image-url.ts @@ -28,7 +28,10 @@ export const mapNotionImageUrl = (url: string, block: Block) => { }` const notionImageUrlV2 = new URL(url) - const table = block.parent_table === 'space' ? 'block' : block.parent_table + let table = block.parent_table === 'space' ? 'block' : block.parent_table + if (table === 'collection') { + table = 'block' + } notionImageUrlV2.searchParams.set('table', table) notionImageUrlV2.searchParams.set('id', block.id) notionImageUrlV2.searchParams.set('cache', 'v2') diff --git a/package.json b/package.json index 08a4d68..8a4082a 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "react-body-classname": "^1.3.1", "react-dom": "17.0.1", "react-icons": "^4.1.0", - "react-notion-x": "^3.2.1", + "react-notion-x": "^3.2.2", "react-use": "^15.3.3" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 69f275a..333ca77 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4125,10 +4125,10 @@ react-modal@^3.11.2: react-lifecycles-compat "^3.0.0" warning "^4.0.3" -react-notion-x@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/react-notion-x/-/react-notion-x-3.2.1.tgz#ac5d343131f9cb715b13f90fda0ed6714523f3fb" - integrity sha512-Yon8LkInxm2cR2UVND+wrOWfw1W8mdbrZK5k15jUPOvIV/U0VPCmyzCTFi4e2QR4TFkRAqBKlQO3Ly07pLjXVg== +react-notion-x@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/react-notion-x/-/react-notion-x-3.2.2.tgz#de711eae90e8206dcb3db8f31b17c540a35511ad" + integrity sha512-AegukJTMhpzL1H7hRfcSnoYRdiE3dsjI6wTOrpimOSOfeBhF46MvYchc2dYcr9ui/3cHiNP+X5mBTKgVZcHrfg== dependencies: "@matejmazur/react-katex" "^3.1.3" date-fns "^2.15.0"