@mdit-vue/plugin-toc 0.9.1 → 0.9.2
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/index.cjs +9 -17
- package/dist/index.mjs +9 -17
- package/package.json +5 -8
package/dist/index.cjs
CHANGED
|
@@ -71,17 +71,6 @@ const tocPlugin = (md, {
|
|
|
71
71
|
linkTag = "a",
|
|
72
72
|
linkClass = ""
|
|
73
73
|
} = {}) => {
|
|
74
|
-
let headers;
|
|
75
|
-
md.core.ruler.push("resolveTocHeaders", (state) => {
|
|
76
|
-
headers = shared.resolveHeadersFromTokens(state.tokens, {
|
|
77
|
-
level,
|
|
78
|
-
shouldAllowHtml: true,
|
|
79
|
-
shouldEscapeText: true,
|
|
80
|
-
slugify,
|
|
81
|
-
format
|
|
82
|
-
});
|
|
83
|
-
return true;
|
|
84
|
-
});
|
|
85
74
|
md.block.ruler.before(
|
|
86
75
|
"heading",
|
|
87
76
|
"toc",
|
|
@@ -101,12 +90,15 @@ const tocPlugin = (md, {
|
|
|
101
90
|
linkTag,
|
|
102
91
|
linkClass
|
|
103
92
|
});
|
|
104
|
-
md.renderer.rules.toc_body = () =>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
93
|
+
md.renderer.rules.toc_body = (tokens) => renderHeaders(
|
|
94
|
+
shared.resolveHeadersFromTokens(tokens, {
|
|
95
|
+
level,
|
|
96
|
+
shouldAllowHtml: true,
|
|
97
|
+
shouldEscapeText: true,
|
|
98
|
+
slugify,
|
|
99
|
+
format
|
|
100
|
+
})
|
|
101
|
+
);
|
|
110
102
|
};
|
|
111
103
|
|
|
112
104
|
exports.createRenderHeaders = createRenderHeaders;
|
package/dist/index.mjs
CHANGED
|
@@ -67,17 +67,6 @@ const tocPlugin = (md, {
|
|
|
67
67
|
linkTag = "a",
|
|
68
68
|
linkClass = ""
|
|
69
69
|
} = {}) => {
|
|
70
|
-
let headers;
|
|
71
|
-
md.core.ruler.push("resolveTocHeaders", (state) => {
|
|
72
|
-
headers = resolveHeadersFromTokens(state.tokens, {
|
|
73
|
-
level,
|
|
74
|
-
shouldAllowHtml: true,
|
|
75
|
-
shouldEscapeText: true,
|
|
76
|
-
slugify: slugify$1,
|
|
77
|
-
format
|
|
78
|
-
});
|
|
79
|
-
return true;
|
|
80
|
-
});
|
|
81
70
|
md.block.ruler.before(
|
|
82
71
|
"heading",
|
|
83
72
|
"toc",
|
|
@@ -97,12 +86,15 @@ const tocPlugin = (md, {
|
|
|
97
86
|
linkTag,
|
|
98
87
|
linkClass
|
|
99
88
|
});
|
|
100
|
-
md.renderer.rules.toc_body = () =>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
89
|
+
md.renderer.rules.toc_body = (tokens) => renderHeaders(
|
|
90
|
+
resolveHeadersFromTokens(tokens, {
|
|
91
|
+
level,
|
|
92
|
+
shouldAllowHtml: true,
|
|
93
|
+
shouldEscapeText: true,
|
|
94
|
+
slugify: slugify$1,
|
|
95
|
+
format
|
|
96
|
+
})
|
|
97
|
+
);
|
|
106
98
|
};
|
|
107
99
|
|
|
108
100
|
export { createRenderHeaders, createTocBlockRule, tocPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdit-vue/plugin-toc",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "A markdown-it plugin to generate table-of-contents that compatible with Vue.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown-it",
|
|
@@ -38,19 +38,16 @@
|
|
|
38
38
|
"test": "vitest"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@mdit-vue/shared": "0.9.
|
|
42
|
-
"@mdit-vue/types": "0.9.
|
|
41
|
+
"@mdit-vue/shared": "0.9.2",
|
|
42
|
+
"@mdit-vue/types": "0.9.2",
|
|
43
43
|
"@types/markdown-it": "^12.2.3",
|
|
44
44
|
"markdown-it": "^13.0.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"
|
|
48
|
-
"markdown-it-anchor": "^8.6.4",
|
|
49
|
-
"unbuild": "^0.7.6",
|
|
50
|
-
"vitest": "^0.19.1"
|
|
47
|
+
"markdown-it-anchor": "^8.6.4"
|
|
51
48
|
},
|
|
52
49
|
"publishConfig": {
|
|
53
50
|
"access": "public"
|
|
54
51
|
},
|
|
55
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "11b8e8654846fc959d219dbe89f93c62a4b8f109"
|
|
56
53
|
}
|