@readme/markdown 6.57.0 → 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.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,83 +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/esm/slicedToArray.js + 3 modules
9044
- var slicedToArray = __webpack_require__(1037);
9045
- // EXTERNAL MODULE: external {"amd":"react","commonjs":"react","commonjs2":"react","root":"React","umd":"react"}
9046
- var external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_ = __webpack_require__(4466);
9047
- ;// CONCATENATED MODULE: ./hooks/useMediaQuery.js
9048
-
9049
-
9050
- var useMediaQuery = function useMediaQuery(query) {
9051
- var _useState = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useState)(false),
9052
- _useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
9053
- matches = _useState2[0],
9054
- setMatches = _useState2[1];
9055
- (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useEffect)(function () {
9056
- var matchQueryList = window.matchMedia(query);
9057
- if (matchQueryList.matches !== matches) setMatches(matchQueryList.matches);
9058
- var handleChange = function handleChange(e) {
9059
- return setMatches(e.matches);
9060
- };
9061
- matchQueryList.addEventListener('change', handleChange);
9062
- return function () {
9063
- return matchQueryList.removeEventListener('change', handleChange);
9064
- };
9065
- }, [matches, query]);
9066
- return matches;
9067
- };
9068
- /* harmony default export */ const hooks_useMediaQuery = (useMediaQuery);
9069
- ;// CONCATENATED MODULE: ./hooks/useColorScheme.js
9070
-
9071
-
9072
-
9073
- var useColorScheme = function useColorScheme() {
9074
- var htmlEl = document.querySelector('[data-color-mode]');
9075
- var _useState = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useState)(htmlEl.getAttribute('data-color-mode')),
9076
- _useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
9077
- colorMode = _useState2[0],
9078
- setColorMode = _useState2[1];
9079
- var storedTheme = localStorage.getItem('color-scheme') || 'auto';
9080
- var userColorScheme = hooks_useMediaQuery('(prefers-color-scheme: dark)') ? 'dark' : 'light';
9081
-
9082
- /* color scheme is determined by:
9083
- 1. Check if project defaults to "Same as System" (auto)
9084
- 2. If above is true and user has not set a project preference, use their OS preference
9085
- 3. Else use their project preference
9086
- 4. Else use project default (light or dark)
9087
- */
9088
- var colorScheme = colorMode === 'auto' && storedTheme === 'auto' ? userColorScheme : storedTheme || colorMode;
9089
- (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useEffect)(function () {
9090
- var observer = new MutationObserver(function (mutations) {
9091
- mutations.forEach(function (mutation) {
9092
- if (mutation.attributeName === 'data-color-mode') setColorMode(mutation.target.attributes['data-color-mode'].value);
9093
- });
9094
- });
9095
- observer.observe(htmlEl, {
9096
- attributes: true
9097
- });
9098
- return function () {
9099
- return observer.disconnect();
9100
- };
9101
- }, [htmlEl]);
9102
- return colorScheme;
9103
- };
9104
- /* harmony default export */ const hooks_useColorScheme = (useColorScheme);
9105
-
9106
- /***/ }),
9107
-
9108
9030
  /***/ 1264:
9109
9031
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9110
9032
 
@@ -25816,9 +25738,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
25816
25738
  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; }
25817
25739
  /* eslint-disable consistent-return */
25818
25740
  var RGXP = /^\[block:(.*)\]([^]+?)\[\/block\]/;
25819
- var compatibilityMode;
25820
- var safeMode;
25821
- var alwaysThrow;
25822
25741
  var WrapPinnedBlocks = function WrapPinnedBlocks(node, json) {
25823
25742
  if (!json.sidebar) return node;
25824
25743
  return {
@@ -25845,262 +25764,268 @@ var imgSizeByWidth = new Proxy(new Map(Array.from(imgSizeValues).reverse()), {
25845
25764
  return match ? match[1] : width in sizes ? sizes[width] : width;
25846
25765
  }
25847
25766
  });
25848
- function tokenize(eat, value) {
25849
- var _this = this;
25850
- var _ref = RGXP.exec(value) || [],
25851
- _ref2 = _slicedToArray(_ref, 3),
25852
- match = _ref2[0],
25853
- type = _ref2[1],
25854
- json = _ref2[2];
25855
- if (!type) return;
25856
- match = match.trim();
25857
- type = type.trim();
25858
- try {
25859
- json = JSON.parse(json);
25860
- } catch (err) {
25861
- json = {};
25862
- // eslint-disable-next-line no-console
25863
- console.error('Invalid Magic Block JSON:', err);
25864
- if (alwaysThrow) {
25865
- throw new Error('Invalid Magic Block JSON');
25866
- }
25867
- }
25868
- if (Object.keys(json).length < 1) return eat(match);
25869
- switch (type) {
25870
- case 'code':
25871
- {
25872
- var children = json.codes.map(function (obj) {
25873
- return {
25874
- type: 'code',
25875
- value: obj.code.trim(),
25876
- meta: obj.name || null,
25877
- lang: obj.language,
25878
- className: 'tab-panel',
25879
- data: {
25880
- hName: 'code',
25881
- hProperties: {
25882
- meta: obj.name || null,
25883
- lang: obj.language
25767
+ function tokenize(_ref) {
25768
+ var compatibilityMode = _ref.compatibilityMode,
25769
+ safeMode = _ref.safeMode,
25770
+ alwaysThrow = _ref.alwaysThrow;
25771
+ return function (eat, value) {
25772
+ var _this = this;
25773
+ var _ref2 = RGXP.exec(value) || [],
25774
+ _ref3 = _slicedToArray(_ref2, 3),
25775
+ match = _ref3[0],
25776
+ type = _ref3[1],
25777
+ json = _ref3[2];
25778
+ if (!type) return;
25779
+ match = match.trim();
25780
+ type = type.trim();
25781
+ try {
25782
+ json = JSON.parse(json);
25783
+ } catch (err) {
25784
+ json = {};
25785
+ // eslint-disable-next-line no-console
25786
+ console.error('Invalid Magic Block JSON:', err);
25787
+ if (alwaysThrow) {
25788
+ throw new Error('Invalid Magic Block JSON');
25789
+ }
25790
+ }
25791
+ if (Object.keys(json).length < 1) return eat(match);
25792
+ switch (type) {
25793
+ case 'code':
25794
+ {
25795
+ var children = json.codes.map(function (obj) {
25796
+ return {
25797
+ type: 'code',
25798
+ value: obj.code.trim(),
25799
+ meta: obj.name || null,
25800
+ lang: obj.language,
25801
+ className: 'tab-panel',
25802
+ data: {
25803
+ hName: 'code',
25804
+ hProperties: {
25805
+ meta: obj.name || null,
25806
+ lang: obj.language
25807
+ }
25884
25808
  }
25885
- }
25886
- };
25887
- });
25888
- if (children.length === 1) {
25889
- if (!children[0].value) return eat(match); // skip empty code tabs
25890
- if (children[0].name) return eat(match)(WrapPinnedBlocks(children[0], json));
25891
- }
25892
- return eat(match)(WrapPinnedBlocks({
25893
- children: children,
25894
- className: 'tabs',
25895
- data: {
25896
- hName: 'code-tabs'
25897
- },
25898
- type: 'code-tabs'
25899
- }, json));
25900
- }
25901
- case 'api-header':
25902
- {
25903
- var depth = json.level || (compatibilityMode ? 1 : 2);
25904
- return eat(match)(WrapPinnedBlocks({
25905
- type: 'heading',
25906
- depth: depth,
25907
- children: 'title' in json ? this.tokenizeInline(json.title, eat.now()) : []
25908
- }, json));
25909
- }
25910
- case 'image':
25911
- {
25912
- var imgs = json.images.map(function (img) {
25913
- if (!('image' in img)) return null;
25914
- var _img$image = _slicedToArray(img.image, 3),
25915
- url = _img$image[0],
25916
- title = _img$image[1],
25917
- alt = _img$image[2];
25918
- var block = {
25919
- type: 'image',
25920
- url: url,
25921
- title: title,
25922
- alt: alt || ('caption' in img ? img.caption : ''),
25923
- data: {
25924
- hProperties: _objectSpread({
25925
- className: img.border ? 'border' : ''
25926
- }, img.sizing && {
25927
- width: imgWidthBySize[img.sizing]
25928
- })
25929
- }
25930
- };
25931
- if (!img.caption) return block;
25932
- return {
25933
- type: 'figure',
25934
- url: url,
25809
+ };
25810
+ });
25811
+ if (children.length === 1) {
25812
+ if (!children[0].value) return eat(match); // skip empty code tabs
25813
+ if (children[0].name) return eat(match)(WrapPinnedBlocks(children[0], json));
25814
+ }
25815
+ return eat(match)(WrapPinnedBlocks({
25816
+ children: children,
25817
+ className: 'tabs',
25935
25818
  data: {
25936
- hName: 'figure'
25819
+ hName: 'code-tabs'
25937
25820
  },
25938
- children: [block, {
25939
- type: 'figcaption',
25821
+ type: 'code-tabs'
25822
+ }, json));
25823
+ }
25824
+ case 'api-header':
25825
+ {
25826
+ var depth = json.level || (compatibilityMode ? 1 : 2);
25827
+ return eat(match)(WrapPinnedBlocks({
25828
+ type: 'heading',
25829
+ depth: depth,
25830
+ children: 'title' in json ? this.tokenizeInline(json.title, eat.now()) : []
25831
+ }, json));
25832
+ }
25833
+ case 'image':
25834
+ {
25835
+ var imgs = json.images.map(function (img) {
25836
+ if (!('image' in img)) return null;
25837
+ var _img$image = _slicedToArray(img.image, 3),
25838
+ url = _img$image[0],
25839
+ title = _img$image[1],
25840
+ alt = _img$image[2];
25841
+ var block = {
25842
+ type: 'image',
25843
+ url: url,
25844
+ title: title,
25845
+ alt: alt || ('caption' in img ? img.caption : ''),
25940
25846
  data: {
25941
- hName: 'figcaption'
25847
+ hProperties: _objectSpread({
25848
+ className: img.border ? 'border' : ''
25849
+ }, img.sizing && {
25850
+ width: imgWidthBySize[img.sizing]
25851
+ })
25852
+ }
25853
+ };
25854
+ if (!img.caption) return block;
25855
+ return {
25856
+ type: 'figure',
25857
+ url: url,
25858
+ data: {
25859
+ hName: 'figure'
25942
25860
  },
25943
- children: _this.tokenizeBlock(img.caption, eat.now())
25944
- }]
25861
+ children: [block, {
25862
+ type: 'figcaption',
25863
+ data: {
25864
+ hName: 'figcaption'
25865
+ },
25866
+ children: _this.tokenizeBlock(img.caption, eat.now())
25867
+ }]
25868
+ };
25869
+ }).filter(function (e) {
25870
+ return e;
25871
+ }); // eslint-disable-line unicorn/prefer-array-find
25872
+ var img = imgs[0];
25873
+ if (!img || !img.url) return eat(match);
25874
+ return eat(match)(WrapPinnedBlocks(img, json));
25875
+ }
25876
+ case 'callout':
25877
+ {
25878
+ var types = {
25879
+ info: ['📘', 'info'],
25880
+ success: ['👍', 'okay'],
25881
+ warning: ['🚧', 'warn'],
25882
+ danger: ['❗️', 'error']
25945
25883
  };
25946
- }).filter(function (e) {
25947
- return e;
25948
- }); // eslint-disable-line unicorn/prefer-array-find
25949
- var img = imgs[0];
25950
- if (!img || !img.url) return eat(match);
25951
- return eat(match)(WrapPinnedBlocks(img, json));
25952
- }
25953
- case 'callout':
25954
- {
25955
- var types = {
25956
- info: ['📘', 'info'],
25957
- success: ['👍', 'okay'],
25958
- warning: ['🚧', 'warn'],
25959
- danger: ['❗️', 'error']
25960
- };
25961
- json.type = json.type in types ? types[json.type] : [json.icon || '👍', json.type];
25962
- var _json$type = _slicedToArray(json.type, 2),
25963
- icon = _json$type[0],
25964
- theme = _json$type[1];
25965
- if (!(json.title || json.body)) return eat(match);
25966
- return eat(match)(WrapPinnedBlocks({
25967
- type: 'rdme-callout',
25968
- data: {
25969
- hName: 'rdme-callout',
25970
- hProperties: {
25971
- theme: theme || 'default',
25972
- icon: icon,
25973
- title: json.title,
25974
- value: json.body
25975
- }
25976
- },
25977
- children: [].concat(_toConsumableArray(this.tokenizeBlock(json.title, eat.now())), _toConsumableArray(this.tokenizeBlock(json.body, eat.now())))
25978
- }, json));
25979
- }
25980
- case 'parameters':
25981
- {
25982
- var _json = json,
25983
- data = _json.data,
25984
- rows = _json.rows,
25985
- cols = _json.cols;
25986
- var tokenizeCell = this[compatibilityMode ? 'tokenizeBlock' : 'tokenizeInline'].bind(this);
25987
- if (!Object.keys(data).length) return eat(match); // skip empty tables
25988
-
25989
- var sparseData = Object.entries(data).reduce(function (mapped, _ref3) {
25990
- var _row;
25991
- var _ref4 = _slicedToArray(_ref3, 2),
25992
- key = _ref4[0],
25993
- v = _ref4[1];
25994
- var _key$split = key.split('-'),
25995
- _key$split2 = _slicedToArray(_key$split, 2),
25996
- row = _key$split2[0],
25997
- col = _key$split2[1];
25998
- row = row === 'h' ? 0 : parseInt(row, 10) + 1;
25999
- col = parseInt(col, 10);
26000
- mapped[_row = row] || (mapped[_row] = []);
26001
- mapped[row][col] = v;
26002
- return mapped;
26003
- }, []);
26004
-
26005
- // The header row is not counted in the rows
26006
- var _children = Array.from({
26007
- length: rows + 1
26008
- }, function (_, y) {
26009
- return {
26010
- type: 'tableRow',
26011
- children: Array.from({
26012
- length: cols
26013
- }, function (__, x) {
26014
- var _sparseData$y;
26015
- return {
26016
- type: y === 0 ? 'tableHead' : 'tableCell',
26017
- children: (_sparseData$y = sparseData[y]) !== null && _sparseData$y !== void 0 && _sparseData$y[x] ? tokenizeCell(sparseData[y][x], eat.now()) : [{
26018
- type: 'text',
26019
- value: ''
26020
- }]
26021
- };
26022
- })
25884
+ json.type = json.type in types ? types[json.type] : [json.icon || '👍', json.type];
25885
+ var _json$type = _slicedToArray(json.type, 2),
25886
+ icon = _json$type[0],
25887
+ theme = _json$type[1];
25888
+ if (!(json.title || json.body)) return eat(match);
25889
+ return eat(match)(WrapPinnedBlocks({
25890
+ type: 'rdme-callout',
25891
+ data: {
25892
+ hName: 'rdme-callout',
25893
+ hProperties: {
25894
+ theme: theme || 'default',
25895
+ icon: icon,
25896
+ title: json.title,
25897
+ value: json.body
25898
+ }
25899
+ },
25900
+ children: [].concat(_toConsumableArray(this.tokenizeBlock(json.title, eat.now())), _toConsumableArray(this.tokenizeBlock(json.body, eat.now())))
25901
+ }, json));
25902
+ }
25903
+ case 'parameters':
25904
+ {
25905
+ var _json = json,
25906
+ data = _json.data,
25907
+ rows = _json.rows,
25908
+ cols = _json.cols;
25909
+ var tokenizeCell = this[compatibilityMode ? 'tokenizeBlock' : 'tokenizeInline'].bind(this);
25910
+ if (!Object.keys(data).length) return eat(match); // skip empty tables
25911
+
25912
+ var sparseData = Object.entries(data).reduce(function (mapped, _ref4) {
25913
+ var _row;
25914
+ var _ref5 = _slicedToArray(_ref4, 2),
25915
+ key = _ref5[0],
25916
+ v = _ref5[1];
25917
+ var _key$split = key.split('-'),
25918
+ _key$split2 = _slicedToArray(_key$split, 2),
25919
+ row = _key$split2[0],
25920
+ col = _key$split2[1];
25921
+ row = row === 'h' ? 0 : parseInt(row, 10) + 1;
25922
+ col = parseInt(col, 10);
25923
+ mapped[_row = row] || (mapped[_row] = []);
25924
+ mapped[row][col] = v;
25925
+ return mapped;
25926
+ }, []);
25927
+
25928
+ // The header row is not counted in the rows
25929
+ var _children = Array.from({
25930
+ length: rows + 1
25931
+ }, function (_, y) {
25932
+ return {
25933
+ type: 'tableRow',
25934
+ children: Array.from({
25935
+ length: cols
25936
+ }, function (__, x) {
25937
+ var _sparseData$y;
25938
+ return {
25939
+ type: y === 0 ? 'tableHead' : 'tableCell',
25940
+ children: (_sparseData$y = sparseData[y]) !== null && _sparseData$y !== void 0 && _sparseData$y[x] ? tokenizeCell(sparseData[y][x], eat.now()) : [{
25941
+ type: 'text',
25942
+ value: ''
25943
+ }]
25944
+ };
25945
+ })
25946
+ };
25947
+ });
25948
+ var table = {
25949
+ type: 'table',
25950
+ align: 'align' in json ? json.align : new Array(json.cols).fill('left'),
25951
+ children: _children
26023
25952
  };
26024
- });
26025
- var table = {
26026
- type: 'table',
26027
- align: 'align' in json ? json.align : new Array(json.cols).fill('left'),
26028
- children: _children
26029
- };
26030
- return eat(match)(WrapPinnedBlocks(table, json));
26031
- }
26032
- case 'embed':
26033
- {
26034
- var _json2 = json,
26035
- title = _json2.title,
26036
- url = _json2.url,
26037
- html = _json2.html;
26038
- try {
26039
- json.provider = new URL(url).hostname.split(/(?:www)?\./).filter(function (i) {
26040
- return i;
26041
- }).join('.');
26042
- } catch (_unused) {
26043
- json.provider = url;
26044
- }
26045
- var _data = _objectSpread(_objectSpread({}, json), {}, {
26046
- url: url,
26047
- html: html,
26048
- title: title
26049
- });
26050
- return eat(match)(WrapPinnedBlocks({
26051
- type: 'embed',
26052
- children: [{
26053
- type: 'link',
25953
+ return eat(match)(WrapPinnedBlocks(table, json));
25954
+ }
25955
+ case 'embed':
25956
+ {
25957
+ var _json2 = json,
25958
+ title = _json2.title,
25959
+ url = _json2.url,
25960
+ html = _json2.html;
25961
+ try {
25962
+ json.provider = new URL(url).hostname.split(/(?:www)?\./).filter(function (i) {
25963
+ return i;
25964
+ }).join('.');
25965
+ } catch (_unused) {
25966
+ json.provider = url;
25967
+ }
25968
+ var _data = _objectSpread(_objectSpread({}, json), {}, {
26054
25969
  url: url,
26055
- title: json.provider,
25970
+ html: html,
25971
+ title: title
25972
+ });
25973
+ return eat(match)(WrapPinnedBlocks({
25974
+ type: 'embed',
26056
25975
  children: [{
26057
- type: 'text',
26058
- value: title
26059
- }]
26060
- }],
26061
- data: {
26062
- hProperties: _objectSpread(_objectSpread({}, _data), {}, {
26063
- href: url
26064
- }),
26065
- hName: 'rdme-embed'
26066
- }
26067
- }, json));
26068
- }
26069
- case 'html':
26070
- {
26071
- return eat(match)(WrapPinnedBlocks({
26072
- type: 'html-block',
26073
- data: {
26074
- hName: 'html-block',
26075
- hProperties: {
26076
- html: json.html,
26077
- runScripts: compatibilityMode,
26078
- safeMode: safeMode
25976
+ type: 'link',
25977
+ url: url,
25978
+ title: json.provider,
25979
+ children: [{
25980
+ type: 'text',
25981
+ value: title
25982
+ }]
25983
+ }],
25984
+ data: {
25985
+ hProperties: _objectSpread(_objectSpread({}, _data), {}, {
25986
+ href: url
25987
+ }),
25988
+ hName: 'rdme-embed'
26079
25989
  }
26080
- }
26081
- }, json));
26082
- }
26083
- default:
26084
- {
26085
- return eat(match)(WrapPinnedBlocks({
26086
- type: 'div',
26087
- children: this.tokenizeBlock(json.text || json.html, eat.now()),
26088
- data: _objectSpread({
26089
- hName: type || 'div',
26090
- hProperties: json
26091
- }, json)
26092
- }, json));
26093
- }
26094
- }
25990
+ }, json));
25991
+ }
25992
+ case 'html':
25993
+ {
25994
+ return eat(match)(WrapPinnedBlocks({
25995
+ type: 'html-block',
25996
+ data: {
25997
+ hName: 'html-block',
25998
+ hProperties: {
25999
+ html: json.html,
26000
+ runScripts: compatibilityMode,
26001
+ safeMode: safeMode
26002
+ }
26003
+ }
26004
+ }, json));
26005
+ }
26006
+ default:
26007
+ {
26008
+ return eat(match)(WrapPinnedBlocks({
26009
+ type: 'div',
26010
+ children: this.tokenizeBlock(json.text || json.html, eat.now()),
26011
+ data: _objectSpread({
26012
+ hName: type || 'div',
26013
+ hProperties: json
26014
+ }, json)
26015
+ }, json));
26016
+ }
26017
+ }
26018
+ };
26095
26019
  }
26096
26020
  function parser() {
26097
26021
  var Parser = this.Parser;
26098
26022
  var tokenizers = Parser.prototype.blockTokenizers;
26099
26023
  var methods = Parser.prototype.blockMethods;
26100
- if (this.data('compatibilityMode')) compatibilityMode = true;
26101
- if (this.data('safeMode')) safeMode = true;
26102
- if (this.data('alwaysThrow')) alwaysThrow = true;
26103
- tokenizers.magicBlocks = tokenize;
26024
+ tokenizers.magicBlocks = tokenize({
26025
+ compatibilityMode: this.data('compatibilityMode'),
26026
+ safeMode: this.data('safeMode'),
26027
+ alwaysThrow: this.data('alwaysThrow')
26028
+ });
26104
26029
  methods.splice(methods.indexOf('newline'), 0, 'magicBlocks');
26105
26030
  }
26106
26031
  module.exports = parser;
@@ -48977,8 +48902,8 @@ __webpack_require__.r(__webpack_exports__);
48977
48902
  /* harmony export */ "setup": () => (/* binding */ setup),
48978
48903
  /* harmony export */ "utils": () => (/* binding */ utils)
48979
48904
  /* harmony export */ });
48980
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4942);
48981
48905
  /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1037);
48906
+ /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4942);
48982
48907
 
48983
48908
 
48984
48909
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -49056,10 +48981,12 @@ function setup(blocks) {
49056
48981
  return ["".concat(blocks, "\n\n "), opts];
49057
48982
  }
49058
48983
  var utils = {
48984
+ get options() {
48985
+ return _objectSpread({}, options);
48986
+ },
49059
48987
  BaseUrlContext: BaseUrlContext,
49060
48988
  getHref: getHref,
49061
48989
  GlossaryContext: GlossaryItem.GlossaryContext,
49062
- options: options,
49063
48990
  VariablesContext: Variable.VariablesContext,
49064
48991
  calloutIcons: calloutIcons
49065
48992
  };