From 3d8e7c9c5f88e613c34f6d370d5d3bb95633b6ee Mon Sep 17 00:00:00 2001 From: EFL Date: Sun, 14 Jul 2024 10:52:42 +0800 Subject: [PATCH] test --- lib/notion/getPostBlocks.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/notion/getPostBlocks.js b/lib/notion/getPostBlocks.js index 8bac9e2a..469fa8f7 100644 --- a/lib/notion/getPostBlocks.js +++ b/lib/notion/getPostBlocks.js @@ -123,6 +123,16 @@ function filterPostBlocks(id, blockMap, slice) { const newUrl = `https://notion.so/signed/${encodeURIComponent(oldUrl)}?table=block&id=${b?.value?.id}` b.value.properties.source[0][0] = newUrl } + + if (b?.value?.type === 'synced_block' && b?.value?.properties?.children) { + const childBlocks = b.value.properties.children; + delete clonePageBlock.block[blockId]; + // Insert child blocks at the sync block's position + blockIds.splice(i + 1, 0, ...childBlocks); + // Adjust the loop counter to process the newly inserted blocks + i--; + continue; + } } // 去掉不用的字段