Skip to content

Commit 2045b41

Browse files
committed
add comment
1 parent 11f34d4 commit 2045b41

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/notion/getPostBlocks.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ function filterPostBlocks(id, blockMap, slice) {
9393
continue
9494
}
9595

96+
// 当BlockId等于PageId时移除
9697
if (b?.value?.id === id) {
98+
// 此block含有敏感信息
9799
delete b?.value?.properties
98100
continue
99101
}
@@ -102,19 +104,20 @@ function filterPostBlocks(id, blockMap, slice) {
102104

103105
if (b?.value?.type === 'sync_block' && b?.value?.children) {
104106
const childBlocks = b.value.children
105-
// Remove the sync block
107+
// 移除同步块
106108
delete clonePageBlock.block[blockId]
107-
// Insert child blocks in place of the sync block
109+
// 用子块替代同步块
108110
childBlocks.forEach((childBlock, index) => {
109111
const newBlockId = `${blockId}_child_${index}`
110112
clonePageBlock.block[newBlockId] = childBlock
111113
blocksToProcess.splice(i + index + 1, 0, newBlockId)
112114
})
113-
// Adjust the loop counter to process the newly inserted blocks
115+
// 重新处理新加入的子块
114116
i--
115117
continue
116118
}
117119

120+
// 处理 c++、c#、汇编等语言名字映射
118121
if (b?.value?.type === 'code') {
119122
if (b?.value?.properties?.language?.[0][0] === 'C++') {
120123
b.value.properties.language[0][0] = 'cpp'
@@ -127,6 +130,7 @@ function filterPostBlocks(id, blockMap, slice) {
127130
}
128131
}
129132

133+
// 如果是文件,或嵌入式PDF,需要重新加密签名
130134
if (
131135
(b?.value?.type === 'file' ||
132136
b?.value?.type === 'pdf' ||

0 commit comments

Comments
 (0)