@timvir/mdx 0.1.39 → 0.1.42

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.
Files changed (2) hide show
  1. package/index.js +14 -8
  2. 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.format(code, {
131
- parser: "typescript",
132
- printWidth: 80,
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.format(code, {
162
- parser: "mdx",
163
- printWidth: 80,
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)}}`, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@timvir/mdx",
4
- "version": "0.1.39",
4
+ "version": "0.1.42",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
7
7
  "exports": {