safe-mdx 0.0.2 → 0.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.
@@ -1,27 +1,22 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const jsx_runtime_1 = require("react/jsx-runtime");
7
- const react_1 = __importDefault(require("react"));
8
- const dedent_1 = __importDefault(require("dedent"));
9
- const vitest_1 = require("vitest");
10
- const safe_mdx_1 = require("./safe-mdx");
11
- void react_1.default;
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import dedent from 'dedent';
4
+ import { test, expect } from 'vitest';
5
+ import { MdastToJsx } from './safe-mdx';
6
+ void React;
12
7
  const components = {
13
8
  Heading({ level, children }) {
14
- return (0, jsx_runtime_1.jsx)("h1", { children: children });
9
+ return _jsx("h1", { children: children });
15
10
  },
16
11
  };
17
12
  function render(code) {
18
- const visitor = new safe_mdx_1.MdastToJsx({ code, components });
13
+ const visitor = new MdastToJsx({ code, components });
19
14
  const result = visitor.run();
20
15
  // console.log(JSON.stringify(result, null, 2))
21
16
  return { result, errors: visitor.errors || [] };
22
17
  }
23
- (0, vitest_1.test)('basic', () => {
24
- (0, vitest_1.expect)(render((0, dedent_1.default) `
18
+ test('basic', () => {
19
+ expect(render(dedent `
25
20
  # Hello
26
21
 
27
22
  i am a paragraph
@@ -39,8 +34,131 @@ function render(code) {
39
34
  }
40
35
  `);
41
36
  });
42
- (0, vitest_1.test)('inline jsx', () => {
43
- (0, vitest_1.expect)(render((0, dedent_1.default) `
37
+ test('table', () => {
38
+ expect(render(dedent `
39
+ # Hello
40
+
41
+ | Tables | Are | Cool |
42
+ | ------------- |:-------------:| -----:|
43
+ | col 3 is | right-aligned | $1600 |
44
+ | col 2 is | centered | $12 |
45
+ `)).toMatchInlineSnapshot(`
46
+ {
47
+ "errors": [],
48
+ "result": <React.Fragment>
49
+ <h1>
50
+ Hello
51
+ </h1>
52
+ <table>
53
+ <thead>
54
+ <tr
55
+ className=""
56
+ >
57
+ <td
58
+ className=""
59
+ >
60
+ Tables
61
+ </td>
62
+ <td
63
+ className=""
64
+ >
65
+ Are
66
+ </td>
67
+ <td
68
+ className=""
69
+ >
70
+ Cool
71
+ </td>
72
+ </tr>
73
+ </thead>
74
+ <tbody>
75
+ <tr
76
+ className=""
77
+ >
78
+ <td
79
+ className=""
80
+ >
81
+ col 3 is
82
+ </td>
83
+ <td
84
+ className=""
85
+ >
86
+ right-aligned
87
+ </td>
88
+ <td
89
+ className=""
90
+ >
91
+ $1600
92
+ </td>
93
+ </tr>
94
+ <tr
95
+ className=""
96
+ >
97
+ <td
98
+ className=""
99
+ >
100
+ col 2 is
101
+ </td>
102
+ <td
103
+ className=""
104
+ >
105
+ centered
106
+ </td>
107
+ <td
108
+ className=""
109
+ >
110
+ $12
111
+ </td>
112
+ </tr>
113
+ </tbody>
114
+ </table>
115
+ </React.Fragment>,
116
+ }
117
+ `);
118
+ });
119
+ test('table, only head', () => {
120
+ expect(render(dedent `
121
+ # Hello
122
+
123
+ | Tables | Are | Cool |
124
+ | ------------- |:-------------:| -----:|
125
+
126
+ `)).toMatchInlineSnapshot(`
127
+ {
128
+ "errors": [],
129
+ "result": <React.Fragment>
130
+ <h1>
131
+ Hello
132
+ </h1>
133
+ <table>
134
+ <thead>
135
+ <tr
136
+ className=""
137
+ >
138
+ <td
139
+ className=""
140
+ >
141
+ Tables
142
+ </td>
143
+ <td
144
+ className=""
145
+ >
146
+ Are
147
+ </td>
148
+ <td
149
+ className=""
150
+ >
151
+ Cool
152
+ </td>
153
+ </tr>
154
+ </thead>
155
+ </table>
156
+ </React.Fragment>,
157
+ }
158
+ `);
159
+ });
160
+ test('inline jsx', () => {
161
+ expect(render(dedent `
44
162
  <Heading level={2}>hello</Heading>
45
163
  `)).toMatchInlineSnapshot(`
46
164
  {
@@ -57,8 +175,8 @@ function render(code) {
57
175
  }
58
176
  `);
59
177
  });
60
- (0, vitest_1.test)('block jsx', () => {
61
- (0, vitest_1.expect)(render((0, dedent_1.default) `
178
+ test('block jsx', () => {
179
+ expect(render(dedent `
62
180
  <Heading level={2}>
63
181
  > hello
64
182
  </Heading>
@@ -79,8 +197,8 @@ function render(code) {
79
197
  }
80
198
  `);
81
199
  });
82
- (0, vitest_1.test)('missing components are ignored', () => {
83
- (0, vitest_1.expect)(render((0, dedent_1.default) `
200
+ test('missing components are ignored', () => {
201
+ expect(render(dedent `
84
202
  <MissingComponent level={2} />
85
203
  `)).toMatchInlineSnapshot(`
86
204
  {
@@ -93,8 +211,8 @@ function render(code) {
93
211
  }
94
212
  `);
95
213
  });
96
- (0, vitest_1.test)('props parsing', () => {
97
- (0, vitest_1.expect)(render((0, dedent_1.default) `
214
+ test('props parsing', () => {
215
+ expect(render(dedent `
98
216
  <Heading
99
217
  num={2}
100
218
  doublequote={"a \" string"}
@@ -134,10 +252,10 @@ function render(code) {
134
252
  <Heading
135
253
  backTick="some \${expr} value"
136
254
  boolean={false}
137
- doublequote="a \\" string"
255
+ doublequote="a " string"
138
256
  null={null}
139
257
  num={2}
140
- quote="a \\" string"
258
+ quote="a " string"
141
259
  someJson={
142
260
  {
143
261
  "a": 1,
@@ -152,8 +270,8 @@ function render(code) {
152
270
  }
153
271
  `);
154
272
  });
155
- (0, vitest_1.test)('breaks', () => {
156
- (0, vitest_1.expect)(render((0, dedent_1.default) `
273
+ test('breaks', () => {
274
+ expect(render(dedent `
157
275
  To have a line break without a paragraph, you will need to use two trailing spaces.
158
276
  Note that this line is separate, but within the same paragraph.
159
277
  (This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
@@ -173,8 +291,8 @@ function render(code) {
173
291
  `);
174
292
  });
175
293
  // https://github.com/obedm503/markdown-kitchen-sink/blob/master/README.md?plain=1
176
- (0, vitest_1.test)('kitchen sink', () => {
177
- (0, vitest_1.expect)(render((0, dedent_1.default) `
294
+ test('kitchen sink', () => {
295
+ expect(render(dedent `
178
296
  # Markdown Kitchen Sink
179
297
  This file is https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet plus a few fixes and additions. Used by [obedm503/bootmark](https://github.com/obedm503/bootmark) to [demonstrate](https://obedm503.github.io/bootmark/docs/markdown-cheatsheet.html) it's styling features.
180
298
 
@@ -1199,150 +1317,158 @@ function render(code) {
1199
1317
  Colons can be used to align columns.
1200
1318
  </p>
1201
1319
  <table>
1202
- <tr
1203
- className=""
1204
- >
1205
- <td
1320
+ <thead>
1321
+ <tr
1206
1322
  className=""
1207
1323
  >
1208
- Tables
1209
- </td>
1210
- <td
1211
- className=""
1212
- >
1213
- Are
1214
- </td>
1215
- <td
1216
- className=""
1217
- >
1218
- Cool
1219
- </td>
1220
- </tr>
1221
- <tr
1222
- className=""
1223
- >
1224
- <td
1324
+ <td
1325
+ className=""
1326
+ >
1327
+ Tables
1328
+ </td>
1329
+ <td
1330
+ className=""
1331
+ >
1332
+ Are
1333
+ </td>
1334
+ <td
1335
+ className=""
1336
+ >
1337
+ Cool
1338
+ </td>
1339
+ </tr>
1340
+ </thead>
1341
+ <tbody>
1342
+ <tr
1225
1343
  className=""
1226
1344
  >
1227
- col 3 is
1228
- </td>
1229
- <td
1345
+ <td
1346
+ className=""
1347
+ >
1348
+ col 3 is
1349
+ </td>
1350
+ <td
1351
+ className=""
1352
+ >
1353
+ right-aligned
1354
+ </td>
1355
+ <td
1356
+ className=""
1357
+ >
1358
+ $1600
1359
+ </td>
1360
+ </tr>
1361
+ <tr
1230
1362
  className=""
1231
1363
  >
1232
- right-aligned
1233
- </td>
1234
- <td
1235
- className=""
1236
- >
1237
- $1600
1238
- </td>
1239
- </tr>
1240
- <tr
1241
- className=""
1242
- >
1243
- <td
1244
- className=""
1245
- >
1246
- col 2 is
1247
- </td>
1248
- <td
1249
- className=""
1250
- >
1251
- centered
1252
- </td>
1253
- <td
1254
- className=""
1255
- >
1256
- $12
1257
- </td>
1258
- </tr>
1259
- <tr
1260
- className=""
1261
- >
1262
- <td
1364
+ <td
1365
+ className=""
1366
+ >
1367
+ col 2 is
1368
+ </td>
1369
+ <td
1370
+ className=""
1371
+ >
1372
+ centered
1373
+ </td>
1374
+ <td
1375
+ className=""
1376
+ >
1377
+ $12
1378
+ </td>
1379
+ </tr>
1380
+ <tr
1263
1381
  className=""
1264
1382
  >
1265
- zebra stripes
1266
- </td>
1267
- <td
1268
- className=""
1269
- >
1270
- are neat
1271
- </td>
1272
- <td
1273
- className=""
1274
- >
1275
- $1
1276
- </td>
1277
- </tr>
1383
+ <td
1384
+ className=""
1385
+ >
1386
+ zebra stripes
1387
+ </td>
1388
+ <td
1389
+ className=""
1390
+ >
1391
+ are neat
1392
+ </td>
1393
+ <td
1394
+ className=""
1395
+ >
1396
+ $1
1397
+ </td>
1398
+ </tr>
1399
+ </tbody>
1278
1400
  </table>
1279
1401
  <p>
1280
1402
  There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.
1281
1403
  </p>
1282
1404
  <table>
1283
- <tr
1284
- className=""
1285
- >
1286
- <td
1287
- className=""
1288
- >
1289
- Markdown
1290
- </td>
1291
- <td
1292
- className=""
1293
- >
1294
- Less
1295
- </td>
1296
- <td
1297
- className=""
1298
- >
1299
- Pretty
1300
- </td>
1301
- </tr>
1302
- <tr
1303
- className=""
1304
- >
1305
- <td
1306
- className=""
1307
- >
1308
- <em>
1309
- Still
1310
- </em>
1311
- </td>
1312
- <td
1313
- className=""
1314
- >
1315
- <code>
1316
- renders
1317
- </code>
1318
- </td>
1319
- <td
1320
- className=""
1321
- >
1322
- <strong>
1323
- nicely
1324
- </strong>
1325
- </td>
1326
- </tr>
1327
- <tr
1328
- className=""
1329
- >
1330
- <td
1405
+ <thead>
1406
+ <tr
1331
1407
  className=""
1332
1408
  >
1333
- 1
1334
- </td>
1335
- <td
1409
+ <td
1410
+ className=""
1411
+ >
1412
+ Markdown
1413
+ </td>
1414
+ <td
1415
+ className=""
1416
+ >
1417
+ Less
1418
+ </td>
1419
+ <td
1420
+ className=""
1421
+ >
1422
+ Pretty
1423
+ </td>
1424
+ </tr>
1425
+ </thead>
1426
+ <tbody>
1427
+ <tr
1336
1428
  className=""
1337
1429
  >
1338
- 2
1339
- </td>
1340
- <td
1430
+ <td
1431
+ className=""
1432
+ >
1433
+ <em>
1434
+ Still
1435
+ </em>
1436
+ </td>
1437
+ <td
1438
+ className=""
1439
+ >
1440
+ <code>
1441
+ renders
1442
+ </code>
1443
+ </td>
1444
+ <td
1445
+ className=""
1446
+ >
1447
+ <strong>
1448
+ nicely
1449
+ </strong>
1450
+ </td>
1451
+ </tr>
1452
+ <tr
1341
1453
  className=""
1342
1454
  >
1343
- 3
1344
- </td>
1345
- </tr>
1455
+ <td
1456
+ className=""
1457
+ >
1458
+ 1
1459
+ </td>
1460
+ <td
1461
+ className=""
1462
+ >
1463
+ 2
1464
+ </td>
1465
+ <td
1466
+ className=""
1467
+ >
1468
+ 3
1469
+ </td>
1470
+ </tr>
1471
+ </tbody>
1346
1472
  </table>
1347
1473
  <a
1348
1474
  name="blockquotes"
@@ -1 +1 @@
1
- {"version":3,"file":"safe-mdx.test.js","sourceRoot":"","sources":["../src/safe-mdx.test.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,oDAA2B;AAC3B,mCAAqC;AACrC,yCAAuC;AACvC,KAAK,eAAK,CAAA;AAEV,MAAM,UAAU,GAAG;IACf,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;QACvB,OAAO,yCAAK,QAAQ,GAAM,CAAA;IAC9B,CAAC;CACG,CAAA;AAER,SAAS,MAAM,CAAC,IAAI;IAChB,MAAM,OAAO,GAAG,IAAI,qBAAU,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;IACpD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IAC5B,+CAA+C;I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"Render MDX in React without eval",
6
6
  "repository": "https://github.com/holocron-hq/safe-mdx",
7
- "main": "dist/safe-mdx.js",
8
- "types": "dist/safe-mdx.d.ts",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/safe-mdx.d.ts",
11
+ "default": "./dist/safe-mdx.js"
12
+ },
13
+ "./src/*": "./src/*.ts",
14
+ "./package.json": "./package.json"
15
+ },
9
16
  "scripts": {
10
17
  "build": "tsc",
18
+ "test": "vitest",
11
19
  "prepublishOnly": "pnpm build"
12
20
  },
13
21
  "files": [