@readme/markdown 6.43.2 → 6.46.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
@@ -9180,7 +9180,7 @@ Anchor.defaultProps = {
9180
9180
  title: ''
9181
9181
  };
9182
9182
 
9183
- var AnchorContext = function AnchorContext(props) {
9183
+ var AnchorWithContext = function AnchorWithContext(props) {
9184
9184
  return /*#__PURE__*/React.createElement(BaseUrlContext.Consumer, null, function (baseUrl) {
9185
9185
  return /*#__PURE__*/React.createElement(Anchor, _extends({
9186
9186
  baseUrl: baseUrl
@@ -9188,12 +9188,14 @@ var AnchorContext = function AnchorContext(props) {
9188
9188
  });
9189
9189
  };
9190
9190
 
9191
- module.exports = function (sanitizeSchema) {
9191
+ AnchorWithContext.sanitize = function (sanitizeSchema) {
9192
9192
  // This is for our custom link formats
9193
9193
  sanitizeSchema.protocols.href.push('doc', 'target', 'ref', 'blog', 'changelog', 'page');
9194
- return AnchorContext;
9194
+ return sanitizeSchema;
9195
9195
  };
9196
9196
 
9197
+ module.exports = AnchorWithContext;
9198
+
9197
9199
  /***/ }),
9198
9200
 
9199
9201
  /***/ 2015:
@@ -9257,11 +9259,13 @@ Callout.defaultProps = {
9257
9259
  node: null
9258
9260
  };
9259
9261
 
9260
- module.exports = function (sanitizeSchema) {
9262
+ Callout.sanitize = function (sanitizeSchema) {
9261
9263
  sanitizeSchema.attributes['rdme-callout'] = ['icon', 'theme', 'title', 'value'];
9262
- return Callout;
9264
+ return sanitizeSchema;
9263
9265
  };
9264
9266
 
9267
+ module.exports = Callout;
9268
+
9265
9269
  /***/ }),
9266
9270
 
9267
9271
  /***/ 8297:
@@ -9357,12 +9361,10 @@ function Code(props) {
9357
9361
  }), codeContent));
9358
9362
  }
9359
9363
 
9360
- function CreateCode(sanitizeSchema, _ref2) {
9364
+ function CreateCode(_ref2) {
9361
9365
  var copyButtons = _ref2.copyButtons,
9362
9366
  theme = _ref2.theme;
9363
- // This is for code blocks class name
9364
- sanitizeSchema.attributes.code = ['className', 'lang', 'meta', 'value']; // eslint-disable-next-line react/display-name
9365
-
9367
+ // eslint-disable-next-line react/display-name
9366
9368
  return function (props) {
9367
9369
  return /*#__PURE__*/React.createElement(Code, _extends({}, props, {
9368
9370
  copyButtons: copyButtons,
@@ -9386,10 +9388,14 @@ Code.defaultProps = {
9386
9388
  meta: ''
9387
9389
  };
9388
9390
 
9389
- module.exports = function (sanitizeSchema, opts) {
9390
- return CreateCode(sanitizeSchema, opts);
9391
+ CreateCode.sanitize = function (sanitizeSchema) {
9392
+ // This is for code blocks class name
9393
+ sanitizeSchema.attributes.code = ['className', 'lang', 'meta', 'value'];
9394
+ return sanitizeSchema;
9391
9395
  };
9392
9396
 
9397
+ module.exports = CreateCode;
9398
+
9393
9399
  /***/ }),
9394
9400
 
9395
9401
  /***/ 6553:
@@ -9468,9 +9474,7 @@ function CreateCodeTabs(_ref3) {
9468
9474
  };
9469
9475
  }
9470
9476
 
9471
- module.exports = function (_, opts) {
9472
- return CreateCodeTabs(opts);
9473
- };
9477
+ module.exports = CreateCodeTabs;
9474
9478
 
9475
9479
  /***/ }),
9476
9480
 
@@ -9625,10 +9629,7 @@ Embed.defaultProps = {
9625
9629
  height: '300px',
9626
9630
  width: '100%'
9627
9631
  };
9628
-
9629
- module.exports = function () {
9630
- return Embed;
9631
- };
9632
+ module.exports = Embed;
9632
9633
 
9633
9634
  /***/ }),
9634
9635
 
@@ -9773,7 +9774,11 @@ var HTMLBlock = /*#__PURE__*/function (_React$Component) {
9773
9774
  if (safeMode) {
9774
9775
  return /*#__PURE__*/React.createElement("pre", {
9775
9776
  className: "html-unsafe"
9776
- }, /*#__PURE__*/React.createElement("code", null, escape(html)));
9777
+ }, /*#__PURE__*/React.createElement("code", {
9778
+ dangerouslySetInnerHTML: {
9779
+ __html: escape(html)
9780
+ }
9781
+ }));
9777
9782
  }
9778
9783
 
9779
9784
  return /*#__PURE__*/React.createElement("div", {
@@ -9809,12 +9814,14 @@ var CreateHtmlBlock = function CreateHtmlBlock(_ref) {
9809
9814
  );
9810
9815
  };
9811
9816
 
9812
- module.exports = function (sanitize, opts) {
9813
- sanitize.tagNames.push('html-block');
9814
- sanitize.attributes['html-block'] = ['html', 'runScripts'];
9815
- return CreateHtmlBlock(opts);
9817
+ CreateHtmlBlock.sanitize = function (schema) {
9818
+ schema.tagNames.push('html-block');
9819
+ schema.attributes['html-block'] = ['html', 'runScripts'];
9820
+ return schema;
9816
9821
  };
9817
9822
 
9823
+ module.exports = CreateHtmlBlock;
9824
+
9818
9825
  /***/ }),
9819
9826
 
9820
9827
  /***/ 1984:
@@ -10115,11 +10122,53 @@ Image.defaultProps = {
10115
10122
  width: 'auto'
10116
10123
  };
10117
10124
 
10118
- module.exports = function (sanitizeSchema) {
10125
+ Image.sanitize = function (sanitizeSchema) {
10119
10126
  sanitizeSchema.attributes.img = ['className', 'title', 'alt', 'width', 'height', 'align', 'src', 'longDesc'];
10120
- return Image;
10127
+ return sanitizeSchema;
10121
10128
  };
10122
10129
 
10130
+ module.exports = Image;
10131
+
10132
+ /***/ }),
10133
+
10134
+ /***/ 3197:
10135
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10136
+
10137
+ var _extends = __webpack_require__(7154);
10138
+
10139
+ var React = __webpack_require__(4466);
10140
+
10141
+ var PropTypes = __webpack_require__(5697);
10142
+
10143
+ var Style = function Style(_ref) {
10144
+ var children = _ref.children,
10145
+ safeMode = _ref.safeMode;
10146
+ return safeMode ? /*#__PURE__*/React.createElement("pre", null, /*#__PURE__*/React.createElement("code", null, "<style>\n".concat(children, "\n</style>"))) : /*#__PURE__*/React.createElement("style", null, children);
10147
+ };
10148
+
10149
+ Style.propTypes = {
10150
+ children: PropTypes.node,
10151
+ safeMode: PropTypes.bool
10152
+ };
10153
+
10154
+ var CreateStyle = function CreateStyle(_ref2) {
10155
+ var safeMode = _ref2.safeMode;
10156
+ return (// eslint-disable-next-line react/display-name
10157
+ function (props) {
10158
+ return /*#__PURE__*/React.createElement(Style, _extends({}, props, {
10159
+ safeMode: safeMode
10160
+ }));
10161
+ }
10162
+ );
10163
+ };
10164
+
10165
+ CreateStyle.sanitize = function (sanitize) {
10166
+ sanitize.tagNames.push('style');
10167
+ return sanitize;
10168
+ };
10169
+
10170
+ module.exports = CreateStyle;
10171
+
10123
10172
  /***/ }),
10124
10173
 
10125
10174
  /***/ 484:
@@ -10141,10 +10190,7 @@ function Table(props) {
10141
10190
  Table.propTypes = {
10142
10191
  children: PropTypes.arrayOf(PropTypes.node).isRequired
10143
10192
  };
10144
-
10145
- module.exports = function () {
10146
- return Table;
10147
- };
10193
+ module.exports = Table;
10148
10194
 
10149
10195
  /***/ }),
10150
10196
 
@@ -10191,8 +10237,9 @@ __webpack_require__.r(__webpack_exports__);
10191
10237
  /* harmony export */ "HTMLBlock": () => (/* reexport default from dynamic */ _HTMLBlock__WEBPACK_IMPORTED_MODULE_6___default.a),
10192
10238
  /* harmony export */ "Heading": () => (/* reexport default from dynamic */ _Heading__WEBPACK_IMPORTED_MODULE_7___default.a),
10193
10239
  /* harmony export */ "Image": () => (/* reexport default from dynamic */ _Image__WEBPACK_IMPORTED_MODULE_8___default.a),
10194
- /* harmony export */ "Table": () => (/* reexport default from dynamic */ _Table__WEBPACK_IMPORTED_MODULE_9___default.a),
10195
- /* harmony export */ "TableOfContents": () => (/* reexport default from dynamic */ _TableOfContents__WEBPACK_IMPORTED_MODULE_10___default.a)
10240
+ /* harmony export */ "Style": () => (/* reexport default from dynamic */ _Style__WEBPACK_IMPORTED_MODULE_9___default.a),
10241
+ /* harmony export */ "Table": () => (/* reexport default from dynamic */ _Table__WEBPACK_IMPORTED_MODULE_10___default.a),
10242
+ /* harmony export */ "TableOfContents": () => (/* reexport default from dynamic */ _TableOfContents__WEBPACK_IMPORTED_MODULE_11___default.a)
10196
10243
  /* harmony export */ });
10197
10244
  /* harmony import */ var _Anchor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8447);
10198
10245
  /* harmony import */ var _Anchor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_Anchor__WEBPACK_IMPORTED_MODULE_0__);
@@ -10212,10 +10259,13 @@ __webpack_require__.r(__webpack_exports__);
10212
10259
  /* harmony import */ var _Heading__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_Heading__WEBPACK_IMPORTED_MODULE_7__);
10213
10260
  /* harmony import */ var _Image__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9167);
10214
10261
  /* harmony import */ var _Image__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_Image__WEBPACK_IMPORTED_MODULE_8__);
10215
- /* harmony import */ var _Table__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(484);
10216
- /* harmony import */ var _Table__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_Table__WEBPACK_IMPORTED_MODULE_9__);
10217
- /* harmony import */ var _TableOfContents__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4479);
10218
- /* harmony import */ var _TableOfContents__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_TableOfContents__WEBPACK_IMPORTED_MODULE_10__);
10262
+ /* harmony import */ var _Style__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3197);
10263
+ /* harmony import */ var _Style__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_Style__WEBPACK_IMPORTED_MODULE_9__);
10264
+ /* harmony import */ var _Table__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(484);
10265
+ /* harmony import */ var _Table__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_Table__WEBPACK_IMPORTED_MODULE_10__);
10266
+ /* harmony import */ var _TableOfContents__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4479);
10267
+ /* harmony import */ var _TableOfContents__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_TableOfContents__WEBPACK_IMPORTED_MODULE_11__);
10268
+
10219
10269
 
10220
10270
 
10221
10271
 
@@ -10255,12 +10305,10 @@ var _slicedToArray = __webpack_require__(3038);
10255
10305
 
10256
10306
  /* eslint-disable no-param-reassign
10257
10307
  */
10258
- var sanitize = __webpack_require__(8229);
10259
-
10260
10308
  var kebabCase = __webpack_require__(5683);
10261
10309
 
10262
- var registerCustomComponents = function registerCustomComponents(components) {
10263
- var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'x';
10310
+ var registerCustomComponents = function registerCustomComponents(components, sanitize) {
10311
+ var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'x';
10264
10312
  return Object.entries(components).reduce(function (all, _ref) {
10265
10313
  var _ref2 = _slicedToArray(_ref, 2),
10266
10314
  tag = _ref2[0],
@@ -29256,16 +29304,51 @@ module.exports.sanitize = function (sanitizeSchema) {
29256
29304
  /***/ }),
29257
29305
 
29258
29306
  /***/ 4792:
29259
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
29307
+ /***/ ((module) => {
29308
+
29309
+ /* @note: copied from https://github.com/rehypejs/rehype-minify/blob/main/packages/hast-util-to-string/index.js
29310
+ */
29311
+ function toString(node) {
29312
+ if ('children' in node) {
29313
+ // eslint-disable-next-line no-use-before-define
29314
+ return all(node);
29315
+ }
29316
+
29317
+ return 'value' in node ? node.value : ' ';
29318
+ }
29260
29319
 
29261
- var toString = __webpack_require__(6034);
29320
+ function one(node) {
29321
+ if (node.type === 'text') {
29322
+ return node.value;
29323
+ } // eslint-disable-next-line no-use-before-define
29262
29324
 
29263
- module.exports = function () {
29264
- return function compile(node) {
29265
- return toString(node);
29266
- };
29325
+
29326
+ return 'children' in node ? all(node) : ' ';
29327
+ }
29328
+
29329
+ function all(node) {
29330
+ var index = -1;
29331
+ var result = []; // eslint-disable-next-line no-plusplus
29332
+
29333
+ while (++index < node.children.length) {
29334
+ result[index] = one(node.children[index]);
29335
+ }
29336
+
29337
+ return result.join(' ').trim().replace(/ +/, ' ');
29338
+ }
29339
+
29340
+ var Compiler = function Compiler(node) {
29341
+ return toString(node);
29267
29342
  };
29268
29343
 
29344
+ var toPlainText = function toPlainText() {
29345
+ Object.assign(this, {
29346
+ Compiler: Compiler
29347
+ });
29348
+ };
29349
+
29350
+ module.exports = toPlainText;
29351
+
29269
29352
  /***/ }),
29270
29353
 
29271
29354
  /***/ 9620:
@@ -29392,22 +29475,35 @@ module.exports.tableFlattening = transformer;
29392
29475
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
29393
29476
 
29394
29477
  var _require = __webpack_require__(2781),
29395
- sanitize = _require.defaultSchema; // Sanitization Schema Defaults
29478
+ defaultSchema = _require.defaultSchema;
29479
+
29480
+ var createSchema = function createSchema() {
29481
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
29482
+ safeMode = _ref.safeMode;
29483
+
29484
+ var schema = JSON.parse(JSON.stringify(defaultSchema)); // Sanitization Schema Defaults
29396
29485
 
29486
+ schema.clobberPrefix = '';
29487
+ schema.tagNames.push('span');
29488
+ schema.attributes['*'].push('class', 'className', 'align');
29397
29489
 
29398
- sanitize.clobberPrefix = '';
29399
- sanitize.tagNames.push('span', 'style');
29400
- sanitize.attributes['*'].push('class', 'className', 'align', 'style');
29401
- sanitize.tagNames.push('rdme-pin');
29402
- sanitize.tagNames.push('rdme-embed');
29403
- sanitize.attributes['rdme-embed'] = ['url', 'provider', 'html', 'title', 'href', 'iframe', 'width', 'height', 'image', 'favicon'];
29404
- sanitize.attributes.a = ['href', 'title', 'class', 'className', 'download'];
29405
- sanitize.tagNames.push('figure');
29406
- sanitize.tagNames.push('figcaption');
29407
- sanitize.tagNames.push('input'); // allow GitHub-style todo lists
29490
+ if (!safeMode) {
29491
+ schema.attributes['*'].push('style');
29492
+ }
29408
29493
 
29409
- sanitize.ancestors.input = ['li'];
29410
- module.exports = sanitize;
29494
+ schema.tagNames.push('rdme-pin');
29495
+ schema.tagNames.push('rdme-embed');
29496
+ schema.attributes['rdme-embed'] = ['url', 'provider', 'html', 'title', 'href', 'iframe', 'width', 'height', 'image', 'favicon'];
29497
+ schema.attributes.a = ['href', 'title', 'class', 'className', 'download'];
29498
+ schema.tagNames.push('figure');
29499
+ schema.tagNames.push('figcaption');
29500
+ schema.tagNames.push('input'); // allow GitHub-style todo lists
29501
+
29502
+ schema.ancestors.input = ['li'];
29503
+ return schema;
29504
+ };
29505
+
29506
+ module.exports = createSchema;
29411
29507
 
29412
29508
  /***/ }),
29413
29509
 
@@ -32805,72 +32901,6 @@ function isLiteral(node) {
32805
32901
  }
32806
32902
 
32807
32903
 
32808
- /***/ }),
32809
-
32810
- /***/ 6034:
32811
- /***/ ((module) => {
32812
-
32813
- "use strict";
32814
- /**
32815
- * @fileoverview
32816
- * Get the plain-text value of a hast node.
32817
- * @longdescription
32818
- * ## Use
32819
- *
32820
- * ```js
32821
- * var h = require('hastscript')
32822
- * var toString = require('hast-util-to-string')
32823
- *
32824
- * toString(h('p', 'Alpha'))
32825
- * //=> 'Alpha'
32826
- * toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))
32827
- * //=> 'Bold and italic.'
32828
- * ```
32829
- *
32830
- * ## API
32831
- *
32832
- * ### `toString(node)`
32833
- *
32834
- * Transform a node to a string.
32835
- */
32836
-
32837
-
32838
-
32839
- module.exports = toString
32840
-
32841
- function toString(node) {
32842
- // “The concatenation of data of all the Text node descendants of the context
32843
- // object, in tree order.”
32844
- if ('children' in node) {
32845
- return all(node)
32846
- }
32847
-
32848
- // “Context object’s data.”
32849
- return 'value' in node ? node.value : ''
32850
- }
32851
-
32852
- function one(node) {
32853
- if (node.type === 'text') {
32854
- return node.value
32855
- }
32856
-
32857
- return node.children ? all(node) : ''
32858
- }
32859
-
32860
- function all(node) {
32861
- var children = node.children
32862
- var length = children.length
32863
- var index = -1
32864
- var result = []
32865
-
32866
- while (++index < length) {
32867
- result[index] = one(children[index])
32868
- }
32869
-
32870
- return result.join('')
32871
- }
32872
-
32873
-
32874
32904
  /***/ }),
32875
32905
 
32876
32906
  /***/ 3560:
@@ -52077,7 +52107,7 @@ var unified = __webpack_require__(8835);
52077
52107
  */
52078
52108
 
52079
52109
 
52080
- var sanitize = __webpack_require__(8229);
52110
+ var createSchema = __webpack_require__(8229);
52081
52111
 
52082
52112
  var generateTOC = __webpack_require__(3263);
52083
52113
 
@@ -52129,14 +52159,13 @@ var GlossaryItem = Components.GlossaryItem,
52129
52159
  Image = Components.Image,
52130
52160
  Embed = Components.Embed,
52131
52161
  HTMLBlock = Components.HTMLBlock,
52162
+ Style = Components.Style,
52132
52163
  TableOfContents = Components.TableOfContents;
52133
52164
 
52134
52165
  /* Custom Unified Parsers
52135
52166
  */
52136
52167
 
52137
- var customParsers = Object.values(__webpack_require__(1332)).map(function (parser) {
52138
- return parser.sanitize(sanitize);
52139
- });
52168
+ var CustomParsers = Object.values(__webpack_require__(1332));
52140
52169
  /* Custom Unified Compilers
52141
52170
  */
52142
52171
 
@@ -52160,14 +52189,23 @@ var _require2 = __webpack_require__(2531),
52160
52189
 
52161
52190
  var registerCustomComponents = __webpack_require__(1264);
52162
52191
  /**
52163
- * Normalize Magic Block Raw Text
52192
+ * Setup Options
52193
+ * !Normalize Magic Block Raw Text!
52164
52194
  */
52165
52195
 
52166
52196
 
52167
52197
  function setup(blocks) {
52168
52198
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52169
52199
  // merge default and user options
52170
- opts = parseOptions(opts); // normalize magic block linebreaks
52200
+ opts = parseOptions(opts);
52201
+
52202
+ if (!opts.sanitize) {
52203
+ opts.sanitize = createSchema(opts);
52204
+ Object.values(Components).forEach(function (Component) {
52205
+ return Component.sanitize && Component.sanitize(opts.sanitize);
52206
+ });
52207
+ } // normalize magic block linebreaks
52208
+
52171
52209
 
52172
52210
  if (opts.normalize && blocks) {
52173
52211
  blocks = blocks.replace(/\[block:/g, '\n\n[block:').replace(/\[\/block\]/g, '[/block]\n');
@@ -52193,25 +52231,16 @@ var utils = {
52193
52231
  function processor() {
52194
52232
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
52195
52233
 
52196
- /*
52197
- * This is kinda complicated: "markdown" within ReadMe is
52198
- * often more than just markdown. It can also include HTML,
52199
- * as well as custom syntax constructs such as <<variables>>,
52200
- * and other special features.
52201
- *
52202
- * We use the Unified text processor to parse and transform
52203
- * Markdown to various output formats, such as a React component
52204
- * tree. (See https://github.com/unifiedjs/unified for more.)
52205
- *
52206
- * The order for processing ReadMe-flavored markdown is as follows:
52207
- * - parse markdown
52208
- * - parse custom syntaxes add-ons using custom compilers
52209
- * - convert from a remark mdast (markdown ast) to a rehype hast (hypertext ast)
52210
- * - extract any raw HTML elements
52211
- * - sanitize and remove any disallowed attributes
52212
- * - output the hast to a React vdom with our custom components
52213
- */
52214
- 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).use(remarkSlug).use(remarkDisableTokenizers, opts.disableTokenizers).use(remarkRehype, {
52234
+ var _setup = setup('', opts);
52235
+
52236
+ var _setup2 = _slicedToArray(_setup, 2);
52237
+
52238
+ opts = _setup2[1];
52239
+ var _opts = opts,
52240
+ sanitize = _opts.sanitize;
52241
+ 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) {
52242
+ return parser.sanitize(sanitize);
52243
+ })).use(remarkSlug).use(remarkDisableTokenizers, opts.disableTokenizers).use(remarkRehype, {
52215
52244
  allowDangerousHtml: true
52216
52245
  }).use(rehypeRaw).use(rehypeSanitize, sanitize);
52217
52246
  }
@@ -52220,12 +52249,12 @@ function plain(text) {
52220
52249
  var components = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
52221
52250
  if (!text) return null;
52222
52251
 
52223
- var _setup = setup(text, opts);
52252
+ var _setup3 = setup(text, opts);
52224
52253
 
52225
- var _setup2 = _slicedToArray(_setup, 2);
52254
+ var _setup4 = _slicedToArray(_setup3, 2);
52226
52255
 
52227
- text = _setup2[0];
52228
- opts = _setup2[1];
52256
+ text = _setup4[0];
52257
+ opts = _setup4[1];
52229
52258
  return processor(opts).use(rehypeReact, {
52230
52259
  createElement: React.createElement,
52231
52260
  Fragment: React.Fragment,
@@ -52249,46 +52278,57 @@ var count = {};
52249
52278
  function reactProcessor() {
52250
52279
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
52251
52280
  var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52252
- return processor(opts).use(sectionAnchorId).use(rehypeReact, {
52281
+
52282
+ var _setup5 = setup('', opts);
52283
+
52284
+ var _setup6 = _slicedToArray(_setup5, 2);
52285
+
52286
+ opts = _setup6[1];
52287
+ var _opts2 = opts,
52288
+ sanitize = _opts2.sanitize;
52289
+ return processor(_objectSpread({
52290
+ sanitize: sanitize
52291
+ }, opts)).use(sectionAnchorId).use(rehypeReact, {
52253
52292
  createElement: React.createElement,
52254
52293
  Fragment: React.Fragment,
52255
52294
  components: _objectSpread({
52256
- 'code-tabs': CodeTabs(sanitize, opts),
52257
- 'html-block': HTMLBlock(sanitize, opts),
52258
- 'rdme-callout': Callout(sanitize),
52295
+ 'code-tabs': CodeTabs(opts),
52296
+ 'html-block': HTMLBlock(opts),
52297
+ 'rdme-callout': Callout,
52259
52298
  'readme-variable': Variable,
52260
52299
  'readme-glossary-item': GlossaryItem,
52261
- 'rdme-embed': Embed(sanitize),
52300
+ 'rdme-embed': Embed,
52262
52301
  'rdme-pin': PinWrap,
52263
- table: Table(sanitize),
52264
- a: Anchor(sanitize),
52302
+ table: Table,
52303
+ a: Anchor,
52265
52304
  h1: Heading(1, count, opts),
52266
52305
  h2: Heading(2, count, opts),
52267
52306
  h3: Heading(3, count, opts),
52268
52307
  h4: Heading(4, count, opts),
52269
52308
  h5: Heading(5, count, opts),
52270
52309
  h6: Heading(6, count, opts),
52271
- code: Code(sanitize, opts),
52272
- img: Image(sanitize)
52273
- }, registerCustomComponents(components, opts.customComponentPrefix))
52310
+ code: Code(opts),
52311
+ img: Image,
52312
+ style: Style(opts)
52313
+ }, registerCustomComponents(components, sanitize, opts.customComponentPrefix))
52274
52314
  });
52275
52315
  }
52276
52316
  function react(content) {
52277
52317
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52278
52318
  var components = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
52279
52319
  if (!content) return null;else if (typeof content === 'string') {
52280
- var _setup3 = setup(content, opts);
52320
+ var _setup7 = setup(content, opts);
52281
52321
 
52282
- var _setup4 = _slicedToArray(_setup3, 2);
52322
+ var _setup8 = _slicedToArray(_setup7, 2);
52283
52323
 
52284
- content = _setup4[0];
52285
- opts = _setup4[1];
52324
+ content = _setup8[0];
52325
+ opts = _setup8[1];
52286
52326
  } else {
52287
- var _setup5 = setup('', opts);
52327
+ var _setup9 = setup('', opts);
52288
52328
 
52289
- var _setup6 = _slicedToArray(_setup5, 2);
52329
+ var _setup10 = _slicedToArray(_setup9, 2);
52290
52330
 
52291
- opts = _setup6[1];
52331
+ opts = _setup10[1];
52292
52332
  }
52293
52333
  var proc = reactProcessor(opts, components);
52294
52334
  if (typeof content === 'string') content = proc.parse(content);
@@ -52298,11 +52338,11 @@ function reactTOC(tree) {
52298
52338
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52299
52339
  if (!tree) return null;
52300
52340
 
52301
- var _setup7 = setup('', opts);
52341
+ var _setup11 = setup('', opts);
52302
52342
 
52303
- var _setup8 = _slicedToArray(_setup7, 2);
52343
+ var _setup12 = _slicedToArray(_setup11, 2);
52304
52344
 
52305
- opts = _setup8[1];
52345
+ opts = _setup12[1];
52306
52346
  var proc = processor(opts).use(rehypeReact, {
52307
52347
  createElement: React.createElement,
52308
52348
  components: {
@@ -52335,12 +52375,12 @@ function html(text) {
52335
52375
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52336
52376
  if (!text) return null;
52337
52377
 
52338
- var _setup9 = setup(text, opts);
52378
+ var _setup13 = setup(text, opts);
52339
52379
 
52340
- var _setup10 = _slicedToArray(_setup9, 2);
52380
+ var _setup14 = _slicedToArray(_setup13, 2);
52341
52381
 
52342
- text = _setup10[0];
52343
- opts = _setup10[1];
52382
+ text = _setup14[0];
52383
+ opts = _setup14[1];
52344
52384
  return processor(opts).use(rehypeStringify).processSync(text).contents;
52345
52385
  }
52346
52386
  /**
@@ -52351,12 +52391,12 @@ function hast(text) {
52351
52391
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52352
52392
  if (!text) return null;
52353
52393
 
52354
- var _setup11 = setup(text, opts);
52394
+ var _setup15 = setup(text, opts);
52355
52395
 
52356
- var _setup12 = _slicedToArray(_setup11, 2);
52396
+ var _setup16 = _slicedToArray(_setup15, 2);
52357
52397
 
52358
- text = _setup12[0];
52359
- opts = _setup12[1];
52398
+ text = _setup16[0];
52399
+ opts = _setup16[1];
52360
52400
  var rdmd = processor(opts).use(tableFlattening);
52361
52401
  var node = rdmd.parse(text);
52362
52402
  return rdmd.runSync(node);
@@ -52369,12 +52409,12 @@ function mdast(text) {
52369
52409
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52370
52410
  if (!text) return null;
52371
52411
 
52372
- var _setup13 = setup(text, opts);
52412
+ var _setup17 = setup(text, opts);
52373
52413
 
52374
- var _setup14 = _slicedToArray(_setup13, 2);
52414
+ var _setup18 = _slicedToArray(_setup17, 2);
52375
52415
 
52376
- text = _setup14[0];
52377
- opts = _setup14[1];
52416
+ text = _setup18[0];
52417
+ opts = _setup18[1];
52378
52418
  return processor(opts).parse(text);
52379
52419
  }
52380
52420
  /**
@@ -52385,12 +52425,12 @@ function astToPlainText(node) {
52385
52425
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52386
52426
  if (!node) return '';
52387
52427
 
52388
- var _setup15 = setup('', opts);
52428
+ var _setup19 = setup('', opts);
52389
52429
 
52390
- var _setup16 = _slicedToArray(_setup15, 2);
52430
+ var _setup20 = _slicedToArray(_setup19, 2);
52391
52431
 
52392
- opts = _setup16[1];
52393
- return processor(opts).use(toPlainText).runSync(node);
52432
+ opts = _setup20[1];
52433
+ return processor(opts).use(toPlainText).stringify(node);
52394
52434
  }
52395
52435
  /**
52396
52436
  * compile mdast to ReadMe-flavored markdown
@@ -52400,11 +52440,11 @@ function md(tree) {
52400
52440
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52401
52441
  if (!tree) return null;
52402
52442
 
52403
- var _setup17 = setup('', opts);
52443
+ var _setup21 = setup('', opts);
52404
52444
 
52405
- var _setup18 = _slicedToArray(_setup17, 2);
52445
+ var _setup22 = _slicedToArray(_setup21, 2);
52406
52446
 
52407
- opts = _setup18[1];
52447
+ opts = _setup22[1];
52408
52448
  return processor(opts).use(remarkStringify, opts.markdownOptions).use(customCompilers).stringify(tree);
52409
52449
  }
52410
52450