@readme/markdown 6.75.0-beta.68 → 6.75.0-beta.69
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.
- package/dist/main.js +2 -2
- package/dist/main.node.js +2 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -78511,7 +78511,6 @@ const rehypeToc = ({ components = {} }) => {
|
|
|
78511
78511
|
const MAX_DEPTH = 2;
|
|
78512
78512
|
const getDepth = (el) => { var _a; return parseInt((_a = el.tagName) === null || _a === void 0 ? void 0 : _a.match(/^h(\d)/)[1]); };
|
|
78513
78513
|
const tocToHast = (headings = []) => {
|
|
78514
|
-
console.log({ headings });
|
|
78515
78514
|
const min = Math.min(...headings.map(getDepth));
|
|
78516
78515
|
const ast = h('ul');
|
|
78517
78516
|
const stack = [ast];
|
|
@@ -78527,7 +78526,8 @@ const tocToHast = (headings = []) => {
|
|
|
78527
78526
|
while (stack.length > depth) {
|
|
78528
78527
|
stack.pop();
|
|
78529
78528
|
}
|
|
78530
|
-
|
|
78529
|
+
if (heading.properties)
|
|
78530
|
+
stack[stack.length - 1].children.push(h('li', null, h('a', { href: `#${heading.properties.id}` }, heading.children)));
|
|
78531
78531
|
});
|
|
78532
78532
|
return ast;
|
|
78533
78533
|
};
|
package/dist/main.node.js
CHANGED
|
@@ -79964,7 +79964,6 @@ const rehypeToc = ({ components = {} }) => {
|
|
|
79964
79964
|
const MAX_DEPTH = 2;
|
|
79965
79965
|
const getDepth = (el) => { var _a; return parseInt((_a = el.tagName) === null || _a === void 0 ? void 0 : _a.match(/^h(\d)/)[1]); };
|
|
79966
79966
|
const tocToHast = (headings = []) => {
|
|
79967
|
-
console.log({ headings });
|
|
79968
79967
|
const min = Math.min(...headings.map(getDepth));
|
|
79969
79968
|
const ast = h('ul');
|
|
79970
79969
|
const stack = [ast];
|
|
@@ -79980,7 +79979,8 @@ const tocToHast = (headings = []) => {
|
|
|
79980
79979
|
while (stack.length > depth) {
|
|
79981
79980
|
stack.pop();
|
|
79982
79981
|
}
|
|
79983
|
-
|
|
79982
|
+
if (heading.properties)
|
|
79983
|
+
stack[stack.length - 1].children.push(h('li', null, h('a', { href: `#${heading.properties.id}` }, heading.children)));
|
|
79984
79984
|
});
|
|
79985
79985
|
return ast;
|
|
79986
79986
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@readme/markdown",
|
|
3
3
|
"description": "ReadMe's React-based Markdown parser",
|
|
4
4
|
"author": "Rafe Goldberg <rafe@readme.io>",
|
|
5
|
-
"version": "6.75.0-beta.
|
|
5
|
+
"version": "6.75.0-beta.69",
|
|
6
6
|
"main": "dist/main.node.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"browser": "dist/main.js",
|