@apify/docs-theme 1.0.166 → 1.0.168

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/markdown.js +7 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/docs-theme",
3
- "version": "1.0.166",
3
+ "version": "1.0.168",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -25,7 +25,7 @@
25
25
  "algoliasearch": "^5.19.0",
26
26
  "algoliasearch-helper": "^3.22.6",
27
27
  "axios": "^1.7.9",
28
- "babel-loader": "^9.2.1",
28
+ "babel-loader": "^10.0.0",
29
29
  "docusaurus-gtm-plugin": "^0.0.2",
30
30
  "postcss-preset-env": "^10.1.3",
31
31
  "prism-react-renderer": "^2.4.1",
package/src/markdown.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const remarkParse = require('remark-parse');
2
2
  const remarkStringify = require('remark-stringify');
3
3
  const { unified } = require('unified');
4
- const { visitParents } = require('unist-util-visit-parents');
4
+ const { visitParents, CONTINUE } = require('unist-util-visit-parents');
5
5
 
6
6
  /**
7
7
  * Bumps the headings levels in the markdown content. This function increases the depth
@@ -40,7 +40,7 @@ const linkifyUserTags = () => (tree) => {
40
40
 
41
41
  const directParent = parents[parents.length - 1];
42
42
 
43
- if (!match || directParent.type === 'link') return 0;
43
+ if (!match || directParent.type === 'link') return CONTINUE;
44
44
 
45
45
  const nodeIndexInParent = directParent.children.findIndex((x) => x === node);
46
46
 
@@ -57,10 +57,10 @@ const linkifyUserTags = () => (tree) => {
57
57
  node.value = before;
58
58
  directParent.children.splice(nodeIndexInParent + 1, 0, link);
59
59
 
60
- if (!after) return nodeIndexInParent + 2;
60
+ if (!after) return [CONTINUE, nodeIndexInParent + 2];
61
61
 
62
62
  directParent.children.splice(nodeIndexInParent + 2, 0, { type: 'text', value: `${ending}${after}` });
63
- return nodeIndexInParent + 3;
63
+ return [CONTINUE, nodeIndexInParent + 3];
64
64
  });
65
65
  };
66
66
 
@@ -75,7 +75,7 @@ const prettifyPRLinks = () => (tree) => {
75
75
  const prLinkRegex = /https:\/\/github.com\/[^\s]+\/pull\/(\d+)/g;
76
76
  const match = prLinkRegex.exec(node.value);
77
77
 
78
- if (!match) return 0;
78
+ if (!match) return CONTINUE;
79
79
 
80
80
  const directParent = parents[parents.length - 1];
81
81
  const nodeIndexInParent = directParent.children.findIndex((x) => x === node);
@@ -92,10 +92,10 @@ const prettifyPRLinks = () => (tree) => {
92
92
  node.value = before;
93
93
 
94
94
  directParent.children.splice(nodeIndexInParent + 1, 0, link);
95
- if (!after) return nodeIndexInParent + 1;
95
+ if (!after) return [CONTINUE, nodeIndexInParent + 1];
96
96
 
97
97
  directParent.children.splice(nodeIndexInParent + 2, 0, { type: 'text', value: after });
98
- return nodeIndexInParent + 2;
98
+ return [CONTINUE, nodeIndexInParent + 2];
99
99
  });
100
100
  };
101
101