gatsby-source-notion-churnotion 1.1.8 → 1.1.10
Sign up to get free protection for your applications and to get access to all the features.
package/dist/util/processor.js
CHANGED
@@ -14,7 +14,8 @@ const processBlocksForContent = async (blocks, actions, getCache, createNodeId,
|
|
14
14
|
const tableOfContents = [];
|
15
15
|
let thumbnail = null;
|
16
16
|
let rawText = "";
|
17
|
-
const updatedBlocks =
|
17
|
+
const updatedBlocks = [];
|
18
|
+
for (const block of blocks) {
|
18
19
|
await (0, tableOfContent_1.processTableOfContents)(block, tableOfContents);
|
19
20
|
const plainText = extractPlainText(block);
|
20
21
|
if (plainText) {
|
@@ -25,10 +26,12 @@ const processBlocksForContent = async (blocks, actions, getCache, createNodeId,
|
|
25
26
|
if (!thumbnail && updatedBlock?.image?.fileId) {
|
26
27
|
thumbnail = updatedBlock.image.fileId;
|
27
28
|
}
|
28
|
-
|
29
|
+
updatedBlocks.push(updatedBlock || block);
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
updatedBlocks.push(block);
|
29
33
|
}
|
30
|
-
|
31
|
-
}))).filter((block) => block !== null);
|
34
|
+
}
|
32
35
|
return { thumbnail, tableOfContents, updatedBlocks, rawText };
|
33
36
|
};
|
34
37
|
const isTextContentBlock = (block) => {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.processTableOfContents = void 0;
|
4
|
+
const crypto_1 = require("crypto");
|
4
5
|
const processTableOfContents = async (block, tableOfContents) => {
|
5
6
|
if (["heading_1", "heading_2", "heading_3"].includes(block.type) &&
|
6
7
|
block[block.type]?.rich_text?.length > 0) {
|
@@ -9,7 +10,7 @@ const processTableOfContents = async (block, tableOfContents) => {
|
|
9
10
|
.replace(/[^a-zA-Z0-9가-힣\s-_]/g, "")
|
10
11
|
.trim()
|
11
12
|
.replace(/\s+/g, "-")
|
12
|
-
.toLowerCase()}`;
|
13
|
+
.toLowerCase()}-${(0, crypto_1.randomUUID)().substring(0, 4)}`;
|
13
14
|
block.hash = hash;
|
14
15
|
tableOfContents.push({
|
15
16
|
type: block.type,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "gatsby-source-notion-churnotion",
|
3
3
|
"description": "Gatsby plugin that can connect with One Notion Database RECURSIVELY using official API",
|
4
|
-
"version": "1.1.
|
4
|
+
"version": "1.1.10",
|
5
5
|
"skipLibCheck": true,
|
6
6
|
"license": "0BSD",
|
7
7
|
"main": "./dist/gatsby-node.js",
|