@readme/markdown 6.48.2 → 6.50.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.
@@ -16,7 +16,7 @@ const extractScripts = (html = '') => {
16
16
  return [cleaned, () => scripts.map(js => window.eval(js))];
17
17
  };
18
18
 
19
- class HTMLBlock extends React.Component {
19
+ class HTMLBlock extends React.PureComponent {
20
20
  constructor(props) {
21
21
  super(props);
22
22
  [this.html, this.exec] = extractScripts(this.props.html);
package/dist/main.js CHANGED
@@ -9736,10 +9736,10 @@ var extractScripts = function extractScripts() {
9736
9736
  }];
9737
9737
  };
9738
9738
 
9739
- var HTMLBlock = /*#__PURE__*/function (_React$Component) {
9739
+ var HTMLBlock = /*#__PURE__*/function (_React$PureComponent) {
9740
9740
  "use strict";
9741
9741
 
9742
- _inherits(HTMLBlock, _React$Component);
9742
+ _inherits(HTMLBlock, _React$PureComponent);
9743
9743
 
9744
9744
  var _super = _createSuper(HTMLBlock);
9745
9745
 
@@ -9792,7 +9792,7 @@ var HTMLBlock = /*#__PURE__*/function (_React$Component) {
9792
9792
  }]);
9793
9793
 
9794
9794
  return HTMLBlock;
9795
- }(React.Component);
9795
+ }(React.PureComponent);
9796
9796
 
9797
9797
  HTMLBlock.defaultProps = {
9798
9798
  runScripts: false,
@@ -27941,6 +27941,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
27941
27941
  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) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(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; }
27942
27942
 
27943
27943
  var options = {
27944
+ alwaysThrow: false,
27944
27945
  compatibilityMode: false,
27945
27946
  copyButtons: true,
27946
27947
  correctnewlines: false,
@@ -28483,8 +28484,8 @@ var emojiRegex = __webpack_require__(809);
28483
28484
  var rgx = new RegExp("^> ?(".concat(emojiRegex().source, ")(?: +(.+)?)?\n((?:>(?: .*)?\n)*)"));
28484
28485
  var themes = {
28485
28486
  "\uD83D\uDCD8": 'info',
28486
- "\u26A0\uFE0F": 'warn',
28487
28487
  "\uD83D\uDEA7": 'warn',
28488
+ "\u26A0\uFE0F": 'warn',
28488
28489
  "\uD83D\uDC4D": 'okay',
28489
28490
  "\u2705": 'okay',
28490
28491
  "\u2757": 'error',
@@ -28905,6 +28906,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
28905
28906
  var RGXP = /^\[block:(.*)\]([^]+?)\[\/block\]/;
28906
28907
  var compatibilityMode;
28907
28908
  var safeMode;
28909
+ var alwaysThrow;
28908
28910
 
28909
28911
  var WrapPinnedBlocks = function WrapPinnedBlocks(node, json) {
28910
28912
  if (!json.sidebar) return node;
@@ -28953,6 +28955,10 @@ function tokenize(eat, value) {
28953
28955
  json = {}; // eslint-disable-next-line no-console
28954
28956
 
28955
28957
  console.error('Invalid Magic Block JSON:', err);
28958
+
28959
+ if (alwaysThrow) {
28960
+ throw new Error('Invalid Magic Block JSON');
28961
+ }
28956
28962
  }
28957
28963
 
28958
28964
  if (Object.keys(json).length < 1) return eat(match);
@@ -29209,6 +29215,7 @@ function parser() {
29209
29215
  var methods = Parser.prototype.blockMethods;
29210
29216
  if (this.data('compatibilityMode')) compatibilityMode = true;
29211
29217
  if (this.data('safeMode')) safeMode = true;
29218
+ if (this.data('alwaysThrow')) alwaysThrow = true;
29212
29219
  tokenizers.magicBlocks = tokenize;
29213
29220
  methods.splice(methods.indexOf('newline'), 0, 'magicBlocks');
29214
29221
  }
@@ -29310,7 +29317,7 @@ module.exports.sanitize = function (sanitizeSchema) {
29310
29317
  */
29311
29318
  function toString(node) {
29312
29319
  // eslint-disable-next-line no-use-before-define
29313
- return 'children' in node ? all(node) : one(node);
29320
+ return 'children' in node ? all(node) || one(node) : one(node);
29314
29321
  }
29315
29322
 
29316
29323
  function one(node) {
@@ -52263,7 +52270,7 @@ function processor() {
52263
52270
  opts = _setup2[1];
52264
52271
  var _opts = opts,
52265
52272
  sanitize = _opts.sanitize;
52266
- return unified().use(remarkParse, opts.markdownOptions).use(remarkFrontmatter, ['yaml', 'toml']).data('settings', opts.settings).data('compatibilityMode', opts.compatibilityMode).use(!opts.correctnewlines ? remarkBreaks : function () {}).use(CustomParsers.map(function (parser) {
52273
+ return unified().use(remarkParse, opts.markdownOptions).use(remarkFrontmatter, ['yaml', 'toml']).data('settings', opts.settings).data('compatibilityMode', opts.compatibilityMode).data('alwaysThrow', opts.alwaysThrow).use(!opts.correctnewlines ? remarkBreaks : function () {}).use(CustomParsers.map(function (parser) {
52267
52274
  return parser.sanitize(sanitize);
52268
52275
  })).use(remarkSlug).use(remarkDisableTokenizers, opts.disableTokenizers).use(remarkRehype, {
52269
52276
  allowDangerousHtml: true
package/dist/main.node.js CHANGED
@@ -9736,10 +9736,10 @@ var extractScripts = function extractScripts() {
9736
9736
  }];
9737
9737
  };
9738
9738
 
9739
- var HTMLBlock = /*#__PURE__*/function (_React$Component) {
9739
+ var HTMLBlock = /*#__PURE__*/function (_React$PureComponent) {
9740
9740
  "use strict";
9741
9741
 
9742
- _inherits(HTMLBlock, _React$Component);
9742
+ _inherits(HTMLBlock, _React$PureComponent);
9743
9743
 
9744
9744
  var _super = _createSuper(HTMLBlock);
9745
9745
 
@@ -9792,7 +9792,7 @@ var HTMLBlock = /*#__PURE__*/function (_React$Component) {
9792
9792
  }]);
9793
9793
 
9794
9794
  return HTMLBlock;
9795
- }(React.Component);
9795
+ }(React.PureComponent);
9796
9796
 
9797
9797
  HTMLBlock.defaultProps = {
9798
9798
  runScripts: false,
@@ -10763,6 +10763,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
10763
10763
  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) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(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; }
10764
10764
 
10765
10765
  var options = {
10766
+ alwaysThrow: false,
10766
10767
  compatibilityMode: false,
10767
10768
  copyButtons: true,
10768
10769
  correctnewlines: false,
@@ -11305,8 +11306,8 @@ var emojiRegex = __webpack_require__(809);
11305
11306
  var rgx = new RegExp("^> ?(".concat(emojiRegex().source, ")(?: +(.+)?)?\n((?:>(?: .*)?\n)*)"));
11306
11307
  var themes = {
11307
11308
  "\uD83D\uDCD8": 'info',
11308
- "\u26A0\uFE0F": 'warn',
11309
11309
  "\uD83D\uDEA7": 'warn',
11310
+ "\u26A0\uFE0F": 'warn',
11310
11311
  "\uD83D\uDC4D": 'okay',
11311
11312
  "\u2705": 'okay',
11312
11313
  "\u2757": 'error',
@@ -11727,6 +11728,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
11727
11728
  var RGXP = /^\[block:(.*)\]([^]+?)\[\/block\]/;
11728
11729
  var compatibilityMode;
11729
11730
  var safeMode;
11731
+ var alwaysThrow;
11730
11732
 
11731
11733
  var WrapPinnedBlocks = function WrapPinnedBlocks(node, json) {
11732
11734
  if (!json.sidebar) return node;
@@ -11775,6 +11777,10 @@ function tokenize(eat, value) {
11775
11777
  json = {}; // eslint-disable-next-line no-console
11776
11778
 
11777
11779
  console.error('Invalid Magic Block JSON:', err);
11780
+
11781
+ if (alwaysThrow) {
11782
+ throw new Error('Invalid Magic Block JSON');
11783
+ }
11778
11784
  }
11779
11785
 
11780
11786
  if (Object.keys(json).length < 1) return eat(match);
@@ -12031,6 +12037,7 @@ function parser() {
12031
12037
  var methods = Parser.prototype.blockMethods;
12032
12038
  if (this.data('compatibilityMode')) compatibilityMode = true;
12033
12039
  if (this.data('safeMode')) safeMode = true;
12040
+ if (this.data('alwaysThrow')) alwaysThrow = true;
12034
12041
  tokenizers.magicBlocks = tokenize;
12035
12042
  methods.splice(methods.indexOf('newline'), 0, 'magicBlocks');
12036
12043
  }
@@ -12132,7 +12139,7 @@ module.exports.sanitize = function (sanitizeSchema) {
12132
12139
  */
12133
12140
  function toString(node) {
12134
12141
  // eslint-disable-next-line no-use-before-define
12135
- return 'children' in node ? all(node) : one(node);
12142
+ return 'children' in node ? all(node) || one(node) : one(node);
12136
12143
  }
12137
12144
 
12138
12145
  function one(node) {
@@ -34608,7 +34615,7 @@ function processor() {
34608
34615
  opts = _setup2[1];
34609
34616
  var _opts = opts,
34610
34617
  sanitize = _opts.sanitize;
34611
- return unified().use(remarkParse, opts.markdownOptions).use(remarkFrontmatter, ['yaml', 'toml']).data('settings', opts.settings).data('compatibilityMode', opts.compatibilityMode).use(!opts.correctnewlines ? remarkBreaks : function () {}).use(CustomParsers.map(function (parser) {
34618
+ return unified().use(remarkParse, opts.markdownOptions).use(remarkFrontmatter, ['yaml', 'toml']).data('settings', opts.settings).data('compatibilityMode', opts.compatibilityMode).data('alwaysThrow', opts.alwaysThrow).use(!opts.correctnewlines ? remarkBreaks : function () {}).use(CustomParsers.map(function (parser) {
34612
34619
  return parser.sanitize(sanitize);
34613
34620
  })).use(remarkSlug).use(remarkDisableTokenizers, opts.disableTokenizers).use(remarkRehype, {
34614
34621
  allowDangerousHtml: true
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.48.2",
5
+ "version": "6.50.0",
6
6
  "main": "dist/main.node.js",
7
7
  "browser": "dist/main.js",
8
8
  "files": [
@@ -73,19 +73,19 @@
73
73
  "@commitlint/config-angular": "^17.0.3",
74
74
  "@commitlint/config-conventional": "^17.0.3",
75
75
  "@hot-loader/react-dom": "^16.14.0",
76
- "@readme/eslint-config": "^8.8.3",
76
+ "@readme/eslint-config": "^9.0.0",
77
77
  "@readme/variable": "15.1.0",
78
78
  "@semantic-release/changelog": "^6.0.1",
79
79
  "@semantic-release/git": "^10.0.1",
80
80
  "@testing-library/jest-dom": "^5.16.4",
81
81
  "@testing-library/react": "^12.1.2",
82
- "@tippyjs/react": "^4.1.0",
83
- "babel-jest": "^28.1.0",
82
+ "@tippyjs/react": "^4.2.6",
83
+ "babel-jest": "^28.1.3",
84
84
  "babel-loader": "^8.2.5",
85
- "codemirror": "^5.65.3",
86
- "core-js": "^3.23.5",
85
+ "codemirror": "^5.54.0",
86
+ "core-js": "^3.24.1",
87
87
  "css-loader": "^6.7.1",
88
- "eslint": "^8.20.0",
88
+ "eslint": "^8.21.0",
89
89
  "husky": "^8.0.1",
90
90
  "identity-obj-proxy": "^3.0.0",
91
91
  "jest": "^28.1.3",
@@ -96,16 +96,16 @@
96
96
  "mini-css-extract-plugin": "^2.6.1",
97
97
  "node-sass": "^7.0.1",
98
98
  "prettier": "^2.7.1",
99
- "puppeteer": "^15.4.0",
99
+ "puppeteer": "^15.5.0",
100
100
  "react": "^16.14.0",
101
101
  "react-dom": "^16.14.0",
102
102
  "react-hot-loader": "^4.13.0",
103
103
  "regenerator-runtime": "^0.13.9",
104
- "sass-loader": "^12.6.0",
104
+ "sass-loader": "^13.0.2",
105
105
  "semantic-release": "^19.0.3",
106
106
  "string.prototype.trimend": "^1.0.5",
107
107
  "terser-webpack-plugin": "^5.3.3",
108
- "webpack": "^5.73.0",
108
+ "webpack": "^5.74.0",
109
109
  "webpack-cli": "^4.10.0",
110
110
  "webpack-dev-server": "^4.9.3",
111
111
  "webpack-merge": "^5.8.0"