@nuxtjs/mdc 0.18.3 → 0.18.4
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/module.d.mts
CHANGED
|
@@ -104,10 +104,16 @@ interface MDCStringifyOptions {
|
|
|
104
104
|
options?: YamlToStringOptions;
|
|
105
105
|
};
|
|
106
106
|
plugins?: {
|
|
107
|
-
remarkStringify?: {
|
|
107
|
+
'remarkStringify'?: {
|
|
108
108
|
options?: Options$1;
|
|
109
109
|
};
|
|
110
|
-
|
|
110
|
+
/**
|
|
111
|
+
* @deprecated use 'remark-mdc' instead
|
|
112
|
+
*/
|
|
113
|
+
'remarkMDC'?: {
|
|
114
|
+
options?: RemarkMDCOptions;
|
|
115
|
+
};
|
|
116
|
+
'remark-mdc'?: {
|
|
111
117
|
options?: RemarkMDCOptions;
|
|
112
118
|
};
|
|
113
119
|
};
|
package/dist/module.json
CHANGED
|
@@ -8,7 +8,7 @@ export function createStringifyProcessor(options = {}) {
|
|
|
8
8
|
this.parser = function(root) {
|
|
9
9
|
return JSON.parse(root);
|
|
10
10
|
};
|
|
11
|
-
}).use(mdcRemark).use(gfm).use(mdc, options?.plugins?.remarkMDC?.options || {}).use(stringify, {
|
|
11
|
+
}).use(mdcRemark).use(gfm).use(mdc, options?.plugins?.["remark-mdc"]?.options || options?.plugins?.remarkMDC?.options || {}).use(stringify, {
|
|
12
12
|
bullet: "-",
|
|
13
13
|
emphasis: "*",
|
|
14
14
|
rule: "-",
|
|
@@ -110,11 +110,15 @@ const mdcRemarkNodeHandlers = {
|
|
|
110
110
|
children: state.all(node)
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
+
let children = state.all(node);
|
|
114
|
+
if (children.every((child) => [mdastTextComponentType, "text"].includes(child.type))) {
|
|
115
|
+
children = [{ type: "paragraph", children }];
|
|
116
|
+
}
|
|
113
117
|
return {
|
|
114
118
|
type: "containerComponent",
|
|
115
119
|
name: node.tagName,
|
|
116
120
|
attributes: node.properties,
|
|
117
|
-
children
|
|
121
|
+
children
|
|
118
122
|
};
|
|
119
123
|
}
|
|
120
124
|
};
|
|
@@ -197,6 +201,7 @@ const mdcRemarkHandlers = {
|
|
|
197
201
|
return createTextComponent("button")(state, node);
|
|
198
202
|
},
|
|
199
203
|
"span": createTextComponent("span"),
|
|
204
|
+
"kbd": createTextComponent("kbd"),
|
|
200
205
|
"binding": createTextComponent("binding"),
|
|
201
206
|
"iframe": createTextComponent("iframe"),
|
|
202
207
|
"video": createTextComponent("video"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/mdc",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"description": "Nuxt MDC module",
|
|
5
5
|
"repository": "nuxt-content/mdc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -126,8 +126,8 @@
|
|
|
126
126
|
"rehype": "^13.0.2",
|
|
127
127
|
"release-it": "^19.0.6",
|
|
128
128
|
"typescript": "5.9.3",
|
|
129
|
-
"vitest": "^4.0.
|
|
130
|
-
"vue-tsc": "^3.1.
|
|
129
|
+
"vitest": "^4.0.10",
|
|
130
|
+
"vue-tsc": "^3.1.4"
|
|
131
131
|
},
|
|
132
132
|
"resolutions": {
|
|
133
133
|
"@nuxtjs/mdc": "workspace:*"
|