@readme/markdown 7.6.2 → 7.6.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.
package/dist/main.js CHANGED
@@ -65413,6 +65413,7 @@ const alignToStyle = (align) => {
65413
65413
  };
65414
65414
  };
65415
65415
  const tables_to_jsx_isTableCell = (node) => ['tableHead', 'tableCell'].includes(node.type);
65416
+ const isLiteral = (node) => 'value' in node;
65416
65417
  const visitor = (table, index, parent) => {
65417
65418
  let hasFlowContent = false;
65418
65419
  const tableCellVisitor = (cell) => {
@@ -65428,8 +65429,8 @@ const visitor = (table, index, parent) => {
65428
65429
  hasFlowContent = true;
65429
65430
  return EXIT;
65430
65431
  }
65431
- visit(cell, 'text', (text) => {
65432
- if (text.value.match(/\n/)) {
65432
+ visit(cell, isLiteral, (node) => {
65433
+ if (node.value.match(/\n/)) {
65433
65434
  hasFlowContent = true;
65434
65435
  return EXIT;
65435
65436
  }
@@ -78125,8 +78126,10 @@ const tocToHast = (headings = []) => {
78125
78126
  while (stack.length > depth) {
78126
78127
  stack.pop();
78127
78128
  }
78128
- if (heading.properties)
78129
- stack[stack.length - 1].children.push(h('li', null, h('a', { href: `#${heading.properties.id}` }, heading.children)));
78129
+ if (heading.properties) {
78130
+ const content = lib_plain({ type: 'root', children: heading.children });
78131
+ stack[stack.length - 1].children.push(h('li', null, h('a', { href: `#${heading.properties.id}` }, content)));
78132
+ }
78130
78133
  });
78131
78134
  return ast;
78132
78135
  };
package/dist/main.node.js CHANGED
@@ -66400,6 +66400,7 @@ const alignToStyle = (align) => {
66400
66400
  };
66401
66401
  };
66402
66402
  const tables_to_jsx_isTableCell = (node) => ['tableHead', 'tableCell'].includes(node.type);
66403
+ const isLiteral = (node) => 'value' in node;
66403
66404
  const visitor = (table, index, parent) => {
66404
66405
  let hasFlowContent = false;
66405
66406
  const tableCellVisitor = (cell) => {
@@ -66415,8 +66416,8 @@ const visitor = (table, index, parent) => {
66415
66416
  hasFlowContent = true;
66416
66417
  return EXIT;
66417
66418
  }
66418
- visit(cell, 'text', (text) => {
66419
- if (text.value.match(/\n/)) {
66419
+ visit(cell, isLiteral, (node) => {
66420
+ if (node.value.match(/\n/)) {
66420
66421
  hasFlowContent = true;
66421
66422
  return EXIT;
66422
66423
  }
@@ -79112,8 +79113,10 @@ const tocToHast = (headings = []) => {
79112
79113
  while (stack.length > depth) {
79113
79114
  stack.pop();
79114
79115
  }
79115
- if (heading.properties)
79116
- stack[stack.length - 1].children.push(h('li', null, h('a', { href: `#${heading.properties.id}` }, heading.children)));
79116
+ if (heading.properties) {
79117
+ const content = lib_plain({ type: 'root', children: heading.children });
79118
+ stack[stack.length - 1].children.push(h('li', null, h('a', { href: `#${heading.properties.id}` }, content)));
79119
+ }
79117
79120
  });
79118
79121
  return ast;
79119
79122
  };
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": "7.6.2",
5
+ "version": "7.6.3",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",