@readme/markdown 6.75.0-beta.75 → 6.75.0-beta.77

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/main.js CHANGED
@@ -65262,10 +65262,14 @@ const alignToStyle = (align) => {
65262
65262
  },
65263
65263
  };
65264
65264
  };
65265
+ const tables_to_jsx_isTableCell = (node) => ['tableHead', 'tableCell'].includes(node.type);
65265
65266
  const visitor = (table, index, parent) => {
65266
65267
  let hasFlowContent = false;
65267
65268
  const tableCellVisitor = (cell) => {
65268
- if (!phrasing(cell.children[0])) {
65269
+ const content = cell.children.length === 1 && cell.children[0].type === 'paragraph'
65270
+ ? cell.children[0].children[0]
65271
+ : cell.children[0];
65272
+ if (!phrasing(content)) {
65269
65273
  hasFlowContent = true;
65270
65274
  return EXIT;
65271
65275
  }
@@ -65276,9 +65280,11 @@ const visitor = (table, index, parent) => {
65276
65280
  }
65277
65281
  });
65278
65282
  };
65279
- visit(table, 'tableCell', tableCellVisitor);
65280
- if (!hasFlowContent)
65283
+ visit(table, tables_to_jsx_isTableCell, tableCellVisitor);
65284
+ if (!hasFlowContent) {
65285
+ table.type = 'table';
65281
65286
  return;
65287
+ }
65282
65288
  const styles = table.align.map(alignToStyle);
65283
65289
  const head = {
65284
65290
  type: 'mdxJsxFlowElement',
@@ -65320,8 +65326,9 @@ const visitor = (table, index, parent) => {
65320
65326
  // @ts-ignore
65321
65327
  parent.children[index] = jsx;
65322
65328
  };
65329
+ const isTable = (node) => ['table', 'tableau'].includes(node.type);
65323
65330
  const tablesToJsx = () => tree => {
65324
- visit(tree, 'table', visitor);
65331
+ visit(tree, isTable, visitor);
65325
65332
  return tree;
65326
65333
  };
65327
65334
  /* harmony default export */ const tables_to_jsx = (tablesToJsx);
package/dist/main.node.js CHANGED
@@ -66249,10 +66249,14 @@ const alignToStyle = (align) => {
66249
66249
  },
66250
66250
  };
66251
66251
  };
66252
+ const tables_to_jsx_isTableCell = (node) => ['tableHead', 'tableCell'].includes(node.type);
66252
66253
  const visitor = (table, index, parent) => {
66253
66254
  let hasFlowContent = false;
66254
66255
  const tableCellVisitor = (cell) => {
66255
- if (!phrasing(cell.children[0])) {
66256
+ const content = cell.children.length === 1 && cell.children[0].type === 'paragraph'
66257
+ ? cell.children[0].children[0]
66258
+ : cell.children[0];
66259
+ if (!phrasing(content)) {
66256
66260
  hasFlowContent = true;
66257
66261
  return EXIT;
66258
66262
  }
@@ -66263,9 +66267,11 @@ const visitor = (table, index, parent) => {
66263
66267
  }
66264
66268
  });
66265
66269
  };
66266
- visit(table, 'tableCell', tableCellVisitor);
66267
- if (!hasFlowContent)
66270
+ visit(table, tables_to_jsx_isTableCell, tableCellVisitor);
66271
+ if (!hasFlowContent) {
66272
+ table.type = 'table';
66268
66273
  return;
66274
+ }
66269
66275
  const styles = table.align.map(alignToStyle);
66270
66276
  const head = {
66271
66277
  type: 'mdxJsxFlowElement',
@@ -66307,8 +66313,9 @@ const visitor = (table, index, parent) => {
66307
66313
  // @ts-ignore
66308
66314
  parent.children[index] = jsx;
66309
66315
  };
66316
+ const isTable = (node) => ['table', 'tableau'].includes(node.type);
66310
66317
  const tablesToJsx = () => tree => {
66311
- visit(tree, 'table', visitor);
66318
+ visit(tree, isTable, visitor);
66312
66319
  return tree;
66313
66320
  };
66314
66321
  /* harmony default export */ const tables_to_jsx = (tablesToJsx);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@readme/markdown",
3
3
  "description": "ReadMe's React-based Markdown parser",
4
4
  "author": "Rafe Goldberg <rafe@readme.io>",
5
- "version": "6.75.0-beta.75",
5
+ "version": "6.75.0-beta.77",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",