mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
feat(getPageContentText): update getPageContentText to use post.content array
- modify content extraction logic to use post.content array - avoid extra but wrong result by checking pageBlockMap.block
This commit is contained in:
@@ -84,12 +84,12 @@ export function getPageContentText(post, pageBlockMap) {
|
||||
}
|
||||
|
||||
const postId = post.id
|
||||
const postContent = post.content
|
||||
let contentTextList = []
|
||||
// 防止搜到加密文章的内容
|
||||
if (pageBlockMap && pageBlockMap.block && !post.password) {
|
||||
const contentIds = Object.keys(pageBlockMap.block)
|
||||
for (const id of contentIds) {
|
||||
const blockContentText = getBlockContentText(id)
|
||||
if (postContent.length > 0 && !post.password) {
|
||||
for (const postContentId of postContent) {
|
||||
const blockContentText = getBlockContentText(postContentId)
|
||||
if (blockContentText) {
|
||||
contentTextList.push(blockContentText)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user