@readme/markdown 6.59.1 → 6.60.0

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
@@ -24862,11 +24862,14 @@ var _require = __webpack_require__(7589),
24862
24862
  imgSizeByWidth = _require.imgSizeByWidth;
24863
24863
  var compileImage = function compileImage(image) {
24864
24864
  var _ref = image.data.hProperties || {},
24865
+ align = _ref.align,
24865
24866
  className = _ref.className,
24866
24867
  width = _ref.width;
24867
- var img = _objectSpread(_objectSpread({
24868
+ var img = _objectSpread(_objectSpread(_objectSpread({
24868
24869
  image: [image.url, image.title, image.alt]
24869
- }, width && {
24870
+ }, align && {
24871
+ align: align
24872
+ }), width && {
24870
24873
  sizing: imgSizeByWidth[width]
24871
24874
  }), className === 'border' && {
24872
24875
  border: true
@@ -24952,9 +24955,10 @@ module.exports = function ImageCompiler() {
24952
24955
 
24953
24956
  // Use magic block instead of markdown when there are certain defined properties we can't store in markdown
24954
24957
  var _ref = ((_node$data2 = node.data) === null || _node$data2 === void 0 ? void 0 : _node$data2.hProperties) || {},
24958
+ align = _ref.align,
24955
24959
  className = _ref.className,
24956
24960
  width = _ref.width;
24957
- var useMagicBlock = Boolean(width) || (className === null || className === void 0 ? void 0 : className.length);
24961
+ var useMagicBlock = Boolean(width) || (className === null || className === void 0 ? void 0 : className.length) || Boolean(align);
24958
24962
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
24959
24963
  args[_key - 1] = arguments[_key];
24960
24964
  }
@@ -25852,7 +25856,9 @@ function tokenize(_ref) {
25852
25856
  title: title,
25853
25857
  alt: alt || ('caption' in img ? img.caption : ''),
25854
25858
  data: {
25855
- hProperties: _objectSpread({
25859
+ hProperties: _objectSpread(_objectSpread({}, img.align && {
25860
+ align: img.align
25861
+ }), {}, {
25856
25862
  className: img.border ? 'border' : ''
25857
25863
  }, img.sizing && {
25858
25864
  width: imgWidthBySize[img.sizing]
@@ -26819,7 +26825,7 @@ var createSchema = function createSchema() {
26819
26825
  }
26820
26826
  schema.tagNames.push('rdme-pin');
26821
26827
  schema.tagNames.push('rdme-embed');
26822
- schema.attributes['rdme-embed'] = ['url', 'provider', 'html', 'title', 'href', 'iframe', 'width', 'height', 'image', 'favicon'];
26828
+ schema.attributes['rdme-embed'] = ['url', 'provider', 'html', 'title', 'href', 'iframe', 'width', 'height', 'image', 'favicon', 'align'];
26823
26829
  schema.attributes.a = ['href', 'title', 'class', 'className', 'download'];
26824
26830
  schema.tagNames.push('figure');
26825
26831
  schema.tagNames.push('figcaption');
package/dist/main.node.js CHANGED
@@ -9663,11 +9663,14 @@ var _require = __webpack_require__(7589),
9663
9663
  imgSizeByWidth = _require.imgSizeByWidth;
9664
9664
  var compileImage = function compileImage(image) {
9665
9665
  var _ref = image.data.hProperties || {},
9666
+ align = _ref.align,
9666
9667
  className = _ref.className,
9667
9668
  width = _ref.width;
9668
- var img = _objectSpread(_objectSpread({
9669
+ var img = _objectSpread(_objectSpread(_objectSpread({
9669
9670
  image: [image.url, image.title, image.alt]
9670
- }, width && {
9671
+ }, align && {
9672
+ align: align
9673
+ }), width && {
9671
9674
  sizing: imgSizeByWidth[width]
9672
9675
  }), className === 'border' && {
9673
9676
  border: true
@@ -9753,9 +9756,10 @@ module.exports = function ImageCompiler() {
9753
9756
 
9754
9757
  // Use magic block instead of markdown when there are certain defined properties we can't store in markdown
9755
9758
  var _ref = ((_node$data2 = node.data) === null || _node$data2 === void 0 ? void 0 : _node$data2.hProperties) || {},
9759
+ align = _ref.align,
9756
9760
  className = _ref.className,
9757
9761
  width = _ref.width;
9758
- var useMagicBlock = Boolean(width) || (className === null || className === void 0 ? void 0 : className.length);
9762
+ var useMagicBlock = Boolean(width) || (className === null || className === void 0 ? void 0 : className.length) || Boolean(align);
9759
9763
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
9760
9764
  args[_key - 1] = arguments[_key];
9761
9765
  }
@@ -10619,7 +10623,9 @@ function tokenize(_ref) {
10619
10623
  title: title,
10620
10624
  alt: alt || ('caption' in img ? img.caption : ''),
10621
10625
  data: {
10622
- hProperties: _objectSpread({
10626
+ hProperties: _objectSpread(_objectSpread({}, img.align && {
10627
+ align: img.align
10628
+ }), {}, {
10623
10629
  className: img.border ? 'border' : ''
10624
10630
  }, img.sizing && {
10625
10631
  width: imgWidthBySize[img.sizing]
@@ -11586,7 +11592,7 @@ var createSchema = function createSchema() {
11586
11592
  }
11587
11593
  schema.tagNames.push('rdme-pin');
11588
11594
  schema.tagNames.push('rdme-embed');
11589
- schema.attributes['rdme-embed'] = ['url', 'provider', 'html', 'title', 'href', 'iframe', 'width', 'height', 'image', 'favicon'];
11595
+ schema.attributes['rdme-embed'] = ['url', 'provider', 'html', 'title', 'href', 'iframe', 'width', 'height', 'image', 'favicon', 'align'];
11590
11596
  schema.attributes.a = ['href', 'title', 'class', 'className', 'download'];
11591
11597
  schema.tagNames.push('figure');
11592
11598
  schema.tagNames.push('figcaption');
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.59.1",
5
+ "version": "6.60.0",
6
6
  "main": "dist/main.node.js",
7
7
  "browser": "dist/main.js",
8
8
  "files": [