@readme/markdown 6.75.0-beta.40 → 6.75.0-beta.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.
package/dist/enums.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export declare enum NodeTypes {
2
2
  callout = "rdme-callout",
3
3
  codeTabs = "code-tabs",
4
- emoji = "emoji",
4
+ emoji = "gemoji",
5
5
  i = "i",
6
6
  image = "image",
7
7
  htmlBlock = "html-block",
package/dist/main.js CHANGED
@@ -61409,7 +61409,7 @@ var NodeTypes;
61409
61409
  (function (NodeTypes) {
61410
61410
  NodeTypes["callout"] = "rdme-callout";
61411
61411
  NodeTypes["codeTabs"] = "code-tabs";
61412
- NodeTypes["emoji"] = "emoji";
61412
+ NodeTypes["emoji"] = "gemoji";
61413
61413
  NodeTypes["i"] = "i";
61414
61414
  NodeTypes["image"] = "image";
61415
61415
  NodeTypes["htmlBlock"] = "html-block";
@@ -78513,10 +78513,12 @@ const readme_components_types = {
78513
78513
  Callout: NodeTypes['callout'],
78514
78514
  Code: 'code',
78515
78515
  CodeTabs: NodeTypes['codeTabs'],
78516
+ Glossary: NodeTypes['glossary'],
78516
78517
  Image: 'image',
78517
78518
  Table: 'table',
78518
- tr: 'tableRow',
78519
+ Variable: NodeTypes['variable'],
78519
78520
  td: 'tableCell',
78521
+ tr: 'tableRow',
78520
78522
  };
78521
78523
  const attributes = (jsx) => jsx.attributes.reduce((memo, attr) => {
78522
78524
  if ('name' in attr) {
@@ -78544,13 +78546,13 @@ const coerceJsxToMd = ({ components = {} } = {}) => (node, index, parent) => {
78544
78546
  }
78545
78547
  else if (node.name === 'Image') {
78546
78548
  const { position } = node;
78547
- const { alt = '', src, title = null } = attributes(node);
78549
+ const { alt = '', url, title = null } = attributes(node);
78548
78550
  const mdNode = {
78549
78551
  alt,
78550
78552
  position,
78551
78553
  title,
78552
78554
  type: 'image',
78553
- url: src,
78555
+ url,
78554
78556
  };
78555
78557
  parent.children[index] = mdNode;
78556
78558
  }
@@ -78679,7 +78681,9 @@ const compile_image_image = (node) => {
78679
78681
  const { align, className, width } = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) || {};
78680
78682
  const complexImage = Boolean(width) || Boolean(className) || Boolean(align);
78681
78683
  if (complexImage) {
78682
- const attributes = Object.keys((_b = node.data) === null || _b === void 0 ? void 0 : _b.hProperties).map(key => { var _a; return `${key}="${(_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties[key]}"`; }).join(' ');
78684
+ const attributes = Object.keys((_b = node.data) === null || _b === void 0 ? void 0 : _b.hProperties)
78685
+ .map(key => { var _a; return `${key}="${(_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties[key]}"`; })
78686
+ .join(' ');
78683
78687
  return `<Image ${attributes} />`;
78684
78688
  }
78685
78689
  return `![${node.alt}](${node.url}${node.title ? ` "${node.title}")` : ')'}`;
@@ -78689,11 +78693,14 @@ const compile_image_image = (node) => {
78689
78693
  ;// CONCATENATED MODULE: ./processor/compile/compatibility.ts
78690
78694
 
78691
78695
  const compatibility = (node) => {
78696
+ var _a, _b;
78692
78697
  switch (node.type) {
78693
78698
  case NodeTypes.variable:
78694
78699
  return `<Variable name="${node.text}" />`;
78695
78700
  case NodeTypes.glossary:
78696
- return `<Glossary>${node.data.hProperties.term}</Glossary>`;
78701
+ // @ts-expect-error
78702
+ const term = ((_b = (_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) === null || _b === void 0 ? void 0 : _b.term) || node.children[0].value;
78703
+ return `<Glossary>${term}</Glossary>`;
78697
78704
  case NodeTypes.reusableContent:
78698
78705
  return `<${node.tag} />`;
78699
78706
  case 'html':
package/dist/main.node.js CHANGED
@@ -63549,7 +63549,7 @@ var NodeTypes;
63549
63549
  (function (NodeTypes) {
63550
63550
  NodeTypes["callout"] = "rdme-callout";
63551
63551
  NodeTypes["codeTabs"] = "code-tabs";
63552
- NodeTypes["emoji"] = "emoji";
63552
+ NodeTypes["emoji"] = "gemoji";
63553
63553
  NodeTypes["i"] = "i";
63554
63554
  NodeTypes["image"] = "image";
63555
63555
  NodeTypes["htmlBlock"] = "html-block";
@@ -80653,10 +80653,12 @@ const readme_components_types = {
80653
80653
  Callout: NodeTypes['callout'],
80654
80654
  Code: 'code',
80655
80655
  CodeTabs: NodeTypes['codeTabs'],
80656
+ Glossary: NodeTypes['glossary'],
80656
80657
  Image: 'image',
80657
80658
  Table: 'table',
80658
- tr: 'tableRow',
80659
+ Variable: NodeTypes['variable'],
80659
80660
  td: 'tableCell',
80661
+ tr: 'tableRow',
80660
80662
  };
80661
80663
  const attributes = (jsx) => jsx.attributes.reduce((memo, attr) => {
80662
80664
  if ('name' in attr) {
@@ -80684,13 +80686,13 @@ const coerceJsxToMd = ({ components = {} } = {}) => (node, index, parent) => {
80684
80686
  }
80685
80687
  else if (node.name === 'Image') {
80686
80688
  const { position } = node;
80687
- const { alt = '', src, title = null } = attributes(node);
80689
+ const { alt = '', url, title = null } = attributes(node);
80688
80690
  const mdNode = {
80689
80691
  alt,
80690
80692
  position,
80691
80693
  title,
80692
80694
  type: 'image',
80693
- url: src,
80695
+ url,
80694
80696
  };
80695
80697
  parent.children[index] = mdNode;
80696
80698
  }
@@ -80819,7 +80821,9 @@ const compile_image_image = (node) => {
80819
80821
  const { align, className, width } = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) || {};
80820
80822
  const complexImage = Boolean(width) || Boolean(className) || Boolean(align);
80821
80823
  if (complexImage) {
80822
- const attributes = Object.keys((_b = node.data) === null || _b === void 0 ? void 0 : _b.hProperties).map(key => { var _a; return `${key}="${(_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties[key]}"`; }).join(' ');
80824
+ const attributes = Object.keys((_b = node.data) === null || _b === void 0 ? void 0 : _b.hProperties)
80825
+ .map(key => { var _a; return `${key}="${(_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties[key]}"`; })
80826
+ .join(' ');
80823
80827
  return `<Image ${attributes} />`;
80824
80828
  }
80825
80829
  return `![${node.alt}](${node.url}${node.title ? ` "${node.title}")` : ')'}`;
@@ -80829,11 +80833,14 @@ const compile_image_image = (node) => {
80829
80833
  ;// CONCATENATED MODULE: ./processor/compile/compatibility.ts
80830
80834
 
80831
80835
  const compatibility = (node) => {
80836
+ var _a, _b;
80832
80837
  switch (node.type) {
80833
80838
  case NodeTypes.variable:
80834
80839
  return `<Variable name="${node.text}" />`;
80835
80840
  case NodeTypes.glossary:
80836
- return `<Glossary>${node.data.hProperties.term}</Glossary>`;
80841
+ // @ts-expect-error
80842
+ const term = ((_b = (_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) === null || _b === void 0 ? void 0 : _b.term) || node.children[0].value;
80843
+ return `<Glossary>${term}</Glossary>`;
80837
80844
  case NodeTypes.reusableContent:
80838
80845
  return `<${node.tag} />`;
80839
80846
  case 'html':
@@ -10,6 +10,15 @@ type CompatNodes = {
10
10
  term: string;
11
11
  };
12
12
  };
13
+ } | {
14
+ type: NodeTypes.glossary;
15
+ data: {
16
+ hName: 'Glossary';
17
+ };
18
+ children: [{
19
+ type: 'text';
20
+ value: string;
21
+ }];
13
22
  } | {
14
23
  type: NodeTypes.reusableContent;
15
24
  tag: string;
@@ -1,3 +1,3 @@
1
- import type { Image } from "mdast";
1
+ import type { Image } from 'mdast';
2
2
  declare const image: (node: Image) => string;
3
3
  export default image;
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.40",
5
+ "version": "6.75.0-beta.42",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",