@readme/markdown 6.43.1 → 6.45.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/components/HTMLBlock/index.jsx +2 -8
- package/dist/main.js +270 -82
- package/dist/main.node.js +270 -82
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
*/
|
|
3
3
|
const React = require('react');
|
|
4
4
|
const PropTypes = require('prop-types');
|
|
5
|
+
const escape = require('lodash.escape');
|
|
5
6
|
|
|
6
7
|
const MATCH_SCRIPT_TAGS = /<script\b[^>]*>([\s\S]*?)<\/script *>\n?/gim;
|
|
7
8
|
|
|
@@ -15,13 +16,6 @@ const extractScripts = (html = '') => {
|
|
|
15
16
|
return [cleaned, () => scripts.map(js => window.eval(js))];
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
/**
|
|
19
|
-
* @hack: https://stackoverflow.com/a/30930653/659661
|
|
20
|
-
*/
|
|
21
|
-
const escapeHTML = html => {
|
|
22
|
-
return document.createElement('div').appendChild(document.createTextNode(html)).parentNode.innerHTML;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
19
|
class HTMLBlock extends React.Component {
|
|
26
20
|
constructor(props) {
|
|
27
21
|
super(props);
|
|
@@ -39,7 +33,7 @@ class HTMLBlock extends React.Component {
|
|
|
39
33
|
if (safeMode) {
|
|
40
34
|
return (
|
|
41
35
|
<pre className="html-unsafe">
|
|
42
|
-
<code
|
|
36
|
+
<code dangerouslySetInnerHTML={{ __html: escape(html) }} />
|
|
43
37
|
</pre>
|
|
44
38
|
);
|
|
45
39
|
}
|
package/dist/main.js
CHANGED
|
@@ -9713,6 +9713,8 @@ var React = __webpack_require__(4466);
|
|
|
9713
9713
|
|
|
9714
9714
|
var PropTypes = __webpack_require__(5697);
|
|
9715
9715
|
|
|
9716
|
+
var escape = __webpack_require__(8686);
|
|
9717
|
+
|
|
9716
9718
|
var MATCH_SCRIPT_TAGS = /<script\b[^>]*>([\s\S]*?)<\/script *>\n?/gim;
|
|
9717
9719
|
|
|
9718
9720
|
var extractScripts = function extractScripts() {
|
|
@@ -9731,14 +9733,6 @@ var extractScripts = function extractScripts() {
|
|
|
9731
9733
|
});
|
|
9732
9734
|
}];
|
|
9733
9735
|
};
|
|
9734
|
-
/**
|
|
9735
|
-
* @hack: https://stackoverflow.com/a/30930653/659661
|
|
9736
|
-
*/
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
var escapeHTML = function escapeHTML(html) {
|
|
9740
|
-
return document.createElement('div').appendChild(document.createTextNode(html)).parentNode.innerHTML;
|
|
9741
|
-
};
|
|
9742
9736
|
|
|
9743
9737
|
var HTMLBlock = /*#__PURE__*/function (_React$Component) {
|
|
9744
9738
|
"use strict";
|
|
@@ -9779,7 +9773,11 @@ var HTMLBlock = /*#__PURE__*/function (_React$Component) {
|
|
|
9779
9773
|
if (safeMode) {
|
|
9780
9774
|
return /*#__PURE__*/React.createElement("pre", {
|
|
9781
9775
|
className: "html-unsafe"
|
|
9782
|
-
}, /*#__PURE__*/React.createElement("code",
|
|
9776
|
+
}, /*#__PURE__*/React.createElement("code", {
|
|
9777
|
+
dangerouslySetInnerHTML: {
|
|
9778
|
+
__html: escape(html)
|
|
9779
|
+
}
|
|
9780
|
+
}));
|
|
9783
9781
|
}
|
|
9784
9782
|
|
|
9785
9783
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -29262,16 +29260,51 @@ module.exports.sanitize = function (sanitizeSchema) {
|
|
|
29262
29260
|
/***/ }),
|
|
29263
29261
|
|
|
29264
29262
|
/***/ 4792:
|
|
29265
|
-
/***/ ((module
|
|
29263
|
+
/***/ ((module) => {
|
|
29266
29264
|
|
|
29267
|
-
|
|
29265
|
+
/* @note: copied from https://github.com/rehypejs/rehype-minify/blob/main/packages/hast-util-to-string/index.js
|
|
29266
|
+
*/
|
|
29267
|
+
function toString(node) {
|
|
29268
|
+
if ('children' in node) {
|
|
29269
|
+
// eslint-disable-next-line no-use-before-define
|
|
29270
|
+
return all(node);
|
|
29271
|
+
}
|
|
29268
29272
|
|
|
29269
|
-
|
|
29270
|
-
|
|
29271
|
-
|
|
29272
|
-
|
|
29273
|
+
return 'value' in node ? node.value : ' ';
|
|
29274
|
+
}
|
|
29275
|
+
|
|
29276
|
+
function one(node) {
|
|
29277
|
+
if (node.type === 'text') {
|
|
29278
|
+
return node.value;
|
|
29279
|
+
} // eslint-disable-next-line no-use-before-define
|
|
29280
|
+
|
|
29281
|
+
|
|
29282
|
+
return 'children' in node ? all(node) : ' ';
|
|
29283
|
+
}
|
|
29284
|
+
|
|
29285
|
+
function all(node) {
|
|
29286
|
+
var index = -1;
|
|
29287
|
+
var result = []; // eslint-disable-next-line no-plusplus
|
|
29288
|
+
|
|
29289
|
+
while (++index < node.children.length) {
|
|
29290
|
+
result[index] = one(node.children[index]);
|
|
29291
|
+
}
|
|
29292
|
+
|
|
29293
|
+
return result.join(' ').trim().replace(/ +/, ' ');
|
|
29294
|
+
}
|
|
29295
|
+
|
|
29296
|
+
var Compiler = function Compiler(node) {
|
|
29297
|
+
return toString(node);
|
|
29298
|
+
};
|
|
29299
|
+
|
|
29300
|
+
var toPlainText = function toPlainText() {
|
|
29301
|
+
Object.assign(this, {
|
|
29302
|
+
Compiler: Compiler
|
|
29303
|
+
});
|
|
29273
29304
|
};
|
|
29274
29305
|
|
|
29306
|
+
module.exports = toPlainText;
|
|
29307
|
+
|
|
29275
29308
|
/***/ }),
|
|
29276
29309
|
|
|
29277
29310
|
/***/ 9620:
|
|
@@ -32811,72 +32844,6 @@ function isLiteral(node) {
|
|
|
32811
32844
|
}
|
|
32812
32845
|
|
|
32813
32846
|
|
|
32814
|
-
/***/ }),
|
|
32815
|
-
|
|
32816
|
-
/***/ 6034:
|
|
32817
|
-
/***/ ((module) => {
|
|
32818
|
-
|
|
32819
|
-
"use strict";
|
|
32820
|
-
/**
|
|
32821
|
-
* @fileoverview
|
|
32822
|
-
* Get the plain-text value of a hast node.
|
|
32823
|
-
* @longdescription
|
|
32824
|
-
* ## Use
|
|
32825
|
-
*
|
|
32826
|
-
* ```js
|
|
32827
|
-
* var h = require('hastscript')
|
|
32828
|
-
* var toString = require('hast-util-to-string')
|
|
32829
|
-
*
|
|
32830
|
-
* toString(h('p', 'Alpha'))
|
|
32831
|
-
* //=> 'Alpha'
|
|
32832
|
-
* toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))
|
|
32833
|
-
* //=> 'Bold and italic.'
|
|
32834
|
-
* ```
|
|
32835
|
-
*
|
|
32836
|
-
* ## API
|
|
32837
|
-
*
|
|
32838
|
-
* ### `toString(node)`
|
|
32839
|
-
*
|
|
32840
|
-
* Transform a node to a string.
|
|
32841
|
-
*/
|
|
32842
|
-
|
|
32843
|
-
|
|
32844
|
-
|
|
32845
|
-
module.exports = toString
|
|
32846
|
-
|
|
32847
|
-
function toString(node) {
|
|
32848
|
-
// “The concatenation of data of all the Text node descendants of the context
|
|
32849
|
-
// object, in tree order.”
|
|
32850
|
-
if ('children' in node) {
|
|
32851
|
-
return all(node)
|
|
32852
|
-
}
|
|
32853
|
-
|
|
32854
|
-
// “Context object’s data.”
|
|
32855
|
-
return 'value' in node ? node.value : ''
|
|
32856
|
-
}
|
|
32857
|
-
|
|
32858
|
-
function one(node) {
|
|
32859
|
-
if (node.type === 'text') {
|
|
32860
|
-
return node.value
|
|
32861
|
-
}
|
|
32862
|
-
|
|
32863
|
-
return node.children ? all(node) : ''
|
|
32864
|
-
}
|
|
32865
|
-
|
|
32866
|
-
function all(node) {
|
|
32867
|
-
var children = node.children
|
|
32868
|
-
var length = children.length
|
|
32869
|
-
var index = -1
|
|
32870
|
-
var result = []
|
|
32871
|
-
|
|
32872
|
-
while (++index < length) {
|
|
32873
|
-
result[index] = one(children[index])
|
|
32874
|
-
}
|
|
32875
|
-
|
|
32876
|
-
return result.join('')
|
|
32877
|
-
}
|
|
32878
|
-
|
|
32879
|
-
|
|
32880
32847
|
/***/ }),
|
|
32881
32848
|
|
|
32882
32849
|
/***/ 3560:
|
|
@@ -33636,6 +33603,227 @@ function wordCharacter(character) {
|
|
|
33636
33603
|
}
|
|
33637
33604
|
|
|
33638
33605
|
|
|
33606
|
+
/***/ }),
|
|
33607
|
+
|
|
33608
|
+
/***/ 8686:
|
|
33609
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
33610
|
+
|
|
33611
|
+
/**
|
|
33612
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
33613
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
33614
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
33615
|
+
* Released under MIT license <https://lodash.com/license>
|
|
33616
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
33617
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
33618
|
+
*/
|
|
33619
|
+
|
|
33620
|
+
/** Used as references for various `Number` constants. */
|
|
33621
|
+
var INFINITY = 1 / 0;
|
|
33622
|
+
|
|
33623
|
+
/** `Object#toString` result references. */
|
|
33624
|
+
var symbolTag = '[object Symbol]';
|
|
33625
|
+
|
|
33626
|
+
/** Used to match HTML entities and HTML characters. */
|
|
33627
|
+
var reUnescapedHtml = /[&<>"'`]/g,
|
|
33628
|
+
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
|
33629
|
+
|
|
33630
|
+
/** Used to map characters to HTML entities. */
|
|
33631
|
+
var htmlEscapes = {
|
|
33632
|
+
'&': '&',
|
|
33633
|
+
'<': '<',
|
|
33634
|
+
'>': '>',
|
|
33635
|
+
'"': '"',
|
|
33636
|
+
"'": ''',
|
|
33637
|
+
'`': '`'
|
|
33638
|
+
};
|
|
33639
|
+
|
|
33640
|
+
/** Detect free variable `global` from Node.js. */
|
|
33641
|
+
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
|
|
33642
|
+
|
|
33643
|
+
/** Detect free variable `self`. */
|
|
33644
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
33645
|
+
|
|
33646
|
+
/** Used as a reference to the global object. */
|
|
33647
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
33648
|
+
|
|
33649
|
+
/**
|
|
33650
|
+
* The base implementation of `_.propertyOf` without support for deep paths.
|
|
33651
|
+
*
|
|
33652
|
+
* @private
|
|
33653
|
+
* @param {Object} object The object to query.
|
|
33654
|
+
* @returns {Function} Returns the new accessor function.
|
|
33655
|
+
*/
|
|
33656
|
+
function basePropertyOf(object) {
|
|
33657
|
+
return function(key) {
|
|
33658
|
+
return object == null ? undefined : object[key];
|
|
33659
|
+
};
|
|
33660
|
+
}
|
|
33661
|
+
|
|
33662
|
+
/**
|
|
33663
|
+
* Used by `_.escape` to convert characters to HTML entities.
|
|
33664
|
+
*
|
|
33665
|
+
* @private
|
|
33666
|
+
* @param {string} chr The matched character to escape.
|
|
33667
|
+
* @returns {string} Returns the escaped character.
|
|
33668
|
+
*/
|
|
33669
|
+
var escapeHtmlChar = basePropertyOf(htmlEscapes);
|
|
33670
|
+
|
|
33671
|
+
/** Used for built-in method references. */
|
|
33672
|
+
var objectProto = Object.prototype;
|
|
33673
|
+
|
|
33674
|
+
/**
|
|
33675
|
+
* Used to resolve the
|
|
33676
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
|
33677
|
+
* of values.
|
|
33678
|
+
*/
|
|
33679
|
+
var objectToString = objectProto.toString;
|
|
33680
|
+
|
|
33681
|
+
/** Built-in value references. */
|
|
33682
|
+
var Symbol = root.Symbol;
|
|
33683
|
+
|
|
33684
|
+
/** Used to convert symbols to primitives and strings. */
|
|
33685
|
+
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
|
33686
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
33687
|
+
|
|
33688
|
+
/**
|
|
33689
|
+
* The base implementation of `_.toString` which doesn't convert nullish
|
|
33690
|
+
* values to empty strings.
|
|
33691
|
+
*
|
|
33692
|
+
* @private
|
|
33693
|
+
* @param {*} value The value to process.
|
|
33694
|
+
* @returns {string} Returns the string.
|
|
33695
|
+
*/
|
|
33696
|
+
function baseToString(value) {
|
|
33697
|
+
// Exit early for strings to avoid a performance hit in some environments.
|
|
33698
|
+
if (typeof value == 'string') {
|
|
33699
|
+
return value;
|
|
33700
|
+
}
|
|
33701
|
+
if (isSymbol(value)) {
|
|
33702
|
+
return symbolToString ? symbolToString.call(value) : '';
|
|
33703
|
+
}
|
|
33704
|
+
var result = (value + '');
|
|
33705
|
+
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
33706
|
+
}
|
|
33707
|
+
|
|
33708
|
+
/**
|
|
33709
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
33710
|
+
* and has a `typeof` result of "object".
|
|
33711
|
+
*
|
|
33712
|
+
* @static
|
|
33713
|
+
* @memberOf _
|
|
33714
|
+
* @since 4.0.0
|
|
33715
|
+
* @category Lang
|
|
33716
|
+
* @param {*} value The value to check.
|
|
33717
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
33718
|
+
* @example
|
|
33719
|
+
*
|
|
33720
|
+
* _.isObjectLike({});
|
|
33721
|
+
* // => true
|
|
33722
|
+
*
|
|
33723
|
+
* _.isObjectLike([1, 2, 3]);
|
|
33724
|
+
* // => true
|
|
33725
|
+
*
|
|
33726
|
+
* _.isObjectLike(_.noop);
|
|
33727
|
+
* // => false
|
|
33728
|
+
*
|
|
33729
|
+
* _.isObjectLike(null);
|
|
33730
|
+
* // => false
|
|
33731
|
+
*/
|
|
33732
|
+
function isObjectLike(value) {
|
|
33733
|
+
return !!value && typeof value == 'object';
|
|
33734
|
+
}
|
|
33735
|
+
|
|
33736
|
+
/**
|
|
33737
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
33738
|
+
*
|
|
33739
|
+
* @static
|
|
33740
|
+
* @memberOf _
|
|
33741
|
+
* @since 4.0.0
|
|
33742
|
+
* @category Lang
|
|
33743
|
+
* @param {*} value The value to check.
|
|
33744
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
33745
|
+
* @example
|
|
33746
|
+
*
|
|
33747
|
+
* _.isSymbol(Symbol.iterator);
|
|
33748
|
+
* // => true
|
|
33749
|
+
*
|
|
33750
|
+
* _.isSymbol('abc');
|
|
33751
|
+
* // => false
|
|
33752
|
+
*/
|
|
33753
|
+
function isSymbol(value) {
|
|
33754
|
+
return typeof value == 'symbol' ||
|
|
33755
|
+
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
|
33756
|
+
}
|
|
33757
|
+
|
|
33758
|
+
/**
|
|
33759
|
+
* Converts `value` to a string. An empty string is returned for `null`
|
|
33760
|
+
* and `undefined` values. The sign of `-0` is preserved.
|
|
33761
|
+
*
|
|
33762
|
+
* @static
|
|
33763
|
+
* @memberOf _
|
|
33764
|
+
* @since 4.0.0
|
|
33765
|
+
* @category Lang
|
|
33766
|
+
* @param {*} value The value to process.
|
|
33767
|
+
* @returns {string} Returns the string.
|
|
33768
|
+
* @example
|
|
33769
|
+
*
|
|
33770
|
+
* _.toString(null);
|
|
33771
|
+
* // => ''
|
|
33772
|
+
*
|
|
33773
|
+
* _.toString(-0);
|
|
33774
|
+
* // => '-0'
|
|
33775
|
+
*
|
|
33776
|
+
* _.toString([1, 2, 3]);
|
|
33777
|
+
* // => '1,2,3'
|
|
33778
|
+
*/
|
|
33779
|
+
function toString(value) {
|
|
33780
|
+
return value == null ? '' : baseToString(value);
|
|
33781
|
+
}
|
|
33782
|
+
|
|
33783
|
+
/**
|
|
33784
|
+
* Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
|
|
33785
|
+
* their corresponding HTML entities.
|
|
33786
|
+
*
|
|
33787
|
+
* **Note:** No other characters are escaped. To escape additional
|
|
33788
|
+
* characters use a third-party library like [_he_](https://mths.be/he).
|
|
33789
|
+
*
|
|
33790
|
+
* Though the ">" character is escaped for symmetry, characters like
|
|
33791
|
+
* ">" and "/" don't need escaping in HTML and have no special meaning
|
|
33792
|
+
* unless they're part of a tag or unquoted attribute value. See
|
|
33793
|
+
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
|
|
33794
|
+
* (under "semi-related fun fact") for more details.
|
|
33795
|
+
*
|
|
33796
|
+
* Backticks are escaped because in IE < 9, they can break out of
|
|
33797
|
+
* attribute values or HTML comments. See [#59](https://html5sec.org/#59),
|
|
33798
|
+
* [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
|
|
33799
|
+
* [#133](https://html5sec.org/#133) of the
|
|
33800
|
+
* [HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
|
|
33801
|
+
*
|
|
33802
|
+
* When working with HTML you should always
|
|
33803
|
+
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
|
|
33804
|
+
* XSS vectors.
|
|
33805
|
+
*
|
|
33806
|
+
* @static
|
|
33807
|
+
* @since 0.1.0
|
|
33808
|
+
* @memberOf _
|
|
33809
|
+
* @category String
|
|
33810
|
+
* @param {string} [string=''] The string to escape.
|
|
33811
|
+
* @returns {string} Returns the escaped string.
|
|
33812
|
+
* @example
|
|
33813
|
+
*
|
|
33814
|
+
* _.escape('fred, barney, & pebbles');
|
|
33815
|
+
* // => 'fred, barney, & pebbles'
|
|
33816
|
+
*/
|
|
33817
|
+
function escape(string) {
|
|
33818
|
+
string = toString(string);
|
|
33819
|
+
return (string && reHasUnescapedHtml.test(string))
|
|
33820
|
+
? string.replace(reUnescapedHtml, escapeHtmlChar)
|
|
33821
|
+
: string;
|
|
33822
|
+
}
|
|
33823
|
+
|
|
33824
|
+
module.exports = escape;
|
|
33825
|
+
|
|
33826
|
+
|
|
33639
33827
|
/***/ }),
|
|
33640
33828
|
|
|
33641
33829
|
/***/ 5683:
|
|
@@ -52175,7 +52363,7 @@ function astToPlainText(node) {
|
|
|
52175
52363
|
var _setup16 = _slicedToArray(_setup15, 2);
|
|
52176
52364
|
|
|
52177
52365
|
opts = _setup16[1];
|
|
52178
|
-
return processor(opts).use(toPlainText).
|
|
52366
|
+
return processor(opts).use(toPlainText).stringify(node);
|
|
52179
52367
|
}
|
|
52180
52368
|
/**
|
|
52181
52369
|
* compile mdast to ReadMe-flavored markdown
|
package/dist/main.node.js
CHANGED
|
@@ -9713,6 +9713,8 @@ var React = __webpack_require__(4466);
|
|
|
9713
9713
|
|
|
9714
9714
|
var PropTypes = __webpack_require__(5697);
|
|
9715
9715
|
|
|
9716
|
+
var escape = __webpack_require__(8686);
|
|
9717
|
+
|
|
9716
9718
|
var MATCH_SCRIPT_TAGS = /<script\b[^>]*>([\s\S]*?)<\/script *>\n?/gim;
|
|
9717
9719
|
|
|
9718
9720
|
var extractScripts = function extractScripts() {
|
|
@@ -9731,14 +9733,6 @@ var extractScripts = function extractScripts() {
|
|
|
9731
9733
|
});
|
|
9732
9734
|
}];
|
|
9733
9735
|
};
|
|
9734
|
-
/**
|
|
9735
|
-
* @hack: https://stackoverflow.com/a/30930653/659661
|
|
9736
|
-
*/
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
var escapeHTML = function escapeHTML(html) {
|
|
9740
|
-
return document.createElement('div').appendChild(document.createTextNode(html)).parentNode.innerHTML;
|
|
9741
|
-
};
|
|
9742
9736
|
|
|
9743
9737
|
var HTMLBlock = /*#__PURE__*/function (_React$Component) {
|
|
9744
9738
|
"use strict";
|
|
@@ -9779,7 +9773,11 @@ var HTMLBlock = /*#__PURE__*/function (_React$Component) {
|
|
|
9779
9773
|
if (safeMode) {
|
|
9780
9774
|
return /*#__PURE__*/React.createElement("pre", {
|
|
9781
9775
|
className: "html-unsafe"
|
|
9782
|
-
}, /*#__PURE__*/React.createElement("code",
|
|
9776
|
+
}, /*#__PURE__*/React.createElement("code", {
|
|
9777
|
+
dangerouslySetInnerHTML: {
|
|
9778
|
+
__html: escape(html)
|
|
9779
|
+
}
|
|
9780
|
+
}));
|
|
9783
9781
|
}
|
|
9784
9782
|
|
|
9785
9783
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -12084,16 +12082,51 @@ module.exports.sanitize = function (sanitizeSchema) {
|
|
|
12084
12082
|
/***/ }),
|
|
12085
12083
|
|
|
12086
12084
|
/***/ 4792:
|
|
12087
|
-
/***/ ((module
|
|
12085
|
+
/***/ ((module) => {
|
|
12088
12086
|
|
|
12089
|
-
|
|
12087
|
+
/* @note: copied from https://github.com/rehypejs/rehype-minify/blob/main/packages/hast-util-to-string/index.js
|
|
12088
|
+
*/
|
|
12089
|
+
function toString(node) {
|
|
12090
|
+
if ('children' in node) {
|
|
12091
|
+
// eslint-disable-next-line no-use-before-define
|
|
12092
|
+
return all(node);
|
|
12093
|
+
}
|
|
12090
12094
|
|
|
12091
|
-
|
|
12092
|
-
|
|
12093
|
-
|
|
12094
|
-
|
|
12095
|
+
return 'value' in node ? node.value : ' ';
|
|
12096
|
+
}
|
|
12097
|
+
|
|
12098
|
+
function one(node) {
|
|
12099
|
+
if (node.type === 'text') {
|
|
12100
|
+
return node.value;
|
|
12101
|
+
} // eslint-disable-next-line no-use-before-define
|
|
12102
|
+
|
|
12103
|
+
|
|
12104
|
+
return 'children' in node ? all(node) : ' ';
|
|
12105
|
+
}
|
|
12106
|
+
|
|
12107
|
+
function all(node) {
|
|
12108
|
+
var index = -1;
|
|
12109
|
+
var result = []; // eslint-disable-next-line no-plusplus
|
|
12110
|
+
|
|
12111
|
+
while (++index < node.children.length) {
|
|
12112
|
+
result[index] = one(node.children[index]);
|
|
12113
|
+
}
|
|
12114
|
+
|
|
12115
|
+
return result.join(' ').trim().replace(/ +/, ' ');
|
|
12116
|
+
}
|
|
12117
|
+
|
|
12118
|
+
var Compiler = function Compiler(node) {
|
|
12119
|
+
return toString(node);
|
|
12120
|
+
};
|
|
12121
|
+
|
|
12122
|
+
var toPlainText = function toPlainText() {
|
|
12123
|
+
Object.assign(this, {
|
|
12124
|
+
Compiler: Compiler
|
|
12125
|
+
});
|
|
12095
12126
|
};
|
|
12096
12127
|
|
|
12128
|
+
module.exports = toPlainText;
|
|
12129
|
+
|
|
12097
12130
|
/***/ }),
|
|
12098
12131
|
|
|
12099
12132
|
/***/ 9620:
|
|
@@ -15633,72 +15666,6 @@ function isLiteral(node) {
|
|
|
15633
15666
|
}
|
|
15634
15667
|
|
|
15635
15668
|
|
|
15636
|
-
/***/ }),
|
|
15637
|
-
|
|
15638
|
-
/***/ 6034:
|
|
15639
|
-
/***/ ((module) => {
|
|
15640
|
-
|
|
15641
|
-
"use strict";
|
|
15642
|
-
/**
|
|
15643
|
-
* @fileoverview
|
|
15644
|
-
* Get the plain-text value of a hast node.
|
|
15645
|
-
* @longdescription
|
|
15646
|
-
* ## Use
|
|
15647
|
-
*
|
|
15648
|
-
* ```js
|
|
15649
|
-
* var h = require('hastscript')
|
|
15650
|
-
* var toString = require('hast-util-to-string')
|
|
15651
|
-
*
|
|
15652
|
-
* toString(h('p', 'Alpha'))
|
|
15653
|
-
* //=> 'Alpha'
|
|
15654
|
-
* toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))
|
|
15655
|
-
* //=> 'Bold and italic.'
|
|
15656
|
-
* ```
|
|
15657
|
-
*
|
|
15658
|
-
* ## API
|
|
15659
|
-
*
|
|
15660
|
-
* ### `toString(node)`
|
|
15661
|
-
*
|
|
15662
|
-
* Transform a node to a string.
|
|
15663
|
-
*/
|
|
15664
|
-
|
|
15665
|
-
|
|
15666
|
-
|
|
15667
|
-
module.exports = toString
|
|
15668
|
-
|
|
15669
|
-
function toString(node) {
|
|
15670
|
-
// “The concatenation of data of all the Text node descendants of the context
|
|
15671
|
-
// object, in tree order.”
|
|
15672
|
-
if ('children' in node) {
|
|
15673
|
-
return all(node)
|
|
15674
|
-
}
|
|
15675
|
-
|
|
15676
|
-
// “Context object’s data.”
|
|
15677
|
-
return 'value' in node ? node.value : ''
|
|
15678
|
-
}
|
|
15679
|
-
|
|
15680
|
-
function one(node) {
|
|
15681
|
-
if (node.type === 'text') {
|
|
15682
|
-
return node.value
|
|
15683
|
-
}
|
|
15684
|
-
|
|
15685
|
-
return node.children ? all(node) : ''
|
|
15686
|
-
}
|
|
15687
|
-
|
|
15688
|
-
function all(node) {
|
|
15689
|
-
var children = node.children
|
|
15690
|
-
var length = children.length
|
|
15691
|
-
var index = -1
|
|
15692
|
-
var result = []
|
|
15693
|
-
|
|
15694
|
-
while (++index < length) {
|
|
15695
|
-
result[index] = one(children[index])
|
|
15696
|
-
}
|
|
15697
|
-
|
|
15698
|
-
return result.join('')
|
|
15699
|
-
}
|
|
15700
|
-
|
|
15701
|
-
|
|
15702
15669
|
/***/ }),
|
|
15703
15670
|
|
|
15704
15671
|
/***/ 3560:
|
|
@@ -16474,6 +16441,227 @@ function wordCharacter(character) {
|
|
|
16474
16441
|
}
|
|
16475
16442
|
|
|
16476
16443
|
|
|
16444
|
+
/***/ }),
|
|
16445
|
+
|
|
16446
|
+
/***/ 8686:
|
|
16447
|
+
/***/ ((module) => {
|
|
16448
|
+
|
|
16449
|
+
/**
|
|
16450
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
16451
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
16452
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
16453
|
+
* Released under MIT license <https://lodash.com/license>
|
|
16454
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
16455
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
16456
|
+
*/
|
|
16457
|
+
|
|
16458
|
+
/** Used as references for various `Number` constants. */
|
|
16459
|
+
var INFINITY = 1 / 0;
|
|
16460
|
+
|
|
16461
|
+
/** `Object#toString` result references. */
|
|
16462
|
+
var symbolTag = '[object Symbol]';
|
|
16463
|
+
|
|
16464
|
+
/** Used to match HTML entities and HTML characters. */
|
|
16465
|
+
var reUnescapedHtml = /[&<>"'`]/g,
|
|
16466
|
+
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
|
16467
|
+
|
|
16468
|
+
/** Used to map characters to HTML entities. */
|
|
16469
|
+
var htmlEscapes = {
|
|
16470
|
+
'&': '&',
|
|
16471
|
+
'<': '<',
|
|
16472
|
+
'>': '>',
|
|
16473
|
+
'"': '"',
|
|
16474
|
+
"'": ''',
|
|
16475
|
+
'`': '`'
|
|
16476
|
+
};
|
|
16477
|
+
|
|
16478
|
+
/** Detect free variable `global` from Node.js. */
|
|
16479
|
+
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
16480
|
+
|
|
16481
|
+
/** Detect free variable `self`. */
|
|
16482
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
16483
|
+
|
|
16484
|
+
/** Used as a reference to the global object. */
|
|
16485
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
16486
|
+
|
|
16487
|
+
/**
|
|
16488
|
+
* The base implementation of `_.propertyOf` without support for deep paths.
|
|
16489
|
+
*
|
|
16490
|
+
* @private
|
|
16491
|
+
* @param {Object} object The object to query.
|
|
16492
|
+
* @returns {Function} Returns the new accessor function.
|
|
16493
|
+
*/
|
|
16494
|
+
function basePropertyOf(object) {
|
|
16495
|
+
return function(key) {
|
|
16496
|
+
return object == null ? undefined : object[key];
|
|
16497
|
+
};
|
|
16498
|
+
}
|
|
16499
|
+
|
|
16500
|
+
/**
|
|
16501
|
+
* Used by `_.escape` to convert characters to HTML entities.
|
|
16502
|
+
*
|
|
16503
|
+
* @private
|
|
16504
|
+
* @param {string} chr The matched character to escape.
|
|
16505
|
+
* @returns {string} Returns the escaped character.
|
|
16506
|
+
*/
|
|
16507
|
+
var escapeHtmlChar = basePropertyOf(htmlEscapes);
|
|
16508
|
+
|
|
16509
|
+
/** Used for built-in method references. */
|
|
16510
|
+
var objectProto = Object.prototype;
|
|
16511
|
+
|
|
16512
|
+
/**
|
|
16513
|
+
* Used to resolve the
|
|
16514
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
|
16515
|
+
* of values.
|
|
16516
|
+
*/
|
|
16517
|
+
var objectToString = objectProto.toString;
|
|
16518
|
+
|
|
16519
|
+
/** Built-in value references. */
|
|
16520
|
+
var Symbol = root.Symbol;
|
|
16521
|
+
|
|
16522
|
+
/** Used to convert symbols to primitives and strings. */
|
|
16523
|
+
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
|
16524
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
16525
|
+
|
|
16526
|
+
/**
|
|
16527
|
+
* The base implementation of `_.toString` which doesn't convert nullish
|
|
16528
|
+
* values to empty strings.
|
|
16529
|
+
*
|
|
16530
|
+
* @private
|
|
16531
|
+
* @param {*} value The value to process.
|
|
16532
|
+
* @returns {string} Returns the string.
|
|
16533
|
+
*/
|
|
16534
|
+
function baseToString(value) {
|
|
16535
|
+
// Exit early for strings to avoid a performance hit in some environments.
|
|
16536
|
+
if (typeof value == 'string') {
|
|
16537
|
+
return value;
|
|
16538
|
+
}
|
|
16539
|
+
if (isSymbol(value)) {
|
|
16540
|
+
return symbolToString ? symbolToString.call(value) : '';
|
|
16541
|
+
}
|
|
16542
|
+
var result = (value + '');
|
|
16543
|
+
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
16544
|
+
}
|
|
16545
|
+
|
|
16546
|
+
/**
|
|
16547
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
16548
|
+
* and has a `typeof` result of "object".
|
|
16549
|
+
*
|
|
16550
|
+
* @static
|
|
16551
|
+
* @memberOf _
|
|
16552
|
+
* @since 4.0.0
|
|
16553
|
+
* @category Lang
|
|
16554
|
+
* @param {*} value The value to check.
|
|
16555
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
16556
|
+
* @example
|
|
16557
|
+
*
|
|
16558
|
+
* _.isObjectLike({});
|
|
16559
|
+
* // => true
|
|
16560
|
+
*
|
|
16561
|
+
* _.isObjectLike([1, 2, 3]);
|
|
16562
|
+
* // => true
|
|
16563
|
+
*
|
|
16564
|
+
* _.isObjectLike(_.noop);
|
|
16565
|
+
* // => false
|
|
16566
|
+
*
|
|
16567
|
+
* _.isObjectLike(null);
|
|
16568
|
+
* // => false
|
|
16569
|
+
*/
|
|
16570
|
+
function isObjectLike(value) {
|
|
16571
|
+
return !!value && typeof value == 'object';
|
|
16572
|
+
}
|
|
16573
|
+
|
|
16574
|
+
/**
|
|
16575
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
16576
|
+
*
|
|
16577
|
+
* @static
|
|
16578
|
+
* @memberOf _
|
|
16579
|
+
* @since 4.0.0
|
|
16580
|
+
* @category Lang
|
|
16581
|
+
* @param {*} value The value to check.
|
|
16582
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
16583
|
+
* @example
|
|
16584
|
+
*
|
|
16585
|
+
* _.isSymbol(Symbol.iterator);
|
|
16586
|
+
* // => true
|
|
16587
|
+
*
|
|
16588
|
+
* _.isSymbol('abc');
|
|
16589
|
+
* // => false
|
|
16590
|
+
*/
|
|
16591
|
+
function isSymbol(value) {
|
|
16592
|
+
return typeof value == 'symbol' ||
|
|
16593
|
+
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
|
16594
|
+
}
|
|
16595
|
+
|
|
16596
|
+
/**
|
|
16597
|
+
* Converts `value` to a string. An empty string is returned for `null`
|
|
16598
|
+
* and `undefined` values. The sign of `-0` is preserved.
|
|
16599
|
+
*
|
|
16600
|
+
* @static
|
|
16601
|
+
* @memberOf _
|
|
16602
|
+
* @since 4.0.0
|
|
16603
|
+
* @category Lang
|
|
16604
|
+
* @param {*} value The value to process.
|
|
16605
|
+
* @returns {string} Returns the string.
|
|
16606
|
+
* @example
|
|
16607
|
+
*
|
|
16608
|
+
* _.toString(null);
|
|
16609
|
+
* // => ''
|
|
16610
|
+
*
|
|
16611
|
+
* _.toString(-0);
|
|
16612
|
+
* // => '-0'
|
|
16613
|
+
*
|
|
16614
|
+
* _.toString([1, 2, 3]);
|
|
16615
|
+
* // => '1,2,3'
|
|
16616
|
+
*/
|
|
16617
|
+
function toString(value) {
|
|
16618
|
+
return value == null ? '' : baseToString(value);
|
|
16619
|
+
}
|
|
16620
|
+
|
|
16621
|
+
/**
|
|
16622
|
+
* Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
|
|
16623
|
+
* their corresponding HTML entities.
|
|
16624
|
+
*
|
|
16625
|
+
* **Note:** No other characters are escaped. To escape additional
|
|
16626
|
+
* characters use a third-party library like [_he_](https://mths.be/he).
|
|
16627
|
+
*
|
|
16628
|
+
* Though the ">" character is escaped for symmetry, characters like
|
|
16629
|
+
* ">" and "/" don't need escaping in HTML and have no special meaning
|
|
16630
|
+
* unless they're part of a tag or unquoted attribute value. See
|
|
16631
|
+
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
|
|
16632
|
+
* (under "semi-related fun fact") for more details.
|
|
16633
|
+
*
|
|
16634
|
+
* Backticks are escaped because in IE < 9, they can break out of
|
|
16635
|
+
* attribute values or HTML comments. See [#59](https://html5sec.org/#59),
|
|
16636
|
+
* [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
|
|
16637
|
+
* [#133](https://html5sec.org/#133) of the
|
|
16638
|
+
* [HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
|
|
16639
|
+
*
|
|
16640
|
+
* When working with HTML you should always
|
|
16641
|
+
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
|
|
16642
|
+
* XSS vectors.
|
|
16643
|
+
*
|
|
16644
|
+
* @static
|
|
16645
|
+
* @since 0.1.0
|
|
16646
|
+
* @memberOf _
|
|
16647
|
+
* @category String
|
|
16648
|
+
* @param {string} [string=''] The string to escape.
|
|
16649
|
+
* @returns {string} Returns the escaped string.
|
|
16650
|
+
* @example
|
|
16651
|
+
*
|
|
16652
|
+
* _.escape('fred, barney, & pebbles');
|
|
16653
|
+
* // => 'fred, barney, & pebbles'
|
|
16654
|
+
*/
|
|
16655
|
+
function escape(string) {
|
|
16656
|
+
string = toString(string);
|
|
16657
|
+
return (string && reHasUnescapedHtml.test(string))
|
|
16658
|
+
? string.replace(reUnescapedHtml, escapeHtmlChar)
|
|
16659
|
+
: string;
|
|
16660
|
+
}
|
|
16661
|
+
|
|
16662
|
+
module.exports = escape;
|
|
16663
|
+
|
|
16664
|
+
|
|
16477
16665
|
/***/ }),
|
|
16478
16666
|
|
|
16479
16667
|
/***/ 5683:
|
|
@@ -34520,7 +34708,7 @@ function astToPlainText(node) {
|
|
|
34520
34708
|
var _setup16 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup15, 2);
|
|
34521
34709
|
|
|
34522
34710
|
opts = _setup16[1];
|
|
34523
|
-
return processor(opts).use(toPlainText).
|
|
34711
|
+
return processor(opts).use(toPlainText).stringify(node);
|
|
34524
34712
|
}
|
|
34525
34713
|
/**
|
|
34526
34714
|
* compile mdast to ReadMe-flavored markdown
|
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.
|
|
5
|
+
"version": "6.45.0",
|
|
6
6
|
"main": "dist/main.node.js",
|
|
7
7
|
"browser": "dist/main.js",
|
|
8
8
|
"files": [
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@readme/syntax-highlighter": "^11.0.0",
|
|
32
32
|
"copy-to-clipboard": "^3.3.1",
|
|
33
33
|
"hast-util-sanitize": "^4.0.0",
|
|
34
|
-
"
|
|
34
|
+
"lodash.escape": "^4.0.1",
|
|
35
35
|
"lodash.kebabcase": "^4.1.1",
|
|
36
36
|
"mdast-util-toc": "^5.1.0",
|
|
37
37
|
"path-browserify": "^1.0.1",
|