@timvir/mdx 0.1.38 → 0.1.41
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/index.js +14 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -127,10 +127,13 @@ export function remarkPlugin() {
|
|
|
127
127
|
const exportDefaultDeclaration = file.program.body.find((node) => t.isExportDefaultDeclaration(node));
|
|
128
128
|
const { declaration } = exportDefaultDeclaration;
|
|
129
129
|
const { code } = generate.default(declaration);
|
|
130
|
-
return prettier
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
return prettier
|
|
131
|
+
.format(code, {
|
|
132
|
+
parser: "typescript",
|
|
133
|
+
printWidth: 80,
|
|
134
|
+
})
|
|
135
|
+
.trim()
|
|
136
|
+
.slice(0, -1);
|
|
134
137
|
})();
|
|
135
138
|
|
|
136
139
|
const { children } = fromMarkdown(`{${JSON.stringify(source)}}`, {
|
|
@@ -158,10 +161,13 @@ export function remarkPlugin() {
|
|
|
158
161
|
const body = declaration.body.body;
|
|
159
162
|
const returnStatement = body.find((node) => t.isReturnStatement(node));
|
|
160
163
|
const { code } = generate.default(returnStatement.argument);
|
|
161
|
-
return prettier
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
return prettier
|
|
165
|
+
.format(code, {
|
|
166
|
+
parser: "typescript",
|
|
167
|
+
printWidth: 80,
|
|
168
|
+
})
|
|
169
|
+
.trim()
|
|
170
|
+
.slice(0, -1);
|
|
165
171
|
})();
|
|
166
172
|
|
|
167
173
|
const { children } = fromMarkdown(`{${JSON.stringify(source)}}`, {
|