feat(getPageContentText): add references to NotionX types and comment out debug log

- Add reference links to NotionX type definitions for better documentation
- Comment out debug console.log statement to clean up output
- Maintain existing functionality while improving code clarity
This commit is contained in:
anime
2025-07-09 16:12:12 +08:00
parent f9ac624498
commit 9886e4d146

View File

@@ -42,7 +42,7 @@ function getFullTextContent(text) {
const ref = Array.isArray(decorations) ? decorations[0] : null
const type = ref?.[0]
const data = ref?.[1]
// todo: 处理更多类型 https://github.com/NotionX/react-notion-x/blob/9ee2d9334e260ee3600f4f8d7212f66b641b19cc/packages/notion-types/src/core.ts#L108
switch (type) {
case 'd':
// 日期字符串
@@ -119,7 +119,7 @@ export function getPageContentText(post, pageBlockMap) {
return ''
}
const blockType = block.type
// todo: 处理更多类型
// todo: 处理更多类型 https://github.com/NotionX/react-notion-x/blob/9ee2d9334e260ee3600f4f8d7212f66b641b19cc/packages/notion-types/src/block.ts#L3
switch (blockType) {
case 'transclusion_reference':
return getTransclusionReference(block)
@@ -176,6 +176,6 @@ export function getPageContentText(post, pageBlockMap) {
}
}
}
console.log('开始', contentTextList.join(''), '结束')
// console.log('开始', contentTextList.join(''), '结束')
return contentTextList.join('')
}