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; + } } // 去掉不用的字段