@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.node.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],
@@ -12078,16 +12126,51 @@ module.exports.sanitize = function (sanitizeSchema) {
12078
12126
  /***/ }),
12079
12127
 
12080
12128
  /***/ 4792:
12081
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12129
+ /***/ ((module) => {
12130
+
12131
+ /* @note: copied from https://github.com/rehypejs/rehype-minify/blob/main/packages/hast-util-to-string/index.js
12132
+ */
12133
+ function toString(node) {
12134
+ if ('children' in node) {
12135
+ // eslint-disable-next-line no-use-before-define
12136
+ return all(node);
12137
+ }
12138
+
12139
+ return 'value' in node ? node.value : ' ';
12140
+ }
12082
12141
 
12083
- var toString = __webpack_require__(6034);
12142
+ function one(node) {
12143
+ if (node.type === 'text') {
12144
+ return node.value;
12145
+ } // eslint-disable-next-line no-use-before-define
12084
12146
 
12085
- module.exports = function () {
12086
- return function compile(node) {
12087
- return toString(node);
12088
- };
12147
+
12148
+ return 'children' in node ? all(node) : ' ';
12149
+ }
12150
+
12151
+ function all(node) {
12152
+ var index = -1;
12153
+ var result = []; // eslint-disable-next-line no-plusplus
12154
+
12155
+ while (++index < node.children.length) {
12156
+ result[index] = one(node.children[index]);
12157
+ }
12158
+
12159
+ return result.join(' ').trim().replace(/ +/, ' ');
12160
+ }
12161
+
12162
+ var Compiler = function Compiler(node) {
12163
+ return toString(node);
12089
12164
  };
12090
12165
 
12166
+ var toPlainText = function toPlainText() {
12167
+ Object.assign(this, {
12168
+ Compiler: Compiler
12169
+ });
12170
+ };
12171
+
12172
+ module.exports = toPlainText;
12173
+
12091
12174
  /***/ }),
12092
12175
 
12093
12176
  /***/ 9620:
@@ -12214,22 +12297,35 @@ module.exports.tableFlattening = transformer;
12214
12297
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12215
12298
 
12216
12299
  var _require = __webpack_require__(2781),
12217
- sanitize = _require.defaultSchema; // Sanitization Schema Defaults
12300
+ defaultSchema = _require.defaultSchema;
12301
+
12302
+ var createSchema = function createSchema() {
12303
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
12304
+ safeMode = _ref.safeMode;
12305
+
12306
+ var schema = JSON.parse(JSON.stringify(defaultSchema)); // Sanitization Schema Defaults
12218
12307
 
12308
+ schema.clobberPrefix = '';
12309
+ schema.tagNames.push('span');
12310
+ schema.attributes['*'].push('class', 'className', 'align');
12219
12311
 
12220
- sanitize.clobberPrefix = '';
12221
- sanitize.tagNames.push('span', 'style');
12222
- sanitize.attributes['*'].push('class', 'className', 'align', 'style');
12223
- sanitize.tagNames.push('rdme-pin');
12224
- sanitize.tagNames.push('rdme-embed');
12225
- sanitize.attributes['rdme-embed'] = ['url', 'provider', 'html', 'title', 'href', 'iframe', 'width', 'height', 'image', 'favicon'];
12226
- sanitize.attributes.a = ['href', 'title', 'class', 'className', 'download'];
12227
- sanitize.tagNames.push('figure');
12228
- sanitize.tagNames.push('figcaption');
12229
- sanitize.tagNames.push('input'); // allow GitHub-style todo lists
12312
+ if (!safeMode) {
12313
+ schema.attributes['*'].push('style');
12314
+ }
12230
12315
 
12231
- sanitize.ancestors.input = ['li'];
12232
- module.exports = sanitize;
12316
+ schema.tagNames.push('rdme-pin');
12317
+ schema.tagNames.push('rdme-embed');
12318
+ schema.attributes['rdme-embed'] = ['url', 'provider', 'html', 'title', 'href', 'iframe', 'width', 'height', 'image', 'favicon'];
12319
+ schema.attributes.a = ['href', 'title', 'class', 'className', 'download'];
12320
+ schema.tagNames.push('figure');
12321
+ schema.tagNames.push('figcaption');
12322
+ schema.tagNames.push('input'); // allow GitHub-style todo lists
12323
+
12324
+ schema.ancestors.input = ['li'];
12325
+ return schema;
12326
+ };
12327
+
12328
+ module.exports = createSchema;
12233
12329
 
12234
12330
  /***/ }),
12235
12331
 
@@ -15627,72 +15723,6 @@ function isLiteral(node) {
15627
15723
  }
15628
15724
 
15629
15725
 
15630
- /***/ }),
15631
-
15632
- /***/ 6034:
15633
- /***/ ((module) => {
15634
-
15635
- "use strict";
15636
- /**
15637
- * @fileoverview
15638
- * Get the plain-text value of a hast node.
15639
- * @longdescription
15640
- * ## Use
15641
- *
15642
- * ```js
15643
- * var h = require('hastscript')
15644
- * var toString = require('hast-util-to-string')
15645
- *
15646
- * toString(h('p', 'Alpha'))
15647
- * //=> 'Alpha'
15648
- * toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))
15649
- * //=> 'Bold and italic.'
15650
- * ```
15651
- *
15652
- * ## API
15653
- *
15654
- * ### `toString(node)`
15655
- *
15656
- * Transform a node to a string.
15657
- */
15658
-
15659
-
15660
-
15661
- module.exports = toString
15662
-
15663
- function toString(node) {
15664
- // “The concatenation of data of all the Text node descendants of the context
15665
- // object, in tree order.”
15666
- if ('children' in node) {
15667
- return all(node)
15668
- }
15669
-
15670
- // “Context object’s data.”
15671
- return 'value' in node ? node.value : ''
15672
- }
15673
-
15674
- function one(node) {
15675
- if (node.type === 'text') {
15676
- return node.value
15677
- }
15678
-
15679
- return node.children ? all(node) : ''
15680
- }
15681
-
15682
- function all(node) {
15683
- var children = node.children
15684
- var length = children.length
15685
- var index = -1
15686
- var result = []
15687
-
15688
- while (++index < length) {
15689
- result[index] = one(children[index])
15690
- }
15691
-
15692
- return result.join('')
15693
- }
15694
-
15695
-
15696
15726
  /***/ }),
15697
15727
 
15698
15728
  /***/ 3560:
@@ -34422,7 +34452,7 @@ var unified = __webpack_require__(8835);
34422
34452
  */
34423
34453
 
34424
34454
 
34425
- var sanitize = __webpack_require__(8229);
34455
+ var createSchema = __webpack_require__(8229);
34426
34456
 
34427
34457
  var generateTOC = __webpack_require__(3263);
34428
34458
 
@@ -34474,14 +34504,13 @@ var GlossaryItem = Components.GlossaryItem,
34474
34504
  Image = Components.Image,
34475
34505
  Embed = Components.Embed,
34476
34506
  HTMLBlock = Components.HTMLBlock,
34507
+ Style = Components.Style,
34477
34508
  TableOfContents = Components.TableOfContents;
34478
34509
 
34479
34510
  /* Custom Unified Parsers
34480
34511
  */
34481
34512
 
34482
- var customParsers = Object.values(__webpack_require__(1332)).map(function (parser) {
34483
- return parser.sanitize(sanitize);
34484
- });
34513
+ var CustomParsers = Object.values(__webpack_require__(1332));
34485
34514
  /* Custom Unified Compilers
34486
34515
  */
34487
34516
 
@@ -34505,14 +34534,23 @@ var _require2 = __webpack_require__(2531),
34505
34534
 
34506
34535
  var registerCustomComponents = __webpack_require__(1264);
34507
34536
  /**
34508
- * Normalize Magic Block Raw Text
34537
+ * Setup Options
34538
+ * !Normalize Magic Block Raw Text!
34509
34539
  */
34510
34540
 
34511
34541
 
34512
34542
  function setup(blocks) {
34513
34543
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34514
34544
  // merge default and user options
34515
- opts = parseOptions(opts); // normalize magic block linebreaks
34545
+ opts = parseOptions(opts);
34546
+
34547
+ if (!opts.sanitize) {
34548
+ opts.sanitize = createSchema(opts);
34549
+ Object.values(Components).forEach(function (Component) {
34550
+ return Component.sanitize && Component.sanitize(opts.sanitize);
34551
+ });
34552
+ } // normalize magic block linebreaks
34553
+
34516
34554
 
34517
34555
  if (opts.normalize && blocks) {
34518
34556
  blocks = blocks.replace(/\[block:/g, '\n\n[block:').replace(/\[\/block\]/g, '[/block]\n');
@@ -34538,25 +34576,16 @@ var utils = {
34538
34576
  function processor() {
34539
34577
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
34540
34578
 
34541
- /*
34542
- * This is kinda complicated: "markdown" within ReadMe is
34543
- * often more than just markdown. It can also include HTML,
34544
- * as well as custom syntax constructs such as <<variables>>,
34545
- * and other special features.
34546
- *
34547
- * We use the Unified text processor to parse and transform
34548
- * Markdown to various output formats, such as a React component
34549
- * tree. (See https://github.com/unifiedjs/unified for more.)
34550
- *
34551
- * The order for processing ReadMe-flavored markdown is as follows:
34552
- * - parse markdown
34553
- * - parse custom syntaxes add-ons using custom compilers
34554
- * - convert from a remark mdast (markdown ast) to a rehype hast (hypertext ast)
34555
- * - extract any raw HTML elements
34556
- * - sanitize and remove any disallowed attributes
34557
- * - output the hast to a React vdom with our custom components
34558
- */
34559
- 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, {
34579
+ var _setup = setup('', opts);
34580
+
34581
+ var _setup2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup, 2);
34582
+
34583
+ opts = _setup2[1];
34584
+ var _opts = opts,
34585
+ sanitize = _opts.sanitize;
34586
+ 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) {
34587
+ return parser.sanitize(sanitize);
34588
+ })).use(remarkSlug).use(remarkDisableTokenizers, opts.disableTokenizers).use(remarkRehype, {
34560
34589
  allowDangerousHtml: true
34561
34590
  }).use(rehypeRaw).use(rehypeSanitize, sanitize);
34562
34591
  }
@@ -34565,12 +34594,12 @@ function plain(text) {
34565
34594
  var components = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
34566
34595
  if (!text) return null;
34567
34596
 
34568
- var _setup = setup(text, opts);
34597
+ var _setup3 = setup(text, opts);
34569
34598
 
34570
- var _setup2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup, 2);
34599
+ var _setup4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup3, 2);
34571
34600
 
34572
- text = _setup2[0];
34573
- opts = _setup2[1];
34601
+ text = _setup4[0];
34602
+ opts = _setup4[1];
34574
34603
  return processor(opts).use(rehypeReact, {
34575
34604
  createElement: React.createElement,
34576
34605
  Fragment: React.Fragment,
@@ -34594,46 +34623,57 @@ var count = {};
34594
34623
  function reactProcessor() {
34595
34624
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
34596
34625
  var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34597
- return processor(opts).use(sectionAnchorId).use(rehypeReact, {
34626
+
34627
+ var _setup5 = setup('', opts);
34628
+
34629
+ var _setup6 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup5, 2);
34630
+
34631
+ opts = _setup6[1];
34632
+ var _opts2 = opts,
34633
+ sanitize = _opts2.sanitize;
34634
+ return processor(_objectSpread({
34635
+ sanitize: sanitize
34636
+ }, opts)).use(sectionAnchorId).use(rehypeReact, {
34598
34637
  createElement: React.createElement,
34599
34638
  Fragment: React.Fragment,
34600
34639
  components: _objectSpread({
34601
- 'code-tabs': CodeTabs(sanitize, opts),
34602
- 'html-block': HTMLBlock(sanitize, opts),
34603
- 'rdme-callout': Callout(sanitize),
34640
+ 'code-tabs': CodeTabs(opts),
34641
+ 'html-block': HTMLBlock(opts),
34642
+ 'rdme-callout': Callout,
34604
34643
  'readme-variable': Variable,
34605
34644
  'readme-glossary-item': GlossaryItem,
34606
- 'rdme-embed': Embed(sanitize),
34645
+ 'rdme-embed': Embed,
34607
34646
  'rdme-pin': PinWrap,
34608
- table: Table(sanitize),
34609
- a: Anchor(sanitize),
34647
+ table: Table,
34648
+ a: Anchor,
34610
34649
  h1: Heading(1, count, opts),
34611
34650
  h2: Heading(2, count, opts),
34612
34651
  h3: Heading(3, count, opts),
34613
34652
  h4: Heading(4, count, opts),
34614
34653
  h5: Heading(5, count, opts),
34615
34654
  h6: Heading(6, count, opts),
34616
- code: Code(sanitize, opts),
34617
- img: Image(sanitize)
34618
- }, registerCustomComponents(components, opts.customComponentPrefix))
34655
+ code: Code(opts),
34656
+ img: Image,
34657
+ style: Style(opts)
34658
+ }, registerCustomComponents(components, sanitize, opts.customComponentPrefix))
34619
34659
  });
34620
34660
  }
34621
34661
  function react(content) {
34622
34662
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34623
34663
  var components = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
34624
34664
  if (!content) return null;else if (typeof content === 'string') {
34625
- var _setup3 = setup(content, opts);
34665
+ var _setup7 = setup(content, opts);
34626
34666
 
34627
- var _setup4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup3, 2);
34667
+ var _setup8 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup7, 2);
34628
34668
 
34629
- content = _setup4[0];
34630
- opts = _setup4[1];
34669
+ content = _setup8[0];
34670
+ opts = _setup8[1];
34631
34671
  } else {
34632
- var _setup5 = setup('', opts);
34672
+ var _setup9 = setup('', opts);
34633
34673
 
34634
- var _setup6 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup5, 2);
34674
+ var _setup10 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup9, 2);
34635
34675
 
34636
- opts = _setup6[1];
34676
+ opts = _setup10[1];
34637
34677
  }
34638
34678
  var proc = reactProcessor(opts, components);
34639
34679
  if (typeof content === 'string') content = proc.parse(content);
@@ -34643,11 +34683,11 @@ function reactTOC(tree) {
34643
34683
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34644
34684
  if (!tree) return null;
34645
34685
 
34646
- var _setup7 = setup('', opts);
34686
+ var _setup11 = setup('', opts);
34647
34687
 
34648
- var _setup8 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup7, 2);
34688
+ var _setup12 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup11, 2);
34649
34689
 
34650
- opts = _setup8[1];
34690
+ opts = _setup12[1];
34651
34691
  var proc = processor(opts).use(rehypeReact, {
34652
34692
  createElement: React.createElement,
34653
34693
  components: {
@@ -34680,12 +34720,12 @@ function html(text) {
34680
34720
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34681
34721
  if (!text) return null;
34682
34722
 
34683
- var _setup9 = setup(text, opts);
34723
+ var _setup13 = setup(text, opts);
34684
34724
 
34685
- var _setup10 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup9, 2);
34725
+ var _setup14 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup13, 2);
34686
34726
 
34687
- text = _setup10[0];
34688
- opts = _setup10[1];
34727
+ text = _setup14[0];
34728
+ opts = _setup14[1];
34689
34729
  return processor(opts).use(rehypeStringify).processSync(text).contents;
34690
34730
  }
34691
34731
  /**
@@ -34696,12 +34736,12 @@ function hast(text) {
34696
34736
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34697
34737
  if (!text) return null;
34698
34738
 
34699
- var _setup11 = setup(text, opts);
34739
+ var _setup15 = setup(text, opts);
34700
34740
 
34701
- var _setup12 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup11, 2);
34741
+ var _setup16 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup15, 2);
34702
34742
 
34703
- text = _setup12[0];
34704
- opts = _setup12[1];
34743
+ text = _setup16[0];
34744
+ opts = _setup16[1];
34705
34745
  var rdmd = processor(opts).use(tableFlattening);
34706
34746
  var node = rdmd.parse(text);
34707
34747
  return rdmd.runSync(node);
@@ -34714,12 +34754,12 @@ function mdast(text) {
34714
34754
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34715
34755
  if (!text) return null;
34716
34756
 
34717
- var _setup13 = setup(text, opts);
34757
+ var _setup17 = setup(text, opts);
34718
34758
 
34719
- var _setup14 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup13, 2);
34759
+ var _setup18 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup17, 2);
34720
34760
 
34721
- text = _setup14[0];
34722
- opts = _setup14[1];
34761
+ text = _setup18[0];
34762
+ opts = _setup18[1];
34723
34763
  return processor(opts).parse(text);
34724
34764
  }
34725
34765
  /**
@@ -34730,12 +34770,12 @@ function astToPlainText(node) {
34730
34770
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34731
34771
  if (!node) return '';
34732
34772
 
34733
- var _setup15 = setup('', opts);
34773
+ var _setup19 = setup('', opts);
34734
34774
 
34735
- var _setup16 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup15, 2);
34775
+ var _setup20 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup19, 2);
34736
34776
 
34737
- opts = _setup16[1];
34738
- return processor(opts).use(toPlainText).runSync(node);
34777
+ opts = _setup20[1];
34778
+ return processor(opts).use(toPlainText).stringify(node);
34739
34779
  }
34740
34780
  /**
34741
34781
  * compile mdast to ReadMe-flavored markdown
@@ -34745,11 +34785,11 @@ function md(tree) {
34745
34785
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34746
34786
  if (!tree) return null;
34747
34787
 
34748
- var _setup17 = setup('', opts);
34788
+ var _setup21 = setup('', opts);
34749
34789
 
34750
- var _setup18 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup17, 2);
34790
+ var _setup22 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup21, 2);
34751
34791
 
34752
- opts = _setup18[1];
34792
+ opts = _setup22[1];
34753
34793
  return processor(opts).use(remarkStringify, opts.markdownOptions).use(customCompilers).stringify(tree);
34754
34794
  }
34755
34795