@readme/markdown 6.57.1 → 6.58.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.node.js CHANGED
@@ -8113,7 +8113,6 @@ var _extends = __webpack_require__(7154);
8113
8113
  var copy = __webpack_require__(640);
8114
8114
  var PropTypes = __webpack_require__(5697);
8115
8115
  var React = __webpack_require__(4466);
8116
- var useColorScheme = __webpack_require__(3088);
8117
8116
 
8118
8117
  // Only load CodeMirror in the browser, for SSR
8119
8118
  // apps. Necessary because of people like this:
@@ -8165,15 +8164,15 @@ function Code(props) {
8165
8164
  className = props.className,
8166
8165
  copyButtons = props.copyButtons,
8167
8166
  lang = props.lang,
8168
- meta = props.meta;
8167
+ meta = props.meta,
8168
+ theme = props.theme;
8169
8169
  var langClass = className.search(/lang(?:uage)?-\w+/) >= 0 ? className.match(/\s?lang(?:uage)?-(\w+)/)[1] : '';
8170
8170
  var language = canonicalLanguage(lang) || langClass;
8171
8171
  var codeRef = React.createRef();
8172
- var colorScheme = useColorScheme.default();
8173
8172
  var codeOpts = {
8174
- customTheme: colorScheme === 'light' ? 'neo' : 'material-palenight',
8175
8173
  inline: !lang,
8176
- tokenizeVariables: true
8174
+ tokenizeVariables: true,
8175
+ dark: theme === 'dark'
8177
8176
  };
8178
8177
  var codeContent = syntaxHighlighter && children ? syntaxHighlighter(children[0], language, codeOpts) : (children === null || children === void 0 ? void 0 : children[0]) || '';
8179
8178
  return /*#__PURE__*/React.createElement(React.Fragment, null, copyButtons && /*#__PURE__*/React.createElement(CopyCode, {
@@ -8181,7 +8180,7 @@ function Code(props) {
8181
8180
  codeRef: codeRef
8182
8181
  }), /*#__PURE__*/React.createElement("code", {
8183
8182
  ref: codeRef,
8184
- className: ['rdmd-code', "lang-".concat(language), "theme-".concat(colorScheme)].join(' '),
8183
+ className: ['rdmd-code', "lang-".concat(language), "theme-".concat(theme)].join(' '),
8185
8184
  "data-lang": language,
8186
8185
  name: meta,
8187
8186
  suppressHydrationWarning: true
@@ -9028,84 +9027,6 @@ module.exports = React.createContext([]);
9028
9027
 
9029
9028
  /***/ }),
9030
9029
 
9031
- /***/ 3088:
9032
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9033
-
9034
- "use strict";
9035
- // ESM COMPAT FLAG
9036
- __webpack_require__.r(__webpack_exports__);
9037
-
9038
- // EXPORTS
9039
- __webpack_require__.d(__webpack_exports__, {
9040
- "default": () => (/* binding */ hooks_useColorScheme)
9041
- });
9042
-
9043
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
9044
- var slicedToArray = __webpack_require__(3038);
9045
- var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
9046
- // EXTERNAL MODULE: external {"amd":"react","commonjs":"react","commonjs2":"react","root":"React","umd":"react"}
9047
- var external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_ = __webpack_require__(4466);
9048
- ;// CONCATENATED MODULE: ./hooks/useMediaQuery.js
9049
-
9050
-
9051
- var useMediaQuery = function useMediaQuery(query) {
9052
- var _useState = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useState)(false),
9053
- _useState2 = slicedToArray_default()(_useState, 2),
9054
- matches = _useState2[0],
9055
- setMatches = _useState2[1];
9056
- (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useEffect)(function () {
9057
- var matchQueryList = window.matchMedia(query);
9058
- if (matchQueryList.matches !== matches) setMatches(matchQueryList.matches);
9059
- var handleChange = function handleChange(e) {
9060
- return setMatches(e.matches);
9061
- };
9062
- matchQueryList.addEventListener('change', handleChange);
9063
- return function () {
9064
- return matchQueryList.removeEventListener('change', handleChange);
9065
- };
9066
- }, [matches, query]);
9067
- return matches;
9068
- };
9069
- /* harmony default export */ const hooks_useMediaQuery = (useMediaQuery);
9070
- ;// CONCATENATED MODULE: ./hooks/useColorScheme.js
9071
-
9072
-
9073
-
9074
- var useColorScheme = function useColorScheme() {
9075
- var htmlEl = document.querySelector('[data-color-mode]');
9076
- var _useState = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useState)(htmlEl.getAttribute('data-color-mode')),
9077
- _useState2 = slicedToArray_default()(_useState, 2),
9078
- colorMode = _useState2[0],
9079
- setColorMode = _useState2[1];
9080
- var storedTheme = localStorage.getItem('color-scheme') || 'auto';
9081
- var userColorScheme = hooks_useMediaQuery('(prefers-color-scheme: dark)') ? 'dark' : 'light';
9082
-
9083
- /* color scheme is determined by:
9084
- 1. Check if project defaults to "Same as System" (auto)
9085
- 2. If above is true and user has not set a project preference, use their OS preference
9086
- 3. Else use their project preference
9087
- 4. Else use project default (light or dark)
9088
- */
9089
- var colorScheme = colorMode === 'auto' && storedTheme === 'auto' ? userColorScheme : storedTheme || colorMode;
9090
- (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useEffect)(function () {
9091
- var observer = new MutationObserver(function (mutations) {
9092
- mutations.forEach(function (mutation) {
9093
- if (mutation.attributeName === 'data-color-mode') setColorMode(mutation.target.attributes['data-color-mode'].value);
9094
- });
9095
- });
9096
- observer.observe(htmlEl, {
9097
- attributes: true
9098
- });
9099
- return function () {
9100
- return observer.disconnect();
9101
- };
9102
- }, [htmlEl]);
9103
- return colorScheme;
9104
- };
9105
- /* harmony default export */ const hooks_useColorScheme = (useColorScheme);
9106
-
9107
- /***/ }),
9108
-
9109
9030
  /***/ 1264:
9110
9031
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9111
9032
 
@@ -10584,9 +10505,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
10584
10505
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10585
10506
  /* eslint-disable consistent-return */
10586
10507
  var RGXP = /^\[block:(.*)\]([^]+?)\[\/block\]/;
10587
- var compatibilityMode;
10588
- var safeMode;
10589
- var alwaysThrow;
10590
10508
  var WrapPinnedBlocks = function WrapPinnedBlocks(node, json) {
10591
10509
  if (!json.sidebar) return node;
10592
10510
  return {
@@ -10613,262 +10531,268 @@ var imgSizeByWidth = new Proxy(new Map(Array.from(imgSizeValues).reverse()), {
10613
10531
  return match ? match[1] : width in sizes ? sizes[width] : width;
10614
10532
  }
10615
10533
  });
10616
- function tokenize(eat, value) {
10617
- var _this = this;
10618
- var _ref = RGXP.exec(value) || [],
10619
- _ref2 = _slicedToArray(_ref, 3),
10620
- match = _ref2[0],
10621
- type = _ref2[1],
10622
- json = _ref2[2];
10623
- if (!type) return;
10624
- match = match.trim();
10625
- type = type.trim();
10626
- try {
10627
- json = JSON.parse(json);
10628
- } catch (err) {
10629
- json = {};
10630
- // eslint-disable-next-line no-console
10631
- console.error('Invalid Magic Block JSON:', err);
10632
- if (alwaysThrow) {
10633
- throw new Error('Invalid Magic Block JSON');
10634
- }
10635
- }
10636
- if (Object.keys(json).length < 1) return eat(match);
10637
- switch (type) {
10638
- case 'code':
10639
- {
10640
- var children = json.codes.map(function (obj) {
10641
- return {
10642
- type: 'code',
10643
- value: obj.code.trim(),
10644
- meta: obj.name || null,
10645
- lang: obj.language,
10646
- className: 'tab-panel',
10647
- data: {
10648
- hName: 'code',
10649
- hProperties: {
10650
- meta: obj.name || null,
10651
- lang: obj.language
10534
+ function tokenize(_ref) {
10535
+ var compatibilityMode = _ref.compatibilityMode,
10536
+ safeMode = _ref.safeMode,
10537
+ alwaysThrow = _ref.alwaysThrow;
10538
+ return function (eat, value) {
10539
+ var _this = this;
10540
+ var _ref2 = RGXP.exec(value) || [],
10541
+ _ref3 = _slicedToArray(_ref2, 3),
10542
+ match = _ref3[0],
10543
+ type = _ref3[1],
10544
+ json = _ref3[2];
10545
+ if (!type) return;
10546
+ match = match.trim();
10547
+ type = type.trim();
10548
+ try {
10549
+ json = JSON.parse(json);
10550
+ } catch (err) {
10551
+ json = {};
10552
+ // eslint-disable-next-line no-console
10553
+ console.error('Invalid Magic Block JSON:', err);
10554
+ if (alwaysThrow) {
10555
+ throw new Error('Invalid Magic Block JSON');
10556
+ }
10557
+ }
10558
+ if (Object.keys(json).length < 1) return eat(match);
10559
+ switch (type) {
10560
+ case 'code':
10561
+ {
10562
+ var children = json.codes.map(function (obj) {
10563
+ return {
10564
+ type: 'code',
10565
+ value: obj.code.trim(),
10566
+ meta: obj.name || null,
10567
+ lang: obj.language,
10568
+ className: 'tab-panel',
10569
+ data: {
10570
+ hName: 'code',
10571
+ hProperties: {
10572
+ meta: obj.name || null,
10573
+ lang: obj.language
10574
+ }
10652
10575
  }
10653
- }
10654
- };
10655
- });
10656
- if (children.length === 1) {
10657
- if (!children[0].value) return eat(match); // skip empty code tabs
10658
- if (children[0].name) return eat(match)(WrapPinnedBlocks(children[0], json));
10659
- }
10660
- return eat(match)(WrapPinnedBlocks({
10661
- children: children,
10662
- className: 'tabs',
10663
- data: {
10664
- hName: 'code-tabs'
10665
- },
10666
- type: 'code-tabs'
10667
- }, json));
10668
- }
10669
- case 'api-header':
10670
- {
10671
- var depth = json.level || (compatibilityMode ? 1 : 2);
10672
- return eat(match)(WrapPinnedBlocks({
10673
- type: 'heading',
10674
- depth: depth,
10675
- children: 'title' in json ? this.tokenizeInline(json.title, eat.now()) : []
10676
- }, json));
10677
- }
10678
- case 'image':
10679
- {
10680
- var imgs = json.images.map(function (img) {
10681
- if (!('image' in img)) return null;
10682
- var _img$image = _slicedToArray(img.image, 3),
10683
- url = _img$image[0],
10684
- title = _img$image[1],
10685
- alt = _img$image[2];
10686
- var block = {
10687
- type: 'image',
10688
- url: url,
10689
- title: title,
10690
- alt: alt || ('caption' in img ? img.caption : ''),
10691
- data: {
10692
- hProperties: _objectSpread({
10693
- className: img.border ? 'border' : ''
10694
- }, img.sizing && {
10695
- width: imgWidthBySize[img.sizing]
10696
- })
10697
- }
10698
- };
10699
- if (!img.caption) return block;
10700
- return {
10701
- type: 'figure',
10702
- url: url,
10576
+ };
10577
+ });
10578
+ if (children.length === 1) {
10579
+ if (!children[0].value) return eat(match); // skip empty code tabs
10580
+ if (children[0].name) return eat(match)(WrapPinnedBlocks(children[0], json));
10581
+ }
10582
+ return eat(match)(WrapPinnedBlocks({
10583
+ children: children,
10584
+ className: 'tabs',
10703
10585
  data: {
10704
- hName: 'figure'
10586
+ hName: 'code-tabs'
10705
10587
  },
10706
- children: [block, {
10707
- type: 'figcaption',
10588
+ type: 'code-tabs'
10589
+ }, json));
10590
+ }
10591
+ case 'api-header':
10592
+ {
10593
+ var depth = json.level || (compatibilityMode ? 1 : 2);
10594
+ return eat(match)(WrapPinnedBlocks({
10595
+ type: 'heading',
10596
+ depth: depth,
10597
+ children: 'title' in json ? this.tokenizeInline(json.title, eat.now()) : []
10598
+ }, json));
10599
+ }
10600
+ case 'image':
10601
+ {
10602
+ var imgs = json.images.map(function (img) {
10603
+ if (!('image' in img)) return null;
10604
+ var _img$image = _slicedToArray(img.image, 3),
10605
+ url = _img$image[0],
10606
+ title = _img$image[1],
10607
+ alt = _img$image[2];
10608
+ var block = {
10609
+ type: 'image',
10610
+ url: url,
10611
+ title: title,
10612
+ alt: alt || ('caption' in img ? img.caption : ''),
10708
10613
  data: {
10709
- hName: 'figcaption'
10614
+ hProperties: _objectSpread({
10615
+ className: img.border ? 'border' : ''
10616
+ }, img.sizing && {
10617
+ width: imgWidthBySize[img.sizing]
10618
+ })
10619
+ }
10620
+ };
10621
+ if (!img.caption) return block;
10622
+ return {
10623
+ type: 'figure',
10624
+ url: url,
10625
+ data: {
10626
+ hName: 'figure'
10710
10627
  },
10711
- children: _this.tokenizeBlock(img.caption, eat.now())
10712
- }]
10628
+ children: [block, {
10629
+ type: 'figcaption',
10630
+ data: {
10631
+ hName: 'figcaption'
10632
+ },
10633
+ children: _this.tokenizeBlock(img.caption, eat.now())
10634
+ }]
10635
+ };
10636
+ }).filter(function (e) {
10637
+ return e;
10638
+ }); // eslint-disable-line unicorn/prefer-array-find
10639
+ var img = imgs[0];
10640
+ if (!img || !img.url) return eat(match);
10641
+ return eat(match)(WrapPinnedBlocks(img, json));
10642
+ }
10643
+ case 'callout':
10644
+ {
10645
+ var types = {
10646
+ info: ['📘', 'info'],
10647
+ success: ['👍', 'okay'],
10648
+ warning: ['🚧', 'warn'],
10649
+ danger: ['❗️', 'error']
10713
10650
  };
10714
- }).filter(function (e) {
10715
- return e;
10716
- }); // eslint-disable-line unicorn/prefer-array-find
10717
- var img = imgs[0];
10718
- if (!img || !img.url) return eat(match);
10719
- return eat(match)(WrapPinnedBlocks(img, json));
10720
- }
10721
- case 'callout':
10722
- {
10723
- var types = {
10724
- info: ['📘', 'info'],
10725
- success: ['👍', 'okay'],
10726
- warning: ['🚧', 'warn'],
10727
- danger: ['❗️', 'error']
10728
- };
10729
- json.type = json.type in types ? types[json.type] : [json.icon || '👍', json.type];
10730
- var _json$type = _slicedToArray(json.type, 2),
10731
- icon = _json$type[0],
10732
- theme = _json$type[1];
10733
- if (!(json.title || json.body)) return eat(match);
10734
- return eat(match)(WrapPinnedBlocks({
10735
- type: 'rdme-callout',
10736
- data: {
10737
- hName: 'rdme-callout',
10738
- hProperties: {
10739
- theme: theme || 'default',
10740
- icon: icon,
10741
- title: json.title,
10742
- value: json.body
10743
- }
10744
- },
10745
- children: [].concat(_toConsumableArray(this.tokenizeBlock(json.title, eat.now())), _toConsumableArray(this.tokenizeBlock(json.body, eat.now())))
10746
- }, json));
10747
- }
10748
- case 'parameters':
10749
- {
10750
- var _json = json,
10751
- data = _json.data,
10752
- rows = _json.rows,
10753
- cols = _json.cols;
10754
- var tokenizeCell = this[compatibilityMode ? 'tokenizeBlock' : 'tokenizeInline'].bind(this);
10755
- if (!Object.keys(data).length) return eat(match); // skip empty tables
10756
-
10757
- var sparseData = Object.entries(data).reduce(function (mapped, _ref3) {
10758
- var _row;
10759
- var _ref4 = _slicedToArray(_ref3, 2),
10760
- key = _ref4[0],
10761
- v = _ref4[1];
10762
- var _key$split = key.split('-'),
10763
- _key$split2 = _slicedToArray(_key$split, 2),
10764
- row = _key$split2[0],
10765
- col = _key$split2[1];
10766
- row = row === 'h' ? 0 : parseInt(row, 10) + 1;
10767
- col = parseInt(col, 10);
10768
- mapped[_row = row] || (mapped[_row] = []);
10769
- mapped[row][col] = v;
10770
- return mapped;
10771
- }, []);
10772
-
10773
- // The header row is not counted in the rows
10774
- var _children = Array.from({
10775
- length: rows + 1
10776
- }, function (_, y) {
10777
- return {
10778
- type: 'tableRow',
10779
- children: Array.from({
10780
- length: cols
10781
- }, function (__, x) {
10782
- var _sparseData$y;
10783
- return {
10784
- type: y === 0 ? 'tableHead' : 'tableCell',
10785
- children: (_sparseData$y = sparseData[y]) !== null && _sparseData$y !== void 0 && _sparseData$y[x] ? tokenizeCell(sparseData[y][x], eat.now()) : [{
10786
- type: 'text',
10787
- value: ''
10788
- }]
10789
- };
10790
- })
10651
+ json.type = json.type in types ? types[json.type] : [json.icon || '👍', json.type];
10652
+ var _json$type = _slicedToArray(json.type, 2),
10653
+ icon = _json$type[0],
10654
+ theme = _json$type[1];
10655
+ if (!(json.title || json.body)) return eat(match);
10656
+ return eat(match)(WrapPinnedBlocks({
10657
+ type: 'rdme-callout',
10658
+ data: {
10659
+ hName: 'rdme-callout',
10660
+ hProperties: {
10661
+ theme: theme || 'default',
10662
+ icon: icon,
10663
+ title: json.title,
10664
+ value: json.body
10665
+ }
10666
+ },
10667
+ children: [].concat(_toConsumableArray(this.tokenizeBlock(json.title, eat.now())), _toConsumableArray(this.tokenizeBlock(json.body, eat.now())))
10668
+ }, json));
10669
+ }
10670
+ case 'parameters':
10671
+ {
10672
+ var _json = json,
10673
+ data = _json.data,
10674
+ rows = _json.rows,
10675
+ cols = _json.cols;
10676
+ var tokenizeCell = this[compatibilityMode ? 'tokenizeBlock' : 'tokenizeInline'].bind(this);
10677
+ if (!Object.keys(data).length) return eat(match); // skip empty tables
10678
+
10679
+ var sparseData = Object.entries(data).reduce(function (mapped, _ref4) {
10680
+ var _row;
10681
+ var _ref5 = _slicedToArray(_ref4, 2),
10682
+ key = _ref5[0],
10683
+ v = _ref5[1];
10684
+ var _key$split = key.split('-'),
10685
+ _key$split2 = _slicedToArray(_key$split, 2),
10686
+ row = _key$split2[0],
10687
+ col = _key$split2[1];
10688
+ row = row === 'h' ? 0 : parseInt(row, 10) + 1;
10689
+ col = parseInt(col, 10);
10690
+ mapped[_row = row] || (mapped[_row] = []);
10691
+ mapped[row][col] = v;
10692
+ return mapped;
10693
+ }, []);
10694
+
10695
+ // The header row is not counted in the rows
10696
+ var _children = Array.from({
10697
+ length: rows + 1
10698
+ }, function (_, y) {
10699
+ return {
10700
+ type: 'tableRow',
10701
+ children: Array.from({
10702
+ length: cols
10703
+ }, function (__, x) {
10704
+ var _sparseData$y;
10705
+ return {
10706
+ type: y === 0 ? 'tableHead' : 'tableCell',
10707
+ children: (_sparseData$y = sparseData[y]) !== null && _sparseData$y !== void 0 && _sparseData$y[x] ? tokenizeCell(sparseData[y][x], eat.now()) : [{
10708
+ type: 'text',
10709
+ value: ''
10710
+ }]
10711
+ };
10712
+ })
10713
+ };
10714
+ });
10715
+ var table = {
10716
+ type: 'table',
10717
+ align: 'align' in json ? json.align : new Array(json.cols).fill('left'),
10718
+ children: _children
10791
10719
  };
10792
- });
10793
- var table = {
10794
- type: 'table',
10795
- align: 'align' in json ? json.align : new Array(json.cols).fill('left'),
10796
- children: _children
10797
- };
10798
- return eat(match)(WrapPinnedBlocks(table, json));
10799
- }
10800
- case 'embed':
10801
- {
10802
- var _json2 = json,
10803
- title = _json2.title,
10804
- url = _json2.url,
10805
- html = _json2.html;
10806
- try {
10807
- json.provider = new URL(url).hostname.split(/(?:www)?\./).filter(function (i) {
10808
- return i;
10809
- }).join('.');
10810
- } catch (_unused) {
10811
- json.provider = url;
10720
+ return eat(match)(WrapPinnedBlocks(table, json));
10812
10721
  }
10813
- var _data = _objectSpread(_objectSpread({}, json), {}, {
10814
- url: url,
10815
- html: html,
10816
- title: title
10817
- });
10818
- return eat(match)(WrapPinnedBlocks({
10819
- type: 'embed',
10820
- children: [{
10821
- type: 'link',
10722
+ case 'embed':
10723
+ {
10724
+ var _json2 = json,
10725
+ title = _json2.title,
10726
+ url = _json2.url,
10727
+ html = _json2.html;
10728
+ try {
10729
+ json.provider = new URL(url).hostname.split(/(?:www)?\./).filter(function (i) {
10730
+ return i;
10731
+ }).join('.');
10732
+ } catch (_unused) {
10733
+ json.provider = url;
10734
+ }
10735
+ var _data = _objectSpread(_objectSpread({}, json), {}, {
10822
10736
  url: url,
10823
- title: json.provider,
10737
+ html: html,
10738
+ title: title
10739
+ });
10740
+ return eat(match)(WrapPinnedBlocks({
10741
+ type: 'embed',
10824
10742
  children: [{
10825
- type: 'text',
10826
- value: title
10827
- }]
10828
- }],
10829
- data: {
10830
- hProperties: _objectSpread(_objectSpread({}, _data), {}, {
10831
- href: url
10832
- }),
10833
- hName: 'rdme-embed'
10834
- }
10835
- }, json));
10836
- }
10837
- case 'html':
10838
- {
10839
- return eat(match)(WrapPinnedBlocks({
10840
- type: 'html-block',
10841
- data: {
10842
- hName: 'html-block',
10843
- hProperties: {
10844
- html: json.html,
10845
- runScripts: compatibilityMode,
10846
- safeMode: safeMode
10743
+ type: 'link',
10744
+ url: url,
10745
+ title: json.provider,
10746
+ children: [{
10747
+ type: 'text',
10748
+ value: title
10749
+ }]
10750
+ }],
10751
+ data: {
10752
+ hProperties: _objectSpread(_objectSpread({}, _data), {}, {
10753
+ href: url
10754
+ }),
10755
+ hName: 'rdme-embed'
10847
10756
  }
10848
- }
10849
- }, json));
10850
- }
10851
- default:
10852
- {
10853
- return eat(match)(WrapPinnedBlocks({
10854
- type: 'div',
10855
- children: this.tokenizeBlock(json.text || json.html, eat.now()),
10856
- data: _objectSpread({
10857
- hName: type || 'div',
10858
- hProperties: json
10859
- }, json)
10860
- }, json));
10861
- }
10862
- }
10757
+ }, json));
10758
+ }
10759
+ case 'html':
10760
+ {
10761
+ return eat(match)(WrapPinnedBlocks({
10762
+ type: 'html-block',
10763
+ data: {
10764
+ hName: 'html-block',
10765
+ hProperties: {
10766
+ html: json.html,
10767
+ runScripts: compatibilityMode,
10768
+ safeMode: safeMode
10769
+ }
10770
+ }
10771
+ }, json));
10772
+ }
10773
+ default:
10774
+ {
10775
+ return eat(match)(WrapPinnedBlocks({
10776
+ type: 'div',
10777
+ children: this.tokenizeBlock(json.text || json.html, eat.now()),
10778
+ data: _objectSpread({
10779
+ hName: type || 'div',
10780
+ hProperties: json
10781
+ }, json)
10782
+ }, json));
10783
+ }
10784
+ }
10785
+ };
10863
10786
  }
10864
10787
  function parser() {
10865
10788
  var Parser = this.Parser;
10866
10789
  var tokenizers = Parser.prototype.blockTokenizers;
10867
10790
  var methods = Parser.prototype.blockMethods;
10868
- if (this.data('compatibilityMode')) compatibilityMode = true;
10869
- if (this.data('safeMode')) safeMode = true;
10870
- if (this.data('alwaysThrow')) alwaysThrow = true;
10871
- tokenizers.magicBlocks = tokenize;
10791
+ tokenizers.magicBlocks = tokenize({
10792
+ compatibilityMode: this.data('compatibilityMode'),
10793
+ safeMode: this.data('safeMode'),
10794
+ alwaysThrow: this.data('alwaysThrow')
10795
+ });
10872
10796
  methods.splice(methods.indexOf('newline'), 0, 'magicBlocks');
10873
10797
  }
10874
10798
  module.exports = parser;
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.57.1",
5
+ "version": "6.58.0",
6
6
  "main": "dist/main.node.js",
7
7
  "browser": "dist/main.js",
8
8
  "files": [