@readme/markdown 6.44.0 → 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/dist/main.js CHANGED
@@ -29260,16 +29260,51 @@ module.exports.sanitize = function (sanitizeSchema) {
29260
29260
  /***/ }),
29261
29261
 
29262
29262
  /***/ 4792:
29263
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
29263
+ /***/ ((module) => {
29264
29264
 
29265
- var toString = __webpack_require__(6034);
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
+ }
29266
29272
 
29267
- module.exports = function () {
29268
- return function compile(node) {
29269
- return toString(node);
29270
- };
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);
29271
29298
  };
29272
29299
 
29300
+ var toPlainText = function toPlainText() {
29301
+ Object.assign(this, {
29302
+ Compiler: Compiler
29303
+ });
29304
+ };
29305
+
29306
+ module.exports = toPlainText;
29307
+
29273
29308
  /***/ }),
29274
29309
 
29275
29310
  /***/ 9620:
@@ -32809,72 +32844,6 @@ function isLiteral(node) {
32809
32844
  }
32810
32845
 
32811
32846
 
32812
- /***/ }),
32813
-
32814
- /***/ 6034:
32815
- /***/ ((module) => {
32816
-
32817
- "use strict";
32818
- /**
32819
- * @fileoverview
32820
- * Get the plain-text value of a hast node.
32821
- * @longdescription
32822
- * ## Use
32823
- *
32824
- * ```js
32825
- * var h = require('hastscript')
32826
- * var toString = require('hast-util-to-string')
32827
- *
32828
- * toString(h('p', 'Alpha'))
32829
- * //=> 'Alpha'
32830
- * toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))
32831
- * //=> 'Bold and italic.'
32832
- * ```
32833
- *
32834
- * ## API
32835
- *
32836
- * ### `toString(node)`
32837
- *
32838
- * Transform a node to a string.
32839
- */
32840
-
32841
-
32842
-
32843
- module.exports = toString
32844
-
32845
- function toString(node) {
32846
- // “The concatenation of data of all the Text node descendants of the context
32847
- // object, in tree order.”
32848
- if ('children' in node) {
32849
- return all(node)
32850
- }
32851
-
32852
- // “Context object’s data.”
32853
- return 'value' in node ? node.value : ''
32854
- }
32855
-
32856
- function one(node) {
32857
- if (node.type === 'text') {
32858
- return node.value
32859
- }
32860
-
32861
- return node.children ? all(node) : ''
32862
- }
32863
-
32864
- function all(node) {
32865
- var children = node.children
32866
- var length = children.length
32867
- var index = -1
32868
- var result = []
32869
-
32870
- while (++index < length) {
32871
- result[index] = one(children[index])
32872
- }
32873
-
32874
- return result.join('')
32875
- }
32876
-
32877
-
32878
32847
  /***/ }),
32879
32848
 
32880
32849
  /***/ 3560:
@@ -52394,7 +52363,7 @@ function astToPlainText(node) {
52394
52363
  var _setup16 = _slicedToArray(_setup15, 2);
52395
52364
 
52396
52365
  opts = _setup16[1];
52397
- return processor(opts).use(toPlainText).runSync(node);
52366
+ return processor(opts).use(toPlainText).stringify(node);
52398
52367
  }
52399
52368
  /**
52400
52369
  * compile mdast to ReadMe-flavored markdown
package/dist/main.node.js CHANGED
@@ -12082,16 +12082,51 @@ module.exports.sanitize = function (sanitizeSchema) {
12082
12082
  /***/ }),
12083
12083
 
12084
12084
  /***/ 4792:
12085
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12085
+ /***/ ((module) => {
12086
12086
 
12087
- var toString = __webpack_require__(6034);
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
+ }
12088
12094
 
12089
- module.exports = function () {
12090
- return function compile(node) {
12091
- return toString(node);
12092
- };
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);
12093
12120
  };
12094
12121
 
12122
+ var toPlainText = function toPlainText() {
12123
+ Object.assign(this, {
12124
+ Compiler: Compiler
12125
+ });
12126
+ };
12127
+
12128
+ module.exports = toPlainText;
12129
+
12095
12130
  /***/ }),
12096
12131
 
12097
12132
  /***/ 9620:
@@ -15631,72 +15666,6 @@ function isLiteral(node) {
15631
15666
  }
15632
15667
 
15633
15668
 
15634
- /***/ }),
15635
-
15636
- /***/ 6034:
15637
- /***/ ((module) => {
15638
-
15639
- "use strict";
15640
- /**
15641
- * @fileoverview
15642
- * Get the plain-text value of a hast node.
15643
- * @longdescription
15644
- * ## Use
15645
- *
15646
- * ```js
15647
- * var h = require('hastscript')
15648
- * var toString = require('hast-util-to-string')
15649
- *
15650
- * toString(h('p', 'Alpha'))
15651
- * //=> 'Alpha'
15652
- * toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))
15653
- * //=> 'Bold and italic.'
15654
- * ```
15655
- *
15656
- * ## API
15657
- *
15658
- * ### `toString(node)`
15659
- *
15660
- * Transform a node to a string.
15661
- */
15662
-
15663
-
15664
-
15665
- module.exports = toString
15666
-
15667
- function toString(node) {
15668
- // “The concatenation of data of all the Text node descendants of the context
15669
- // object, in tree order.”
15670
- if ('children' in node) {
15671
- return all(node)
15672
- }
15673
-
15674
- // “Context object’s data.”
15675
- return 'value' in node ? node.value : ''
15676
- }
15677
-
15678
- function one(node) {
15679
- if (node.type === 'text') {
15680
- return node.value
15681
- }
15682
-
15683
- return node.children ? all(node) : ''
15684
- }
15685
-
15686
- function all(node) {
15687
- var children = node.children
15688
- var length = children.length
15689
- var index = -1
15690
- var result = []
15691
-
15692
- while (++index < length) {
15693
- result[index] = one(children[index])
15694
- }
15695
-
15696
- return result.join('')
15697
- }
15698
-
15699
-
15700
15669
  /***/ }),
15701
15670
 
15702
15671
  /***/ 3560:
@@ -34739,7 +34708,7 @@ function astToPlainText(node) {
34739
34708
  var _setup16 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_setup15, 2);
34740
34709
 
34741
34710
  opts = _setup16[1];
34742
- return processor(opts).use(toPlainText).runSync(node);
34711
+ return processor(opts).use(toPlainText).stringify(node);
34743
34712
  }
34744
34713
  /**
34745
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.44.0",
5
+ "version": "6.45.0",
6
6
  "main": "dist/main.node.js",
7
7
  "browser": "dist/main.js",
8
8
  "files": [
@@ -31,7 +31,6 @@
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
- "hast-util-to-string": "^1.0.4",
35
34
  "lodash.escape": "^4.0.1",
36
35
  "lodash.kebabcase": "^4.1.1",
37
36
  "mdast-util-toc": "^5.1.0",