fix:仅对 attachment 开头的上传文件签名,跳过 embed 链接

This commit is contained in:
LooseLi
2025-04-15 10:47:49 +08:00
parent 6f770a5165
commit a67e9086a0

View File

@@ -143,7 +143,8 @@ function convertNotionBlocksToPost(id, blockMap, slice) {
b?.value?.type === 'pdf' ||
b?.value?.type === 'video' ||
b?.value?.type === 'audio') &&
b?.value?.properties?.source?.[0][0]
b?.value?.properties?.source?.[0][0] &&
b?.value?.properties?.source?.[0][0].indexOf('attachment') === 0
) {
const oldUrl = b?.value?.properties?.source?.[0][0]
const newUrl = `https://notion.so/signed/${encodeURIComponent(oldUrl)}?table=block&id=${b?.value?.id}`