astro-custom-toc 1.0.1 → 1.0.3
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/package.json +3 -1
- package/remark-custom-toc.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-custom-toc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Astro Integration to generate a customizable table of contents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"astro",
|
|
19
|
+
"withastro",
|
|
20
|
+
"ui",
|
|
19
21
|
"remark",
|
|
20
22
|
"markdown",
|
|
21
23
|
"astro-integration"
|
package/remark-custom-toc.ts
CHANGED
|
@@ -94,7 +94,7 @@ const generateToc = (template: RemarkCustomTocTemplate, maxDepth: number, ordere
|
|
|
94
94
|
const { document } = new JSDOM().window;
|
|
95
95
|
|
|
96
96
|
const toc: HTMLElement = document.createElement(ordered ? "ol" : "ul");
|
|
97
|
-
let currentDepth =
|
|
97
|
+
let currentDepth = headings[0].depth;
|
|
98
98
|
let currentParent = toc;
|
|
99
99
|
for (const heading of headings) {
|
|
100
100
|
if (heading.depth > maxDepth) continue;
|