gatsby-source-notion-churnotion 1.0.47 → 1.0.48

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,28 +11,26 @@ const processBlocks = async (blocks, actions, getCache, createNodeId, reporter)
11
11
  let thumbnail = null;
12
12
  for (const block of blocks) {
13
13
  if (isImageBlock(block) && block?.image?.file?.url) {
14
- const match = block.image.file.url.match(/\((https?:\/\/.*?)\)/);
15
- if (match) {
16
- const imageUrl = match[1];
17
- reporter.info(`[Image] got image > ${imageUrl}`);
18
- try {
19
- const fileNode = await (0, gatsby_source_filesystem_1.createRemoteFileNode)({
20
- url: imageUrl,
21
- parentNodeId: block.id,
22
- getCache,
23
- createNode,
24
- createNodeId,
25
- });
26
- if (fileNode) {
27
- if (!thumbnail)
28
- thumbnail = fileNode.id;
29
- reporter.info(`[SUCCESS] Image processed: ${fileNode.id}`);
30
- }
31
- }
32
- catch (error) {
33
- reporter.warn(`[WARNING] Failed to download image: ${imageUrl}`);
14
+ const imageUrl = block.image.file.url;
15
+ reporter.info(`[Image] got image > ${imageUrl}`);
16
+ try {
17
+ const fileNode = await (0, gatsby_source_filesystem_1.createRemoteFileNode)({
18
+ url: imageUrl,
19
+ parentNodeId: block.id,
20
+ getCache,
21
+ createNode,
22
+ createNodeId,
23
+ });
24
+ if (fileNode) {
25
+ block.image.file.url = fileNode.id;
26
+ if (!thumbnail)
27
+ thumbnail = fileNode.id;
28
+ reporter.info(`[SUCCESS] Image processed: ${fileNode.id}`);
34
29
  }
35
30
  }
31
+ catch (error) {
32
+ reporter.warn(`[WARNING] Failed to download image: ${imageUrl}`);
33
+ }
36
34
  }
37
35
  }
38
36
  return thumbnail;
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.0.47",
4
+ "version": "1.0.48",
5
5
  "skipLibCheck": true,
6
6
  "license": "0BSD",
7
7
  "main": "./dist/gatsby-node.js",