@readme/markdown 6.75.0-beta.36 → 6.75.0-beta.37

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
@@ -78658,8 +78658,11 @@ const embed_embed = (node) => {
78658
78658
  var _a, _b;
78659
78659
  const { image, favicon, iframe, title, url } = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) || {};
78660
78660
  const complexEmbed = Boolean(image) || Boolean(favicon) || iframe;
78661
- if (complexEmbed)
78662
- return `<Embed ${Object.assign({}, (_b = node.data) === null || _b === void 0 ? void 0 : _b.hProperties)} />`;
78661
+ if (complexEmbed) {
78662
+ 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(' ');
78663
+ // TODO: make this a util
78664
+ return `<Embed ${attributes} />`;
78665
+ }
78663
78666
  return `[${title}](${url} "@embed")'`;
78664
78667
  };
78665
78668
  /* harmony default export */ const compile_embed = (embed_embed);
@@ -78670,8 +78673,10 @@ const gemoji_gemoji = (node) => `:${node.name}:`;
78670
78673
 
78671
78674
  ;// CONCATENATED MODULE: ./processor/compile/html-block.ts
78672
78675
  const htmlBlock = (node) => {
78676
+ var _a;
78673
78677
  const html = node.data.hProperties.html;
78674
- return `<HTMLBlock>${JSON.stringify({ html }, null, 2)}</HTMLBlock>`;
78678
+ const attributes = Object.keys((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties).map(key => { var _a; return `${key}="${(_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties[key]}"`; }).join(' ');
78679
+ return `<HTMLBlock${attributes && ' ' + attributes}>{\`${html}\`}</HTMLBlock>`;
78675
78680
  };
78676
78681
  /* harmony default export */ const html_block = (htmlBlock);
78677
78682
 
@@ -78680,8 +78685,10 @@ const compile_image_image = (node) => {
78680
78685
  var _a, _b;
78681
78686
  const { align, className, width } = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) || {};
78682
78687
  const complexImage = Boolean(width) || Boolean(className) || Boolean(align);
78683
- if (complexImage)
78684
- return `<Image ${Object.assign({}, (_b = node.data) === null || _b === void 0 ? void 0 : _b.hProperties)} />`;
78688
+ if (complexImage) {
78689
+ 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(' ');
78690
+ return `<Image ${attributes} />`;
78691
+ }
78685
78692
  return `![${node.alt}](${node.url}${node.title ? ` "${node.title}")` : ')'}`;
78686
78693
  };
78687
78694
  /* harmony default export */ const compile_image = (compile_image_image);
package/dist/main.node.js CHANGED
@@ -80798,8 +80798,11 @@ const embed_embed = (node) => {
80798
80798
  var _a, _b;
80799
80799
  const { image, favicon, iframe, title, url } = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) || {};
80800
80800
  const complexEmbed = Boolean(image) || Boolean(favicon) || iframe;
80801
- if (complexEmbed)
80802
- return `<Embed ${Object.assign({}, (_b = node.data) === null || _b === void 0 ? void 0 : _b.hProperties)} />`;
80801
+ if (complexEmbed) {
80802
+ 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(' ');
80803
+ // TODO: make this a util
80804
+ return `<Embed ${attributes} />`;
80805
+ }
80803
80806
  return `[${title}](${url} "@embed")'`;
80804
80807
  };
80805
80808
  /* harmony default export */ const compile_embed = (embed_embed);
@@ -80810,8 +80813,10 @@ const gemoji_gemoji = (node) => `:${node.name}:`;
80810
80813
 
80811
80814
  ;// CONCATENATED MODULE: ./processor/compile/html-block.ts
80812
80815
  const htmlBlock = (node) => {
80816
+ var _a;
80813
80817
  const html = node.data.hProperties.html;
80814
- return `<HTMLBlock>${JSON.stringify({ html }, null, 2)}</HTMLBlock>`;
80818
+ const attributes = Object.keys((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties).map(key => { var _a; return `${key}="${(_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties[key]}"`; }).join(' ');
80819
+ return `<HTMLBlock${attributes && ' ' + attributes}>{\`${html}\`}</HTMLBlock>`;
80815
80820
  };
80816
80821
  /* harmony default export */ const html_block = (htmlBlock);
80817
80822
 
@@ -80820,8 +80825,10 @@ const compile_image_image = (node) => {
80820
80825
  var _a, _b;
80821
80826
  const { align, className, width } = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) || {};
80822
80827
  const complexImage = Boolean(width) || Boolean(className) || Boolean(align);
80823
- if (complexImage)
80824
- return `<Image ${Object.assign({}, (_b = node.data) === null || _b === void 0 ? void 0 : _b.hProperties)} />`;
80828
+ if (complexImage) {
80829
+ 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(' ');
80830
+ return `<Image ${attributes} />`;
80831
+ }
80825
80832
  return `![${node.alt}](${node.url}${node.title ? ` "${node.title}")` : ')'}`;
80826
80833
  };
80827
80834
  /* harmony default export */ const compile_image = (compile_image_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.36",
5
+ "version": "6.75.0-beta.37",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",