@readme/markdown 6.63.0 → 6.65.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
@@ -115,7 +115,7 @@ var h = __webpack_require__(1742);
115
115
  var find = __webpack_require__(9560);
116
116
  var html = __webpack_require__(7247);
117
117
  var svg = __webpack_require__(1218);
118
- var vfileLocation = __webpack_require__(6976);
118
+ var vfileLocation = __webpack_require__(4787);
119
119
  var ns = __webpack_require__(6);
120
120
  module.exports = wrapper;
121
121
  var own = {}.hasOwnProperty;
@@ -312,59 +312,6 @@ function point(point) {
312
312
 
313
313
  /***/ }),
314
314
 
315
- /***/ 6976:
316
- /***/ ((module) => {
317
-
318
- "use strict";
319
-
320
-
321
- module.exports = factory;
322
- function factory(file) {
323
- var value = String(file);
324
- var indices = [];
325
- var search = /\r?\n|\r/g;
326
- while (search.exec(value)) {
327
- indices.push(search.lastIndex);
328
- }
329
- indices.push(value.length + 1);
330
- return {
331
- toPoint: offsetToPoint,
332
- toPosition: offsetToPoint,
333
- toOffset: pointToOffset
334
- };
335
-
336
- // Get the line and column-based `point` for `offset` in the bound indices.
337
- function offsetToPoint(offset) {
338
- var index = -1;
339
- if (offset > -1 && offset < indices[indices.length - 1]) {
340
- while (++index < indices.length) {
341
- if (indices[index] > offset) {
342
- return {
343
- line: index + 1,
344
- column: offset - (indices[index - 1] || 0) + 1,
345
- offset: offset
346
- };
347
- }
348
- }
349
- }
350
- return {};
351
- }
352
-
353
- // Get the `offset` for a line and column-based `point` in the bound
354
- // indices.
355
- function pointToOffset(point) {
356
- var line = point && point.line;
357
- var column = point && point.column;
358
- var offset;
359
- if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {
360
- offset = (indices[line - 2] || 0) + column - 1 || 0;
361
- }
362
- return offset > -1 && offset < indices[indices.length - 1] ? offset : -1;
363
- }
364
- }
365
-
366
- /***/ }),
367
-
368
315
  /***/ 8335:
369
316
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
370
317
 
@@ -9369,8 +9316,6 @@ function tokenizer(eat, value) {
9369
9316
  hash = _rgx$exec2[1],
9370
9317
  text = _rgx$exec2[2];
9371
9318
  var now = eat.now();
9372
- now.column += match.length;
9373
- now.offset += match.length;
9374
9319
  return eat(match)({
9375
9320
  type: 'heading',
9376
9321
  depth: hash.length,
@@ -9603,6 +9548,7 @@ var _inherits = __webpack_require__(1655);
9603
9548
  var _setPrototypeOf = __webpack_require__(6015);
9604
9549
  var _slicedToArray = __webpack_require__(7424);
9605
9550
  function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, void 0, groups); }; var _super = RegExp.prototype, _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); } function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { var i = g[name]; if ("number" == typeof i) groups[name] = result[i];else { for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) { k++; } groups[name] = result[i[k]]; } return groups; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); return result && (result.groups = buildGroups(result, this)), result; }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if ("string" == typeof substitution) { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { return "$" + groups[name]; })); } if ("function" == typeof substitution) { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; return "object" != _typeof(args[args.length - 1]) && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); }); } return _super[Symbol.replace].call(this, str, substitution); }, _wrapRegExp.apply(this, arguments); }
9551
+ var decode = __webpack_require__(7574);
9606
9552
  function tokenizer(eat, value) {
9607
9553
  // eslint-disable-next-line unicorn/no-unsafe-regex
9608
9554
  var TAB_BLOCK_RGXP = /^(?:(?:^|\n)```(?:(?!\n```)[\s\S])*\n```[^\S\n]*){2,}/g;
@@ -9633,7 +9579,8 @@ function tokenizer(eat, value) {
9633
9579
  meta = _codeBlock$groups$met === void 0 ? '' : _codeBlock$groups$met,
9634
9580
  _codeBlock$groups$cod = _codeBlock$groups.code,
9635
9581
  code = _codeBlock$groups$cod === void 0 ? '' : _codeBlock$groups$cod;
9636
- meta = meta.trim();
9582
+ lang = lang ? decode(this.unescape(lang)) : lang;
9583
+ meta = decode(this.unescape(meta.trim()));
9637
9584
  kids.push({
9638
9585
  type: 'code',
9639
9586
  className: 'tab-panel',
@@ -9667,8 +9614,8 @@ function parser() {
9667
9614
  var Parser = this.Parser;
9668
9615
  var tokenizers = Parser.prototype.blockTokenizers;
9669
9616
  var methods = Parser.prototype.blockMethods;
9670
- tokenizers.CodeTabs = tokenizer;
9671
- methods.splice(methods.indexOf('newline'), 0, 'CodeTabs');
9617
+ tokenizers.codeTabs = tokenizer;
9618
+ methods.splice(methods.indexOf('indentedCode') - 1, 0, 'codeTabs');
9672
9619
  }
9673
9620
  module.exports = parser;
9674
9621
  module.exports.sanitize = function (sanitizeSchema) {
@@ -12227,60 +12174,6 @@ exports.doubleQuotesEscapeChars = {
12227
12174
  };
12228
12175
 
12229
12176
 
12230
- /***/ }),
12231
-
12232
- /***/ 3128:
12233
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12234
-
12235
- "use strict";
12236
-
12237
-
12238
- module.exports = detab
12239
-
12240
- var repeat = __webpack_require__(6464)
12241
-
12242
- var tab = 0x09
12243
- var lineFeed = 0x0a
12244
- var carriageReturn = 0x0d
12245
-
12246
- // Replace tabs with spaces, being smart about which column the tab is at and
12247
- // which size should be used.
12248
- function detab(value, size) {
12249
- var string = typeof value === 'string'
12250
- var length = string && value.length
12251
- var start = 0
12252
- var index = -1
12253
- var column = -1
12254
- var tabSize = size || 4
12255
- var results = []
12256
- var code
12257
- var add
12258
-
12259
- if (!string) {
12260
- throw new Error('detab expected string')
12261
- }
12262
-
12263
- while (++index < length) {
12264
- code = value.charCodeAt(index)
12265
-
12266
- if (code === tab) {
12267
- add = tabSize - ((column + 1) % tabSize)
12268
- column += add
12269
- results.push(value.slice(start, index) + repeat(' ', add))
12270
- start = index + 1
12271
- } else if (code === lineFeed || code === carriageReturn) {
12272
- column = -1
12273
- } else {
12274
- column++
12275
- }
12276
- }
12277
-
12278
- results.push(value.slice(start))
12279
-
12280
- return results.join('')
12281
- }
12282
-
12283
-
12284
12177
  /***/ }),
12285
12178
 
12286
12179
  /***/ 4470:
@@ -16779,27 +16672,23 @@ function getDefinitionFactory(node, options) {
16779
16672
  }
16780
16673
 
16781
16674
  // Gather all definitions in `node`
16782
- function gather(node, options) {
16675
+ function gather(node) {
16783
16676
  var cache = {}
16784
16677
 
16785
16678
  if (!node || !node.type) {
16786
16679
  throw new Error('mdast-util-definitions expected node')
16787
16680
  }
16788
16681
 
16789
- visit(node, 'definition', options && options.commonmark ? commonmark : normal)
16682
+ visit(node, 'definition', ondefinition)
16790
16683
 
16791
16684
  return cache
16792
16685
 
16793
- function commonmark(definition) {
16686
+ function ondefinition(definition) {
16794
16687
  var id = normalise(definition.identifier)
16795
16688
  if (!own.call(cache, id)) {
16796
16689
  cache[id] = definition
16797
16690
  }
16798
16691
  }
16799
-
16800
- function normal(definition) {
16801
- cache[normalise(definition.identifier)] = definition
16802
- }
16803
16692
  }
16804
16693
 
16805
16694
  // Factory to get a node from the given definition-cache.
@@ -17226,19 +17115,27 @@ function hardBreak(h, node) {
17226
17115
 
17227
17116
  module.exports = code
17228
17117
 
17229
- var detab = __webpack_require__(3128)
17230
17118
  var u = __webpack_require__(914)
17231
17119
 
17232
17120
  function code(h, node) {
17233
- var value = node.value ? detab(node.value + '\n') : ''
17121
+ var value = node.value ? node.value + '\n' : ''
17122
+ // To do: next major, use `node.lang` w/o regex, the splitting’s been going
17123
+ // on for years in remark now.
17234
17124
  var lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/)
17235
17125
  var props = {}
17126
+ var code
17236
17127
 
17237
17128
  if (lang) {
17238
17129
  props.className = ['language-' + lang]
17239
17130
  }
17240
17131
 
17241
- return h(node.position, 'pre', [h(node, 'code', props, [u('text', value)])])
17132
+ code = h(node, 'code', props, [u('text', value)])
17133
+
17134
+ if (node.meta) {
17135
+ code.data = {meta: node.meta}
17136
+ }
17137
+
17138
+ return h(node.position, 'pre', [code])
17242
17139
  }
17243
17140
 
17244
17141
 
@@ -17488,11 +17385,11 @@ function ignore() {
17488
17385
 
17489
17386
  module.exports = inlineCode
17490
17387
 
17491
- var collapse = __webpack_require__(9357)
17492
17388
  var u = __webpack_require__(914)
17493
17389
 
17494
17390
  function inlineCode(h, node) {
17495
- return h(node, 'code', [u('text', collapse(node.value))])
17391
+ var value = node.value.replace(/\r?\n|\r/g, ' ')
17392
+ return h(node, 'code', [u('text', value)])
17496
17393
  }
17497
17394
 
17498
17395
 
@@ -17563,52 +17460,29 @@ function link(h, node) {
17563
17460
  module.exports = listItem
17564
17461
 
17565
17462
  var u = __webpack_require__(914)
17566
- var wrap = __webpack_require__(2931)
17567
17463
  var all = __webpack_require__(5426)
17568
17464
 
17569
17465
  function listItem(h, node, parent) {
17570
- var children = node.children
17571
- var head = children[0]
17572
- var raw = all(h, node)
17466
+ var result = all(h, node)
17467
+ var head = result[0]
17573
17468
  var loose = parent ? listLoose(parent) : listItemLoose(node)
17574
17469
  var props = {}
17575
- var result
17576
- var container
17577
- var index
17470
+ var wrapped = []
17578
17471
  var length
17472
+ var index
17579
17473
  var child
17580
17474
 
17581
- // Tight lists should not render `paragraph` nodes as `p` elements.
17582
- if (loose) {
17583
- result = raw
17584
- } else {
17585
- result = []
17586
- length = raw.length
17587
- index = -1
17588
-
17589
- while (++index < length) {
17590
- child = raw[index]
17591
-
17592
- if (child.tagName === 'p') {
17593
- result = result.concat(child.children)
17594
- } else {
17595
- result.push(child)
17596
- }
17597
- }
17598
- }
17599
-
17600
17475
  if (typeof node.checked === 'boolean') {
17601
- if (loose && (!head || head.type !== 'paragraph')) {
17602
- result.unshift(h(null, 'p', []))
17476
+ if (!head || head.tagName !== 'p') {
17477
+ head = h(null, 'p', [])
17478
+ result.unshift(head)
17603
17479
  }
17604
17480
 
17605
- container = loose ? result[0].children : result
17606
-
17607
- if (container.length !== 0) {
17608
- container.unshift(u('text', ' '))
17481
+ if (head.children.length > 0) {
17482
+ head.children.unshift(u('text', ' '))
17609
17483
  }
17610
17484
 
17611
- container.unshift(
17485
+ head.children.unshift(
17612
17486
  h(null, 'input', {
17613
17487
  type: 'checkbox',
17614
17488
  checked: node.checked,
@@ -17621,11 +17495,30 @@ function listItem(h, node, parent) {
17621
17495
  props.className = ['task-list-item']
17622
17496
  }
17623
17497
 
17624
- if (loose && result.length !== 0) {
17625
- result = wrap(result, true)
17498
+ length = result.length
17499
+ index = -1
17500
+
17501
+ while (++index < length) {
17502
+ child = result[index]
17503
+
17504
+ // Add eols before nodes, except if this is a loose, first paragraph.
17505
+ if (loose || index !== 0 || child.tagName !== 'p') {
17506
+ wrapped.push(u('text', '\n'))
17507
+ }
17508
+
17509
+ if (child.tagName === 'p' && !loose) {
17510
+ wrapped = wrapped.concat(child.children)
17511
+ } else {
17512
+ wrapped.push(child)
17513
+ }
17514
+ }
17515
+
17516
+ // Add a final eol.
17517
+ if (length && (loose || child.tagName !== 'p')) {
17518
+ wrapped.push(u('text', '\n'))
17626
17519
  }
17627
17520
 
17628
- return h(node, 'li', props, result)
17521
+ return h(node, 'li', props, wrapped)
17629
17522
  }
17630
17523
 
17631
17524
  function listLoose(node) {
@@ -17762,7 +17655,7 @@ var all = __webpack_require__(5426)
17762
17655
  function table(h, node) {
17763
17656
  var rows = node.children
17764
17657
  var index = rows.length
17765
- var align = node.align
17658
+ var align = node.align || []
17766
17659
  var alignLength = align.length
17767
17660
  var result = []
17768
17661
  var pos
@@ -17774,7 +17667,7 @@ function table(h, node) {
17774
17667
  while (index--) {
17775
17668
  row = rows[index].children
17776
17669
  name = index === 0 ? 'th' : 'td'
17777
- pos = alignLength
17670
+ pos = alignLength || row.length
17778
17671
  out = []
17779
17672
 
17780
17673
  while (pos--) {
@@ -17789,17 +17682,18 @@ function table(h, node) {
17789
17682
  node,
17790
17683
  'table',
17791
17684
  wrap(
17792
- [
17793
- h(result[0].position, 'thead', wrap([result[0]], true)),
17794
- h(
17795
- {
17796
- start: position.start(result[1]),
17797
- end: position.end(result[result.length - 1])
17798
- },
17799
- 'tbody',
17800
- wrap(result.slice(1), true)
17801
- )
17802
- ],
17685
+ [h(result[0].position, 'thead', wrap([result[0]], true))].concat(
17686
+ result[1]
17687
+ ? h(
17688
+ {
17689
+ start: position.start(result[1]),
17690
+ end: position.end(result[result.length - 1])
17691
+ },
17692
+ 'tbody',
17693
+ wrap(result.slice(1), true)
17694
+ )
17695
+ : []
17696
+ ),
17803
17697
  true
17804
17698
  )
17805
17699
  )
@@ -17817,10 +17711,12 @@ function table(h, node) {
17817
17711
  module.exports = text
17818
17712
 
17819
17713
  var u = __webpack_require__(914)
17820
- var trimLines = __webpack_require__(6221)
17821
17714
 
17822
17715
  function text(h, node) {
17823
- return h.augment(node, u('text', trimLines(node.value)))
17716
+ return h.augment(
17717
+ node,
17718
+ u('text', String(node.value).replace(/[ \t]*(\r?\n|\r)[ \t]*/g, '$1'))
17719
+ )
17824
17720
  }
17825
17721
 
17826
17722
 
@@ -17878,12 +17774,13 @@ function factory(tree, options) {
17878
17774
  var footnoteById = {}
17879
17775
 
17880
17776
  h.dangerous = dangerous
17881
- h.definition = definitions(tree, settings)
17777
+ h.definition = definitions(tree)
17882
17778
  h.footnoteById = footnoteById
17883
17779
  h.footnoteOrder = []
17884
17780
  h.augment = augment
17885
17781
  h.handlers = Object.assign({}, handlers, settings.handlers)
17886
17782
  h.unknownHandler = settings.unknownHandler
17783
+ h.passThrough = settings.passThrough
17887
17784
 
17888
17785
  visit(tree, 'footnoteDefinition', onfootnotedefinition)
17889
17786
 
@@ -17895,10 +17792,19 @@ function factory(tree, options) {
17895
17792
  var ctx
17896
17793
 
17897
17794
  // Handle `data.hName`, `data.hProperties, `data.hChildren`.
17898
- if (left && 'data' in left) {
17795
+ if (left && left.data) {
17899
17796
  data = left.data
17900
17797
 
17901
- if (right.type === 'element' && data.hName) {
17798
+ if (data.hName) {
17799
+ if (right.type !== 'element') {
17800
+ right = {
17801
+ type: 'element',
17802
+ tagName: '',
17803
+ properties: {},
17804
+ children: []
17805
+ }
17806
+ }
17807
+
17902
17808
  right.tagName = data.hName
17903
17809
  }
17904
17810
 
@@ -17946,7 +17852,7 @@ function factory(tree, options) {
17946
17852
  var id = String(definition.identifier).toUpperCase()
17947
17853
 
17948
17854
  // Mimick CM behavior of link definitions.
17949
- // See: <https://github.com/syntax-tree/mdast-util-definitions/blob/8d48e57/index.js#L26>.
17855
+ // See: <https://github.com/syntax-tree/mdast-util-definitions/blob/8290999/index.js#L26>.
17950
17856
  if (!own.call(footnoteById, id)) {
17951
17857
  footnoteById[id] = definition
17952
17858
  }
@@ -17994,13 +17900,21 @@ function unknown(h, node) {
17994
17900
  // Visit a node.
17995
17901
  function one(h, node, parent) {
17996
17902
  var type = node && node.type
17997
- var fn = own.call(h.handlers, type) ? h.handlers[type] : h.unknownHandler
17903
+ var fn
17998
17904
 
17999
17905
  // Fail on non-nodes.
18000
17906
  if (!type) {
18001
17907
  throw new Error('Expected node, got `' + node + '`')
18002
17908
  }
18003
17909
 
17910
+ if (own.call(h.handlers, type)) {
17911
+ fn = h.handlers[type]
17912
+ } else if (h.passThrough && h.passThrough.indexOf(type) > -1) {
17913
+ fn = returnNode
17914
+ } else {
17915
+ fn = h.unknownHandler
17916
+ }
17917
+
18004
17918
  return (typeof fn === 'function' ? fn : unknown)(h, node, parent)
18005
17919
  }
18006
17920
 
@@ -18019,6 +17933,18 @@ function text(node) {
18019
17933
  return 'value' in node
18020
17934
  }
18021
17935
 
17936
+ function returnNode(h, node) {
17937
+ var clone
17938
+
17939
+ if (node.children) {
17940
+ clone = Object.assign({}, node)
17941
+ clone.children = all(h, node)
17942
+ return clone
17943
+ }
17944
+
17945
+ return node
17946
+ }
17947
+
18022
17948
 
18023
17949
  /***/ }),
18024
17950
 
@@ -18103,7 +18029,7 @@ function wrap(nodes, loose) {
18103
18029
  result.push(nodes[index])
18104
18030
  }
18105
18031
 
18106
- if (loose && nodes.length !== 0) {
18032
+ if (loose && nodes.length > 0) {
18107
18033
  result.push(u('text', '\n'))
18108
18034
  }
18109
18035
 
@@ -19299,15 +19225,15 @@ var defaults = {
19299
19225
  // Characters.
19300
19226
  var tab = 9 // '\t'
19301
19227
  var lineFeed = 10 // '\n'
19302
- var formFeed = 12 // '\f'
19228
+ var formFeed = 12 // '\f'
19303
19229
  var space = 32 // ' '
19304
- var ampersand = 38 // '&'
19305
- var semicolon = 59 // ';'
19306
- var lessThan = 60 // '<'
19307
- var equalsTo = 61 // '='
19308
- var numberSign = 35 // '#'
19309
- var uppercaseX = 88 // 'X'
19310
- var lowercaseX = 120 // 'x'
19230
+ var ampersand = 38 // '&'
19231
+ var semicolon = 59 // ';'
19232
+ var lessThan = 60 // '<'
19233
+ var equalsTo = 61 // '='
19234
+ var numberSign = 35 // '#'
19235
+ var uppercaseX = 88 // 'X'
19236
+ var lowercaseX = 120 // 'x'
19311
19237
  var replacementCharacter = 65533 // '�'
19312
19238
 
19313
19239
  // Reference types.
@@ -19429,7 +19355,8 @@ function parse(value, settings) {
19429
19355
  // Wrap `handleWarning`.
19430
19356
  warning = handleWarning ? parseError : noop
19431
19357
 
19432
- // Ensure the algorithm walks over the first character and the end (inclusive).
19358
+ // Ensure the algorithm walks over the first character and the end
19359
+ // (inclusive).
19433
19360
  index--
19434
19361
  length++
19435
19362
 
@@ -19662,7 +19589,7 @@ function parse(value, settings) {
19662
19589
  }
19663
19590
  }
19664
19591
 
19665
- // Return the reduced nodes, and any possible warnings.
19592
+ // Return the reduced nodes.
19666
19593
  return result.join('')
19667
19594
 
19668
19595
  // Get current position.
@@ -22276,7 +22203,6 @@ module.exports = {
22276
22203
  position: true,
22277
22204
  gfm: true,
22278
22205
  commonmark: false,
22279
- footnotes: false,
22280
22206
  pedantic: false,
22281
22207
  blocks: __webpack_require__(8829)
22282
22208
  }
@@ -22337,6 +22263,65 @@ function locate(value, fromIndex) {
22337
22263
  }
22338
22264
 
22339
22265
 
22266
+ /***/ }),
22267
+
22268
+ /***/ 858:
22269
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
22270
+
22271
+ "use strict";
22272
+
22273
+
22274
+ var decimal = __webpack_require__(6195)
22275
+ var alphabetical = __webpack_require__(6260)
22276
+
22277
+ var plusSign = 43 // '+'
22278
+ var dash = 45 // '-'
22279
+ var dot = 46 // '.'
22280
+ var underscore = 95 // '_'
22281
+
22282
+ module.exports = locate
22283
+
22284
+ // See: <https://github.github.com/gfm/#extended-email-autolink>
22285
+ function locate(value, fromIndex) {
22286
+ var self = this
22287
+ var at
22288
+ var position
22289
+
22290
+ if (!this.options.gfm) {
22291
+ return -1
22292
+ }
22293
+
22294
+ at = value.indexOf('@', fromIndex)
22295
+
22296
+ if (at === -1) {
22297
+ return -1
22298
+ }
22299
+
22300
+ position = at
22301
+
22302
+ if (position === fromIndex || !isGfmAtext(value.charCodeAt(position - 1))) {
22303
+ return locate.call(self, value, at + 1)
22304
+ }
22305
+
22306
+ while (position > fromIndex && isGfmAtext(value.charCodeAt(position - 1))) {
22307
+ position--
22308
+ }
22309
+
22310
+ return position
22311
+ }
22312
+
22313
+ function isGfmAtext(code) {
22314
+ return (
22315
+ decimal(code) ||
22316
+ alphabetical(code) ||
22317
+ code === plusSign ||
22318
+ code === dash ||
22319
+ code === dot ||
22320
+ code === underscore
22321
+ )
22322
+ }
22323
+
22324
+
22340
22325
  /***/ }),
22341
22326
 
22342
22327
  /***/ 6131:
@@ -22453,22 +22438,25 @@ function locate(value, fromIndex) {
22453
22438
 
22454
22439
  module.exports = locate
22455
22440
 
22456
- var protocols = ['https://', 'http://', 'mailto:']
22441
+ var values = ['www.', 'http://', 'https://']
22457
22442
 
22458
22443
  function locate(value, fromIndex) {
22459
- var length = protocols.length
22460
- var index = -1
22461
22444
  var min = -1
22445
+ var index
22446
+ var length
22462
22447
  var position
22463
22448
 
22464
22449
  if (!this.options.gfm) {
22465
- return -1
22450
+ return min
22466
22451
  }
22467
22452
 
22453
+ length = values.length
22454
+ index = -1
22455
+
22468
22456
  while (++index < length) {
22469
- position = value.indexOf(protocols[index], fromIndex)
22457
+ position = value.indexOf(values[index], fromIndex)
22470
22458
 
22471
- if (position !== -1 && (position < min || min === -1)) {
22459
+ if (position !== -1 && (min === -1 || position < min)) {
22472
22460
  min = position
22473
22461
  }
22474
22462
  }
@@ -22585,13 +22573,13 @@ proto.enterBlock = toggle('inBlock', false)
22585
22573
  // In the above example, the thematic break “interupts” the paragraph.
22586
22574
  proto.interruptParagraph = [
22587
22575
  ['thematicBreak'],
22576
+ ['list'],
22588
22577
  ['atxHeading'],
22589
22578
  ['fencedCode'],
22590
22579
  ['blockquote'],
22591
22580
  ['html'],
22592
22581
  ['setextHeading', {commonmark: false}],
22593
- ['definition', {commonmark: false}],
22594
- ['footnote', {commonmark: false}]
22582
+ ['definition', {commonmark: false}]
22595
22583
  ]
22596
22584
 
22597
22585
  // Nodes that can interupt a list:
@@ -22606,8 +22594,7 @@ proto.interruptList = [
22606
22594
  ['atxHeading', {pedantic: false}],
22607
22595
  ['fencedCode', {pedantic: false}],
22608
22596
  ['thematicBreak', {pedantic: false}],
22609
- ['definition', {commonmark: false}],
22610
- ['footnote', {commonmark: false}]
22597
+ ['definition', {commonmark: false}]
22611
22598
  ]
22612
22599
 
22613
22600
  // Nodes that can interupt a blockquote:
@@ -22626,13 +22613,12 @@ proto.interruptBlockquote = [
22626
22613
  ['thematicBreak', {commonmark: true}],
22627
22614
  ['html', {commonmark: true}],
22628
22615
  ['list', {commonmark: true}],
22629
- ['definition', {commonmark: false}],
22630
- ['footnote', {commonmark: false}]
22616
+ ['definition', {commonmark: false}]
22631
22617
  ]
22632
22618
 
22633
22619
  // Handlers.
22634
22620
  proto.blockTokenizers = {
22635
- newline: __webpack_require__(3885),
22621
+ blankLine: __webpack_require__(8086),
22636
22622
  indentedCode: __webpack_require__(1018),
22637
22623
  fencedCode: __webpack_require__(4967),
22638
22624
  blockquote: __webpack_require__(1153),
@@ -22641,7 +22627,6 @@ proto.blockTokenizers = {
22641
22627
  list: __webpack_require__(8332),
22642
22628
  setextHeading: __webpack_require__(6530),
22643
22629
  html: __webpack_require__(5215),
22644
- footnote: __webpack_require__(8574),
22645
22630
  definition: __webpack_require__(856),
22646
22631
  table: __webpack_require__(8029),
22647
22632
  paragraph: __webpack_require__(2431)
@@ -22651,6 +22636,7 @@ proto.inlineTokenizers = {
22651
22636
  escape: __webpack_require__(4833),
22652
22637
  autoLink: __webpack_require__(6507),
22653
22638
  url: __webpack_require__(5044),
22639
+ email: __webpack_require__(1834),
22654
22640
  html: __webpack_require__(3943),
22655
22641
  link: __webpack_require__(8685),
22656
22642
  reference: __webpack_require__(7551),
@@ -22879,6 +22865,57 @@ function autoLink(eat, value, silent) {
22879
22865
  }
22880
22866
 
22881
22867
 
22868
+ /***/ }),
22869
+
22870
+ /***/ 8086:
22871
+ /***/ ((module) => {
22872
+
22873
+ "use strict";
22874
+
22875
+
22876
+ // A line containing no characters, or a line containing only spaces (U+0020) or
22877
+ // tabs (U+0009), is called a blank line.
22878
+ // See <https://spec.commonmark.org/0.29/#blank-line>.
22879
+ var reBlankLine = /^[ \t]*(\n|$)/
22880
+
22881
+ // Note that though blank lines play a special role in lists to determine
22882
+ // whether the list is tight or loose
22883
+ // (<https://spec.commonmark.org/0.29/#blank-lines>), it’s done by the list
22884
+ // tokenizer and this blank line tokenizer does not have to be responsible for
22885
+ // that.
22886
+ // Therefore, configs such as `blankLine.notInList` do not have to be set here.
22887
+ module.exports = blankLine
22888
+
22889
+ function blankLine(eat, value, silent) {
22890
+ var match
22891
+ var subvalue = ''
22892
+ var index = 0
22893
+ var length = value.length
22894
+
22895
+ while (index < length) {
22896
+ match = reBlankLine.exec(value.slice(index))
22897
+
22898
+ if (match == null) {
22899
+ break
22900
+ }
22901
+
22902
+ index += match[0].length
22903
+ subvalue += match[0]
22904
+ }
22905
+
22906
+ if (subvalue === '') {
22907
+ return
22908
+ }
22909
+
22910
+ /* istanbul ignore if - never used (yet) */
22911
+ if (silent) {
22912
+ return true
22913
+ }
22914
+
22915
+ eat(subvalue)
22916
+ }
22917
+
22918
+
22882
22919
  /***/ }),
22883
22920
 
22884
22921
  /***/ 1153:
@@ -23894,6 +23931,128 @@ function strikethrough(eat, value, silent) {
23894
23931
  }
23895
23932
 
23896
23933
 
23934
+ /***/ }),
23935
+
23936
+ /***/ 1834:
23937
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
23938
+
23939
+ "use strict";
23940
+
23941
+
23942
+ var decode = __webpack_require__(7574)
23943
+ var decimal = __webpack_require__(6195)
23944
+ var alphabetical = __webpack_require__(6260)
23945
+ var locate = __webpack_require__(858)
23946
+
23947
+ module.exports = email
23948
+ email.locator = locate
23949
+ email.notInLink = true
23950
+
23951
+ var plusSign = 43 // '+'
23952
+ var dash = 45 // '-'
23953
+ var dot = 46 // '.'
23954
+ var atSign = 64 // '@'
23955
+ var underscore = 95 // '_'
23956
+
23957
+ function email(eat, value, silent) {
23958
+ var self = this
23959
+ var gfm = self.options.gfm
23960
+ var tokenizers = self.inlineTokenizers
23961
+ var index = 0
23962
+ var length = value.length
23963
+ var firstDot = -1
23964
+ var code
23965
+ var content
23966
+ var children
23967
+ var exit
23968
+
23969
+ if (!gfm) {
23970
+ return
23971
+ }
23972
+
23973
+ code = value.charCodeAt(index)
23974
+
23975
+ while (
23976
+ decimal(code) ||
23977
+ alphabetical(code) ||
23978
+ code === plusSign ||
23979
+ code === dash ||
23980
+ code === dot ||
23981
+ code === underscore
23982
+ ) {
23983
+ code = value.charCodeAt(++index)
23984
+ }
23985
+
23986
+ if (index === 0) {
23987
+ return
23988
+ }
23989
+
23990
+ if (code !== atSign) {
23991
+ return
23992
+ }
23993
+
23994
+ index++
23995
+
23996
+ while (index < length) {
23997
+ code = value.charCodeAt(index)
23998
+
23999
+ if (
24000
+ decimal(code) ||
24001
+ alphabetical(code) ||
24002
+ code === dash ||
24003
+ code === dot ||
24004
+ code === underscore
24005
+ ) {
24006
+ index++
24007
+
24008
+ if (firstDot === -1 && code === dot) {
24009
+ firstDot = index
24010
+ }
24011
+
24012
+ continue
24013
+ }
24014
+
24015
+ break
24016
+ }
24017
+
24018
+ if (
24019
+ firstDot === -1 ||
24020
+ firstDot === index ||
24021
+ code === dash ||
24022
+ code === underscore
24023
+ ) {
24024
+ return
24025
+ }
24026
+
24027
+ if (code === dot) {
24028
+ index--
24029
+ }
24030
+
24031
+ content = value.slice(0, index)
24032
+
24033
+ /* istanbul ignore if - never used (yet) */
24034
+ if (silent) {
24035
+ return true
24036
+ }
24037
+
24038
+ exit = self.enterLink()
24039
+
24040
+ // Temporarily remove all tokenizers except text in url.
24041
+ self.inlineTokenizers = {text: tokenizers.text}
24042
+ children = self.tokenizeInline(content, eat.now())
24043
+ self.inlineTokenizers = tokenizers
24044
+
24045
+ exit()
24046
+
24047
+ return eat(content)({
24048
+ type: 'link',
24049
+ title: null,
24050
+ url: 'mailto:' + decode(content, {nonTerminated: false}),
24051
+ children: children
24052
+ })
24053
+ }
24054
+
24055
+
23897
24056
  /***/ }),
23898
24057
 
23899
24058
  /***/ 8210:
@@ -23924,7 +24083,7 @@ function emphasis(eat, value, silent) {
23924
24083
  var queue
23925
24084
  var subvalue
23926
24085
  var length
23927
- var prev
24086
+ var previous
23928
24087
 
23929
24088
  if (character !== asterisk && character !== underscore) {
23930
24089
  return
@@ -23943,14 +24102,14 @@ function emphasis(eat, value, silent) {
23943
24102
  }
23944
24103
 
23945
24104
  while (index < length) {
23946
- prev = character
24105
+ previous = character
23947
24106
  character = value.charAt(index)
23948
24107
 
23949
- if (character === marker && (!pedantic || !whitespace(prev))) {
24108
+ if (character === marker && (!pedantic || !whitespace(previous))) {
23950
24109
  character = value.charAt(++index)
23951
24110
 
23952
24111
  if (character !== marker) {
23953
- if (!trim(queue) || prev === marker) {
24112
+ if (!trim(queue) || previous === marker) {
23954
24113
  return
23955
24114
  }
23956
24115
 
@@ -24030,200 +24189,6 @@ function escape(eat, value, silent) {
24030
24189
  }
24031
24190
 
24032
24191
 
24033
- /***/ }),
24034
-
24035
- /***/ 8574:
24036
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
24037
-
24038
- "use strict";
24039
-
24040
-
24041
- var whitespace = __webpack_require__(2139)
24042
- var normalize = __webpack_require__(4405)
24043
-
24044
- module.exports = footnoteDefinition
24045
- footnoteDefinition.notInList = true
24046
- footnoteDefinition.notInBlock = true
24047
-
24048
- var backslash = '\\'
24049
- var lineFeed = '\n'
24050
- var tab = '\t'
24051
- var space = ' '
24052
- var leftSquareBracket = '['
24053
- var rightSquareBracket = ']'
24054
- var caret = '^'
24055
- var colon = ':'
24056
-
24057
- var EXPRESSION_INITIAL_TAB = /^( {4}|\t)?/gm
24058
-
24059
- function footnoteDefinition(eat, value, silent) {
24060
- var self = this
24061
- var offsets = self.offset
24062
- var index
24063
- var length
24064
- var subvalue
24065
- var now
24066
- var currentLine
24067
- var content
24068
- var queue
24069
- var subqueue
24070
- var character
24071
- var identifier
24072
- var add
24073
- var exit
24074
-
24075
- if (!self.options.footnotes) {
24076
- return
24077
- }
24078
-
24079
- index = 0
24080
- length = value.length
24081
- subvalue = ''
24082
- now = eat.now()
24083
- currentLine = now.line
24084
-
24085
- while (index < length) {
24086
- character = value.charAt(index)
24087
-
24088
- if (!whitespace(character)) {
24089
- break
24090
- }
24091
-
24092
- subvalue += character
24093
- index++
24094
- }
24095
-
24096
- if (
24097
- value.charAt(index) !== leftSquareBracket ||
24098
- value.charAt(index + 1) !== caret
24099
- ) {
24100
- return
24101
- }
24102
-
24103
- subvalue += leftSquareBracket + caret
24104
- index = subvalue.length
24105
- queue = ''
24106
-
24107
- while (index < length) {
24108
- character = value.charAt(index)
24109
-
24110
- if (character === rightSquareBracket) {
24111
- break
24112
- } else if (character === backslash) {
24113
- queue += character
24114
- index++
24115
- character = value.charAt(index)
24116
- }
24117
-
24118
- queue += character
24119
- index++
24120
- }
24121
-
24122
- if (
24123
- !queue ||
24124
- value.charAt(index) !== rightSquareBracket ||
24125
- value.charAt(index + 1) !== colon
24126
- ) {
24127
- return
24128
- }
24129
-
24130
- if (silent) {
24131
- return true
24132
- }
24133
-
24134
- identifier = queue
24135
- subvalue += queue + rightSquareBracket + colon
24136
- index = subvalue.length
24137
-
24138
- while (index < length) {
24139
- character = value.charAt(index)
24140
-
24141
- if (character !== tab && character !== space) {
24142
- break
24143
- }
24144
-
24145
- subvalue += character
24146
- index++
24147
- }
24148
-
24149
- now.column += subvalue.length
24150
- now.offset += subvalue.length
24151
- queue = ''
24152
- content = ''
24153
- subqueue = ''
24154
-
24155
- while (index < length) {
24156
- character = value.charAt(index)
24157
-
24158
- if (character === lineFeed) {
24159
- subqueue = character
24160
- index++
24161
-
24162
- while (index < length) {
24163
- character = value.charAt(index)
24164
-
24165
- if (character !== lineFeed) {
24166
- break
24167
- }
24168
-
24169
- subqueue += character
24170
- index++
24171
- }
24172
-
24173
- queue += subqueue
24174
- subqueue = ''
24175
-
24176
- while (index < length) {
24177
- character = value.charAt(index)
24178
-
24179
- if (character !== space) {
24180
- break
24181
- }
24182
-
24183
- subqueue += character
24184
- index++
24185
- }
24186
-
24187
- if (subqueue.length === 0) {
24188
- break
24189
- }
24190
-
24191
- queue += subqueue
24192
- }
24193
-
24194
- if (queue) {
24195
- content += queue
24196
- queue = ''
24197
- }
24198
-
24199
- content += character
24200
- index++
24201
- }
24202
-
24203
- subvalue += content
24204
-
24205
- content = content.replace(EXPRESSION_INITIAL_TAB, function(line) {
24206
- offsets[currentLine] = (offsets[currentLine] || 0) + line.length
24207
- currentLine++
24208
-
24209
- return ''
24210
- })
24211
-
24212
- add = eat(subvalue)
24213
-
24214
- exit = self.enterBlock()
24215
- content = self.tokenizeBlock(content, now)
24216
- exit()
24217
-
24218
- return add({
24219
- type: 'footnoteDefinition',
24220
- identifier: normalize(identifier),
24221
- label: identifier,
24222
- children: content
24223
- })
24224
- }
24225
-
24226
-
24227
24192
  /***/ }),
24228
24193
 
24229
24194
  /***/ 2867:
@@ -24503,7 +24468,7 @@ var instructionCloseExpression = /\?>/
24503
24468
  var directiveOpenExpression = /^<![A-Za-z]/
24504
24469
  var directiveCloseExpression = />/
24505
24470
  var cdataOpenExpression = /^<!\[CDATA\[/
24506
- var cdataCloseExpression = /\]\]>/
24471
+ var cdataCloseExpression = /]]>/
24507
24472
  var elementCloseExpression = /^$/
24508
24473
  var otherElementOpenExpression = new RegExp(openCloseTag.source + '\\s*$')
24509
24474
 
@@ -24777,20 +24742,6 @@ function link(eat, value, silent) {
24777
24742
  if (depth) {
24778
24743
  depth--
24779
24744
  } else {
24780
- // Allow white-space between content and url in GFM mode.
24781
- if (!pedantic) {
24782
- while (index < length) {
24783
- character = value.charAt(index + 1)
24784
-
24785
- if (!whitespace(character)) {
24786
- break
24787
- }
24788
-
24789
- subqueue += character
24790
- index++
24791
- }
24792
- }
24793
-
24794
24745
  if (value.charAt(index + 1) !== leftParenthesis) {
24795
24746
  return
24796
24747
  }
@@ -25082,7 +25033,7 @@ var lowercaseX = 'x'
25082
25033
 
25083
25034
  var tabSize = 4
25084
25035
  var looseListItemExpression = /\n\n(?!\s*$)/
25085
- var taskItemExpression = /^\[([ \t]|x|X)][ \t]/
25036
+ var taskItemExpression = /^\[([ X\tx])][ \t]/
25086
25037
  var bulletExpression = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/
25087
25038
  var pedanticBulletExpression = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/
25088
25039
  var initialIndentExpression = /^( {1,4}|\t)?/gm
@@ -25096,7 +25047,7 @@ function list(eat, value, silent) {
25096
25047
  var index = 0
25097
25048
  var length = value.length
25098
25049
  var start = null
25099
- var size = 0
25050
+ var size
25100
25051
  var queue
25101
25052
  var ordered
25102
25053
  var character
@@ -25107,7 +25058,7 @@ function list(eat, value, silent) {
25107
25058
  var currentMarker
25108
25059
  var content
25109
25060
  var line
25110
- var prevEmpty
25061
+ var previousEmpty
25111
25062
  var empty
25112
25063
  var items
25113
25064
  var allLines
@@ -25124,21 +25075,13 @@ function list(eat, value, silent) {
25124
25075
  while (index < length) {
25125
25076
  character = value.charAt(index)
25126
25077
 
25127
- if (character === tab) {
25128
- size += tabSize - (size % tabSize)
25129
- } else if (character === space) {
25130
- size++
25131
- } else {
25078
+ if (character !== tab && character !== space) {
25132
25079
  break
25133
25080
  }
25134
25081
 
25135
25082
  index++
25136
25083
  }
25137
25084
 
25138
- if (size >= tabSize) {
25139
- return
25140
- }
25141
-
25142
25085
  character = value.charAt(index)
25143
25086
 
25144
25087
  if (character === asterisk || character === plusSign || character === dash) {
@@ -25168,6 +25111,14 @@ function list(eat, value, silent) {
25168
25111
  return
25169
25112
  }
25170
25113
 
25114
+ /* Slightly abusing `silent` mode, whose goal is to make interrupting
25115
+ * paragraphs work.
25116
+ * Well, that’s exactly what we want to do here: don’t interrupt:
25117
+ * 2. here, because the “list” doesn’t start with `1`. */
25118
+ if (silent && queue !== '1') {
25119
+ return
25120
+ }
25121
+
25171
25122
  start = parseInt(queue, 10)
25172
25123
  marker = character
25173
25124
  }
@@ -25201,7 +25152,6 @@ function list(eat, value, silent) {
25201
25152
  nextIndex = length
25202
25153
  }
25203
25154
 
25204
- end = index + tabSize
25205
25155
  size = 0
25206
25156
 
25207
25157
  while (index < length) {
@@ -25218,10 +25168,6 @@ function list(eat, value, silent) {
25218
25168
  index++
25219
25169
  }
25220
25170
 
25221
- if (size >= tabSize) {
25222
- indented = true
25223
- }
25224
-
25225
25171
  if (item && size >= item.indent) {
25226
25172
  indented = true
25227
25173
  }
@@ -25322,7 +25268,7 @@ function list(eat, value, silent) {
25322
25268
  }
25323
25269
  }
25324
25270
 
25325
- prevEmpty = empty
25271
+ previousEmpty = empty
25326
25272
  empty = !prefixed && !trim(content).length
25327
25273
 
25328
25274
  if (indented && item) {
@@ -25346,13 +25292,13 @@ function list(eat, value, silent) {
25346
25292
  allLines = allLines.concat(emptyLines, line)
25347
25293
  emptyLines = []
25348
25294
  } else if (empty) {
25349
- if (prevEmpty && !commonmark) {
25295
+ if (previousEmpty && !commonmark) {
25350
25296
  break
25351
25297
  }
25352
25298
 
25353
25299
  emptyLines.push(line)
25354
25300
  } else {
25355
- if (prevEmpty) {
25301
+ if (previousEmpty) {
25356
25302
  break
25357
25303
  }
25358
25304
 
@@ -25511,62 +25457,6 @@ function normalListItem(ctx, value, position) {
25511
25457
  }
25512
25458
 
25513
25459
 
25514
- /***/ }),
25515
-
25516
- /***/ 3885:
25517
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
25518
-
25519
- "use strict";
25520
-
25521
-
25522
- var whitespace = __webpack_require__(2139)
25523
-
25524
- module.exports = newline
25525
-
25526
- var lineFeed = '\n'
25527
-
25528
- function newline(eat, value, silent) {
25529
- var character = value.charAt(0)
25530
- var length
25531
- var subvalue
25532
- var queue
25533
- var index
25534
-
25535
- if (character !== lineFeed) {
25536
- return
25537
- }
25538
-
25539
- /* istanbul ignore if - never used (yet) */
25540
- if (silent) {
25541
- return true
25542
- }
25543
-
25544
- index = 1
25545
- length = value.length
25546
- subvalue = character
25547
- queue = ''
25548
-
25549
- while (index < length) {
25550
- character = value.charAt(index)
25551
-
25552
- if (!whitespace(character)) {
25553
- break
25554
- }
25555
-
25556
- queue += character
25557
-
25558
- if (character === lineFeed) {
25559
- subvalue += queue
25560
- queue = ''
25561
- }
25562
-
25563
- index++
25564
- }
25565
-
25566
- eat(subvalue)
25567
- }
25568
-
25569
-
25570
25460
  /***/ }),
25571
25461
 
25572
25462
  /***/ 2431:
@@ -25576,7 +25466,6 @@ function newline(eat, value, silent) {
25576
25466
 
25577
25467
 
25578
25468
  var trim = __webpack_require__(3059)
25579
- var decimal = __webpack_require__(6195)
25580
25469
  var trimTrailingLines = __webpack_require__(7257)
25581
25470
  var interrupt = __webpack_require__(6588)
25582
25471
 
@@ -25593,7 +25482,6 @@ function paragraph(eat, value, silent) {
25593
25482
  var self = this
25594
25483
  var settings = self.options
25595
25484
  var commonmark = settings.commonmark
25596
- var gfm = settings.gfm
25597
25485
  var tokenizers = self.blockTokenizers
25598
25486
  var interruptors = self.interruptParagraph
25599
25487
  var index = value.indexOf(lineFeed)
@@ -25649,17 +25537,6 @@ function paragraph(eat, value, silent) {
25649
25537
  break
25650
25538
  }
25651
25539
 
25652
- // Break if the following line starts a list, when already in a list, or
25653
- // when in commonmark, or when in gfm mode and the bullet is *not* numeric.
25654
- if (
25655
- tokenizers.list.call(self, eat, subvalue, true) &&
25656
- (self.inList ||
25657
- commonmark ||
25658
- (gfm && !decimal(trim.left(subvalue).charAt(0))))
25659
- ) {
25660
- break
25661
- }
25662
-
25663
25540
  position = index
25664
25541
  index = value.indexOf(lineFeed, index + 1)
25665
25542
 
@@ -25671,12 +25548,6 @@ function paragraph(eat, value, silent) {
25671
25548
 
25672
25549
  subvalue = value.slice(0, index)
25673
25550
 
25674
- if (trim(subvalue) === '') {
25675
- eat(subvalue)
25676
-
25677
- return null
25678
- }
25679
-
25680
25551
  /* istanbul ignore if - never used (yet) */
25681
25552
  if (silent) {
25682
25553
  return true
@@ -25709,21 +25580,17 @@ reference.locator = locate
25709
25580
 
25710
25581
  var link = 'link'
25711
25582
  var image = 'image'
25712
- var footnote = 'footnote'
25713
25583
  var shortcut = 'shortcut'
25714
25584
  var collapsed = 'collapsed'
25715
25585
  var full = 'full'
25716
- var space = ' '
25717
25586
  var exclamationMark = '!'
25718
25587
  var leftSquareBracket = '['
25719
25588
  var backslash = '\\'
25720
25589
  var rightSquareBracket = ']'
25721
- var caret = '^'
25722
25590
 
25723
25591
  function reference(eat, value, silent) {
25724
25592
  var self = this
25725
25593
  var commonmark = self.options.commonmark
25726
- var footnotes = self.options.footnotes
25727
25594
  var character = value.charAt(0)
25728
25595
  var index = 0
25729
25596
  var length = value.length
@@ -25755,19 +25622,6 @@ function reference(eat, value, silent) {
25755
25622
  intro += character
25756
25623
  queue = ''
25757
25624
 
25758
- // Check whether we’re eating a footnote.
25759
- if (footnotes && value.charAt(index) === caret) {
25760
- // Exit if `![^` is found, so the `!` will be seen as text after this,
25761
- // and we’ll enter this function again when `[^` is found.
25762
- if (type === image) {
25763
- return
25764
- }
25765
-
25766
- intro += caret
25767
- index++
25768
- type = footnote
25769
- }
25770
-
25771
25625
  // Eat the text.
25772
25626
  depth = 0
25773
25627
 
@@ -25824,13 +25678,7 @@ function reference(eat, value, silent) {
25824
25678
 
25825
25679
  character = value.charAt(index)
25826
25680
 
25827
- // Inline footnotes cannot have a label.
25828
- // If footnotes are enabled, link labels cannot start with a caret.
25829
- if (
25830
- type !== footnote &&
25831
- character === leftSquareBracket &&
25832
- (!footnotes || value.charAt(index + 1) !== caret)
25833
- ) {
25681
+ if (character === leftSquareBracket) {
25834
25682
  identifier = ''
25835
25683
  queue += character
25836
25684
  index++
@@ -25887,13 +25735,6 @@ function reference(eat, value, silent) {
25887
25735
  return true
25888
25736
  }
25889
25737
 
25890
- if (type === footnote && content.indexOf(space) !== -1) {
25891
- return eat(subvalue)({
25892
- type: footnote,
25893
- children: this.tokenizeInline(content, eat.now())
25894
- })
25895
- }
25896
-
25897
25738
  now = eat.now()
25898
25739
  now.column += intro.length
25899
25740
  now.offset += intro.length
@@ -25902,18 +25743,15 @@ function reference(eat, value, silent) {
25902
25743
  node = {
25903
25744
  type: type + 'Reference',
25904
25745
  identifier: normalize(identifier),
25905
- label: identifier
25906
- }
25907
-
25908
- if (type === link || type === image) {
25909
- node.referenceType = referenceType
25746
+ label: identifier,
25747
+ referenceType: referenceType
25910
25748
  }
25911
25749
 
25912
25750
  if (type === link) {
25913
25751
  exit = self.enterLink()
25914
25752
  node.children = self.tokenizeInline(content, now)
25915
25753
  exit()
25916
- } else if (type === image) {
25754
+ } else {
25917
25755
  node.alt = self.decode.raw(self.unescape(content), now) || null
25918
25756
  }
25919
25757
 
@@ -25950,7 +25788,7 @@ function strong(eat, value, silent) {
25950
25788
  var queue
25951
25789
  var subvalue
25952
25790
  var length
25953
- var prev
25791
+ var previous
25954
25792
 
25955
25793
  if (
25956
25794
  (character !== asterisk && character !== underscore) ||
@@ -25972,13 +25810,13 @@ function strong(eat, value, silent) {
25972
25810
  }
25973
25811
 
25974
25812
  while (index < length) {
25975
- prev = character
25813
+ previous = character
25976
25814
  character = value.charAt(index)
25977
25815
 
25978
25816
  if (
25979
25817
  character === marker &&
25980
25818
  value.charAt(index + 1) === marker &&
25981
- (!pedantic || !whitespace(prev))
25819
+ (!pedantic || !whitespace(previous))
25982
25820
  ) {
25983
25821
  character = value.charAt(index + 2)
25984
25822
 
@@ -26205,7 +26043,7 @@ function table(eat, value, silent) {
26205
26043
 
26206
26044
  if (queue.length > 1) {
26207
26045
  if (character) {
26208
- subvalue += queue.slice(0, queue.length - 1)
26046
+ subvalue += queue.slice(0, -1)
26209
26047
  queue = queue.charAt(queue.length - 1)
26210
26048
  } else {
26211
26049
  subvalue += queue
@@ -26405,7 +26243,10 @@ function thematicBreak(eat, value, silent) {
26405
26243
  "use strict";
26406
26244
 
26407
26245
 
26246
+ var ccount = __webpack_require__(932)
26408
26247
  var decode = __webpack_require__(7574)
26248
+ var decimal = __webpack_require__(6195)
26249
+ var alphabetical = __webpack_require__(6260)
26409
26250
  var whitespace = __webpack_require__(2139)
26410
26251
  var locate = __webpack_require__(1020)
26411
26252
 
@@ -26413,148 +26254,202 @@ module.exports = url
26413
26254
  url.locator = locate
26414
26255
  url.notInLink = true
26415
26256
 
26416
- var quotationMark = '"'
26417
- var apostrophe = "'"
26418
- var leftParenthesis = '('
26419
- var rightParenthesis = ')'
26420
- var comma = ','
26421
- var dot = '.'
26422
- var colon = ':'
26423
- var semicolon = ';'
26424
- var lessThan = '<'
26425
- var atSign = '@'
26426
- var leftSquareBracket = '['
26427
- var rightSquareBracket = ']'
26428
-
26429
- var http = 'http://'
26430
- var https = 'https://'
26431
- var mailto = 'mailto:'
26432
-
26433
- var protocols = [http, https, mailto]
26257
+ var exclamationMark = 33 // '!'
26258
+ var ampersand = 38 // '&'
26259
+ var rightParenthesis = 41 // ')'
26260
+ var asterisk = 42 // '*'
26261
+ var comma = 44 // ','
26262
+ var dash = 45 // '-'
26263
+ var dot = 46 // '.'
26264
+ var colon = 58 // ':'
26265
+ var semicolon = 59 // ';'
26266
+ var questionMark = 63 // '?'
26267
+ var lessThan = 60 // '<'
26268
+ var underscore = 95 // '_'
26269
+ var tilde = 126 // '~'
26434
26270
 
26435
- var protocolsLength = protocols.length
26271
+ var leftParenthesisCharacter = '('
26272
+ var rightParenthesisCharacter = ')'
26436
26273
 
26437
26274
  function url(eat, value, silent) {
26438
26275
  var self = this
26439
- var subvalue
26440
- var content
26441
- var character
26276
+ var gfm = self.options.gfm
26277
+ var tokenizers = self.inlineTokenizers
26278
+ var length = value.length
26279
+ var previousDot = -1
26280
+ var protocolless = false
26281
+ var dots
26282
+ var lastTwoPartsStart
26283
+ var start
26442
26284
  var index
26443
- var position
26444
- var protocol
26445
- var match
26446
- var length
26447
- var queue
26448
- var parenCount
26449
- var nextCharacter
26450
- var tokenizers
26285
+ var pathStart
26286
+ var path
26287
+ var code
26288
+ var end
26289
+ var leftCount
26290
+ var rightCount
26291
+ var content
26292
+ var children
26293
+ var url
26451
26294
  var exit
26452
26295
 
26453
- if (!self.options.gfm) {
26296
+ if (!gfm) {
26454
26297
  return
26455
26298
  }
26456
26299
 
26457
- subvalue = ''
26458
- index = -1
26300
+ // `WWW.` doesn’t work.
26301
+ if (value.slice(0, 4) === 'www.') {
26302
+ protocolless = true
26303
+ index = 4
26304
+ } else if (value.slice(0, 7).toLowerCase() === 'http://') {
26305
+ index = 7
26306
+ } else if (value.slice(0, 8).toLowerCase() === 'https://') {
26307
+ index = 8
26308
+ } else {
26309
+ return
26310
+ }
26459
26311
 
26460
- while (++index < protocolsLength) {
26461
- protocol = protocols[index]
26462
- match = value.slice(0, protocol.length)
26312
+ // Act as if the starting boundary is a dot.
26313
+ previousDot = index - 1
26463
26314
 
26464
- if (match.toLowerCase() === protocol) {
26465
- subvalue = match
26466
- break
26315
+ // Parse a valid domain.
26316
+ start = index
26317
+ dots = []
26318
+
26319
+ while (index < length) {
26320
+ code = value.charCodeAt(index)
26321
+
26322
+ if (code === dot) {
26323
+ // Dots may not appear after each other.
26324
+ if (previousDot === index - 1) {
26325
+ break
26326
+ }
26327
+
26328
+ dots.push(index)
26329
+ previousDot = index
26330
+ index++
26331
+ continue
26467
26332
  }
26333
+
26334
+ if (
26335
+ decimal(code) ||
26336
+ alphabetical(code) ||
26337
+ code === dash ||
26338
+ code === underscore
26339
+ ) {
26340
+ index++
26341
+ continue
26342
+ }
26343
+
26344
+ break
26468
26345
  }
26469
26346
 
26470
- if (!subvalue) {
26347
+ // Ignore a final dot:
26348
+ if (code === dot) {
26349
+ dots.pop()
26350
+ index--
26351
+ }
26352
+
26353
+ // If there are not dots, exit.
26354
+ if (dots[0] === undefined) {
26471
26355
  return
26472
26356
  }
26473
26357
 
26474
- index = subvalue.length
26475
- length = value.length
26476
- queue = ''
26477
- parenCount = 0
26358
+ // If there is an underscore in the last two domain parts, exit:
26359
+ // `www.example.c_m` and `www.ex_ample.com` are not OK, but
26360
+ // `www.sub_domain.example.com` is.
26361
+ lastTwoPartsStart = dots.length < 2 ? start : dots[dots.length - 2] + 1
26478
26362
 
26363
+ if (value.slice(lastTwoPartsStart, index).indexOf('_') !== -1) {
26364
+ return
26365
+ }
26366
+
26367
+ /* istanbul ignore if - never used (yet) */
26368
+ if (silent) {
26369
+ return true
26370
+ }
26371
+
26372
+ end = index
26373
+ pathStart = index
26374
+
26375
+ // Parse a path.
26479
26376
  while (index < length) {
26480
- character = value.charAt(index)
26377
+ code = value.charCodeAt(index)
26481
26378
 
26482
- if (whitespace(character) || character === lessThan) {
26379
+ if (whitespace(code) || code === lessThan) {
26483
26380
  break
26484
26381
  }
26485
26382
 
26383
+ index++
26384
+
26486
26385
  if (
26487
- character === dot ||
26488
- character === comma ||
26489
- character === colon ||
26490
- character === semicolon ||
26491
- character === quotationMark ||
26492
- character === apostrophe ||
26493
- character === rightParenthesis ||
26494
- character === rightSquareBracket
26386
+ code === exclamationMark ||
26387
+ code === asterisk ||
26388
+ code === comma ||
26389
+ code === dot ||
26390
+ code === colon ||
26391
+ code === questionMark ||
26392
+ code === underscore ||
26393
+ code === tilde
26495
26394
  ) {
26496
- nextCharacter = value.charAt(index + 1)
26497
-
26498
- if (!nextCharacter || whitespace(nextCharacter)) {
26499
- break
26500
- }
26395
+ // Empty
26396
+ } else {
26397
+ end = index
26501
26398
  }
26399
+ }
26502
26400
 
26503
- if (character === leftParenthesis || character === leftSquareBracket) {
26504
- parenCount++
26505
- }
26401
+ index = end
26506
26402
 
26507
- if (character === rightParenthesis || character === rightSquareBracket) {
26508
- parenCount--
26403
+ // If the path ends in a closing paren, and the count of closing parens is
26404
+ // higher than the opening count, then remove the supefluous closing parens.
26405
+ if (value.charCodeAt(index - 1) === rightParenthesis) {
26406
+ path = value.slice(pathStart, index)
26407
+ leftCount = ccount(path, leftParenthesisCharacter)
26408
+ rightCount = ccount(path, rightParenthesisCharacter)
26509
26409
 
26510
- if (parenCount < 0) {
26511
- break
26512
- }
26410
+ while (rightCount > leftCount) {
26411
+ index = pathStart + path.lastIndexOf(rightParenthesisCharacter)
26412
+ path = value.slice(pathStart, index)
26413
+ rightCount--
26513
26414
  }
26514
-
26515
- queue += character
26516
- index++
26517
26415
  }
26518
26416
 
26519
- if (!queue) {
26520
- return
26521
- }
26417
+ if (value.charCodeAt(index - 1) === semicolon) {
26418
+ // GitHub doesn’t document this, but final semicolons aren’t paret of the
26419
+ // URL either.
26420
+ index--
26522
26421
 
26523
- subvalue += queue
26524
- content = subvalue
26422
+ // // If the path ends in what looks like an entity, it’s not part of the path.
26423
+ if (alphabetical(value.charCodeAt(index - 1))) {
26424
+ end = index - 2
26525
26425
 
26526
- if (protocol === mailto) {
26527
- position = queue.indexOf(atSign)
26426
+ while (alphabetical(value.charCodeAt(end))) {
26427
+ end--
26428
+ }
26528
26429
 
26529
- if (position === -1 || position === length - 1) {
26530
- return
26430
+ if (value.charCodeAt(end) === ampersand) {
26431
+ index = end
26432
+ }
26531
26433
  }
26532
-
26533
- content = content.slice(mailto.length)
26534
26434
  }
26535
26435
 
26536
- /* istanbul ignore if - never used (yet) */
26537
- if (silent) {
26538
- return true
26436
+ content = value.slice(0, index)
26437
+ url = decode(content, {nonTerminated: false})
26438
+
26439
+ if (protocolless) {
26440
+ url = 'http://' + url
26539
26441
  }
26540
26442
 
26541
26443
  exit = self.enterLink()
26542
26444
 
26543
26445
  // Temporarily remove all tokenizers except text in url.
26544
- tokenizers = self.inlineTokenizers
26545
26446
  self.inlineTokenizers = {text: tokenizers.text}
26546
-
26547
- content = self.tokenizeInline(content, eat.now())
26548
-
26447
+ children = self.tokenizeInline(content, eat.now())
26549
26448
  self.inlineTokenizers = tokenizers
26449
+
26550
26450
  exit()
26551
26451
 
26552
- return eat(subvalue)({
26553
- type: 'link',
26554
- title: null,
26555
- url: decode(subvalue, {nonTerminated: false}),
26556
- children: content
26557
- })
26452
+ return eat(content)({type: 'link', title: null, url: url, children: children})
26558
26453
  }
26559
26454
 
26560
26455
 
@@ -26612,11 +26507,15 @@ function factory(type) {
26612
26507
  name = methods[index]
26613
26508
  method = tokenizers[name]
26614
26509
 
26510
+ // Previously, we had constructs such as footnotes and YAML that used
26511
+ // these properties.
26512
+ // Those are now external (plus there are userland extensions), that may
26513
+ // still use them.
26615
26514
  if (
26616
26515
  method &&
26617
26516
  /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&
26618
- (!method.notInList || !self.inList) &&
26619
- (!method.notInBlock || !self.inBlock) &&
26517
+ /* istanbul ignore next */ (!method.notInList || !self.inList) &&
26518
+ /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&
26620
26519
  (!method.notInLink || !self.inLink)
26621
26520
  ) {
26622
26521
  valueLength = value.length
@@ -26675,7 +26574,7 @@ function factory(type) {
26675
26574
 
26676
26575
  // Done. Called when the last character is eaten to retrieve the range’s
26677
26576
  // offsets.
26678
- return function() {
26577
+ return function () {
26679
26578
  var last = line + 1
26680
26579
 
26681
26580
  while (pos < last) {
@@ -26726,10 +26625,10 @@ function factory(type) {
26726
26625
 
26727
26626
  // Add the position to a node.
26728
26627
  function update(node, indent) {
26729
- var prev = node.position
26730
- var start = prev ? prev.start : before
26628
+ var previous = node.position
26629
+ var start = previous ? previous.start : before
26731
26630
  var combined = []
26732
- var n = prev && prev.end.line
26631
+ var n = previous && previous.end.line
26733
26632
  var l = before.line
26734
26633
 
26735
26634
  node.position = new Position(start)
@@ -26739,8 +26638,8 @@ function factory(type) {
26739
26638
  // because some information, the indent between `n` and `l` wasn’t
26740
26639
  // tracked. Luckily, that space is (should be?) empty, so we can
26741
26640
  // safely check for it now.
26742
- if (prev && indent && prev.indent) {
26743
- combined = prev.indent
26641
+ if (previous && indent && previous.indent) {
26642
+ combined = previous.indent
26744
26643
 
26745
26644
  if (n < l) {
26746
26645
  while (++n < l) {
@@ -26763,21 +26662,21 @@ function factory(type) {
26763
26662
  // possible.
26764
26663
  function add(node, parent) {
26765
26664
  var children = parent ? parent.children : tokens
26766
- var prev = children[children.length - 1]
26665
+ var previous = children[children.length - 1]
26767
26666
  var fn
26768
26667
 
26769
26668
  if (
26770
- prev &&
26771
- node.type === prev.type &&
26669
+ previous &&
26670
+ node.type === previous.type &&
26772
26671
  (node.type === 'text' || node.type === 'blockquote') &&
26773
- mergeable(prev) &&
26672
+ mergeable(previous) &&
26774
26673
  mergeable(node)
26775
26674
  ) {
26776
26675
  fn = node.type === 'text' ? mergeText : mergeBlockquote
26777
- node = fn.call(self, prev, node)
26676
+ node = fn.call(self, previous, node)
26778
26677
  }
26779
26678
 
26780
- if (node !== prev) {
26679
+ if (node !== previous) {
26781
26680
  children.push(node)
26782
26681
  }
26783
26682
 
@@ -26862,21 +26761,21 @@ function mergeable(node) {
26862
26761
  }
26863
26762
 
26864
26763
  // Merge two text nodes: `node` into `prev`.
26865
- function mergeText(prev, node) {
26866
- prev.value += node.value
26764
+ function mergeText(previous, node) {
26765
+ previous.value += node.value
26867
26766
 
26868
- return prev
26767
+ return previous
26869
26768
  }
26870
26769
 
26871
26770
  // Merge two blockquotes: `node` into `prev`, unless in CommonMark or gfm modes.
26872
- function mergeBlockquote(prev, node) {
26771
+ function mergeBlockquote(previous, node) {
26873
26772
  if (this.options.commonmark || this.options.gfm) {
26874
26773
  return node
26875
26774
  }
26876
26775
 
26877
- prev.children = prev.children.concat(node.children)
26776
+ previous.children = previous.children.concat(node.children)
26878
26777
 
26879
- return prev
26778
+ return previous
26880
26779
  }
26881
26780
 
26882
26781
 
@@ -26898,26 +26797,26 @@ function factory(ctx, key) {
26898
26797
 
26899
26798
  // De-escape a string using the expression at `key` in `ctx`.
26900
26799
  function unescape(value) {
26901
- var prev = 0
26800
+ var previous = 0
26902
26801
  var index = value.indexOf(backslash)
26903
26802
  var escape = ctx[key]
26904
26803
  var queue = []
26905
26804
  var character
26906
26805
 
26907
26806
  while (index !== -1) {
26908
- queue.push(value.slice(prev, index))
26909
- prev = index + 1
26910
- character = value.charAt(prev)
26807
+ queue.push(value.slice(previous, index))
26808
+ previous = index + 1
26809
+ character = value.charAt(previous)
26911
26810
 
26912
26811
  // If the following character is not a valid escape, add the slash.
26913
26812
  if (!character || escape.indexOf(character) === -1) {
26914
26813
  queue.push(backslash)
26915
26814
  }
26916
26815
 
26917
- index = value.indexOf(backslash, prev + 1)
26816
+ index = value.indexOf(backslash, previous + 1)
26918
26817
  }
26919
26818
 
26920
- queue.push(value.slice(prev))
26819
+ queue.push(value.slice(previous))
26921
26820
 
26922
26821
  return queue.join('')
26923
26822
  }
@@ -26947,6 +26846,7 @@ function indentation(value) {
26947
26846
  var character = value.charAt(index)
26948
26847
  var stops = {}
26949
26848
  var size
26849
+ var lastIndent = 0
26950
26850
 
26951
26851
  while (character === tab || character === space) {
26952
26852
  size = character === tab ? tabSize : spaceSize
@@ -26957,7 +26857,10 @@ function indentation(value) {
26957
26857
  indent = Math.floor(indent / size) * size
26958
26858
  }
26959
26859
 
26960
- stops[indent] = index
26860
+ while (lastIndent < indent) {
26861
+ stops[++lastIndent] = index
26862
+ }
26863
+
26961
26864
  character = value.charAt(++index)
26962
26865
  }
26963
26866
 
@@ -27017,7 +26920,7 @@ exports._ = new RegExp(
27017
26920
 
27018
26921
  module.exports = interrupt
27019
26922
 
27020
- function interrupt(interruptors, tokenizers, ctx, params) {
26923
+ function interrupt(interruptors, tokenizers, ctx, parameters) {
27021
26924
  var length = interruptors.length
27022
26925
  var index = -1
27023
26926
  var interruptor
@@ -27041,7 +26944,7 @@ function interrupt(interruptors, tokenizers, ctx, params) {
27041
26944
  continue
27042
26945
  }
27043
26946
 
27044
- if (tokenizers[interruptor[0]].apply(ctx, params)) {
26947
+ if (tokenizers[interruptor[0]].apply(ctx, parameters)) {
27045
26948
  return true
27046
26949
  }
27047
26950
  }
@@ -27083,7 +26986,6 @@ var getIndent = __webpack_require__(2299)
27083
26986
 
27084
26987
  module.exports = indentation
27085
26988
 
27086
- var tab = '\t'
27087
26989
  var lineFeed = '\n'
27088
26990
  var space = ' '
27089
26991
  var exclamationMark = '!'
@@ -27098,7 +27000,6 @@ function indentation(value, maximum) {
27098
27000
  var index
27099
27001
  var indentation
27100
27002
  var stops
27101
- var padding
27102
27003
 
27103
27004
  values.unshift(repeat(space, maximum) + exclamationMark)
27104
27005
 
@@ -27133,18 +27034,7 @@ function indentation(value, maximum) {
27133
27034
  index--
27134
27035
  }
27135
27036
 
27136
- if (
27137
- trim(values[position]).length !== 0 &&
27138
- minIndent &&
27139
- index !== minIndent
27140
- ) {
27141
- padding = tab
27142
- } else {
27143
- padding = ''
27144
- }
27145
-
27146
- values[position] =
27147
- padding + values[position].slice(index in stops ? stops[index] + 1 : 0)
27037
+ values[position] = values[position].slice(stops[index] + 1)
27148
27038
  }
27149
27039
  }
27150
27040
 
@@ -27209,8 +27099,8 @@ function bridge(destination, options) {
27209
27099
  function transformer(node, file, next) {
27210
27100
  destination.run(mdast2hast(node, options), file, done)
27211
27101
 
27212
- function done(err) {
27213
- next(err)
27102
+ function done(error) {
27103
+ next(error)
27214
27104
  }
27215
27105
  }
27216
27106
  }
@@ -28513,7 +28403,7 @@ function enter(compiler, node) {
28513
28403
  "use strict";
28514
28404
 
28515
28405
 
28516
- var decode = __webpack_require__(4595)
28406
+ var decode = __webpack_require__(7574)
28517
28407
 
28518
28408
  module.exports = length
28519
28409
 
@@ -29522,486 +29412,6 @@ function thematic() {
29522
29412
  }
29523
29413
 
29524
29414
 
29525
- /***/ }),
29526
-
29527
- /***/ 6327:
29528
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
29529
-
29530
- "use strict";
29531
-
29532
-
29533
- var characterEntities = __webpack_require__(2661)
29534
-
29535
- module.exports = decodeEntity
29536
-
29537
- var own = {}.hasOwnProperty
29538
-
29539
- function decodeEntity(characters) {
29540
- return own.call(characterEntities, characters)
29541
- ? characterEntities[characters]
29542
- : false
29543
- }
29544
-
29545
-
29546
- /***/ }),
29547
-
29548
- /***/ 4595:
29549
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
29550
-
29551
- "use strict";
29552
-
29553
-
29554
- var legacy = __webpack_require__(7452)
29555
- var invalid = __webpack_require__(3580)
29556
- var decimal = __webpack_require__(6195)
29557
- var hexadecimal = __webpack_require__(9480)
29558
- var alphanumerical = __webpack_require__(7961)
29559
- var decodeEntity = __webpack_require__(6327)
29560
-
29561
- module.exports = parseEntities
29562
-
29563
- var own = {}.hasOwnProperty
29564
- var fromCharCode = String.fromCharCode
29565
- var noop = Function.prototype
29566
-
29567
- // Default settings.
29568
- var defaults = {
29569
- warning: null,
29570
- reference: null,
29571
- text: null,
29572
- warningContext: null,
29573
- referenceContext: null,
29574
- textContext: null,
29575
- position: {},
29576
- additional: null,
29577
- attribute: false,
29578
- nonTerminated: true
29579
- }
29580
-
29581
- // Characters.
29582
- var tab = 9 // '\t'
29583
- var lineFeed = 10 // '\n'
29584
- var formFeed = 12 // '\f'
29585
- var space = 32 // ' '
29586
- var ampersand = 38 // '&'
29587
- var semicolon = 59 // ';'
29588
- var lessThan = 60 // '<'
29589
- var equalsTo = 61 // '='
29590
- var numberSign = 35 // '#'
29591
- var uppercaseX = 88 // 'X'
29592
- var lowercaseX = 120 // 'x'
29593
- var replacementCharacter = 65533 // '�'
29594
-
29595
- // Reference types.
29596
- var name = 'named'
29597
- var hexa = 'hexadecimal'
29598
- var deci = 'decimal'
29599
-
29600
- // Map of bases.
29601
- var bases = {}
29602
-
29603
- bases[hexa] = 16
29604
- bases[deci] = 10
29605
-
29606
- // Map of types to tests.
29607
- // Each type of character reference accepts different characters.
29608
- // This test is used to detect whether a reference has ended (as the semicolon
29609
- // is not strictly needed).
29610
- var tests = {}
29611
-
29612
- tests[name] = alphanumerical
29613
- tests[deci] = decimal
29614
- tests[hexa] = hexadecimal
29615
-
29616
- // Warning types.
29617
- var namedNotTerminated = 1
29618
- var numericNotTerminated = 2
29619
- var namedEmpty = 3
29620
- var numericEmpty = 4
29621
- var namedUnknown = 5
29622
- var numericDisallowed = 6
29623
- var numericProhibited = 7
29624
-
29625
- // Warning messages.
29626
- var messages = {}
29627
-
29628
- messages[namedNotTerminated] =
29629
- 'Named character references must be terminated by a semicolon'
29630
- messages[numericNotTerminated] =
29631
- 'Numeric character references must be terminated by a semicolon'
29632
- messages[namedEmpty] = 'Named character references cannot be empty'
29633
- messages[numericEmpty] = 'Numeric character references cannot be empty'
29634
- messages[namedUnknown] = 'Named character references must be known'
29635
- messages[numericDisallowed] =
29636
- 'Numeric character references cannot be disallowed'
29637
- messages[numericProhibited] =
29638
- 'Numeric character references cannot be outside the permissible Unicode range'
29639
-
29640
- // Wrap to ensure clean parameters are given to `parse`.
29641
- function parseEntities(value, options) {
29642
- var settings = {}
29643
- var option
29644
- var key
29645
-
29646
- if (!options) {
29647
- options = {}
29648
- }
29649
-
29650
- for (key in defaults) {
29651
- option = options[key]
29652
- settings[key] =
29653
- option === null || option === undefined ? defaults[key] : option
29654
- }
29655
-
29656
- if (settings.position.indent || settings.position.start) {
29657
- settings.indent = settings.position.indent || []
29658
- settings.position = settings.position.start
29659
- }
29660
-
29661
- return parse(value, settings)
29662
- }
29663
-
29664
- // Parse entities.
29665
- // eslint-disable-next-line complexity
29666
- function parse(value, settings) {
29667
- var additional = settings.additional
29668
- var nonTerminated = settings.nonTerminated
29669
- var handleText = settings.text
29670
- var handleReference = settings.reference
29671
- var handleWarning = settings.warning
29672
- var textContext = settings.textContext
29673
- var referenceContext = settings.referenceContext
29674
- var warningContext = settings.warningContext
29675
- var pos = settings.position
29676
- var indent = settings.indent || []
29677
- var length = value.length
29678
- var index = 0
29679
- var lines = -1
29680
- var column = pos.column || 1
29681
- var line = pos.line || 1
29682
- var queue = ''
29683
- var result = []
29684
- var entityCharacters
29685
- var namedEntity
29686
- var terminated
29687
- var characters
29688
- var character
29689
- var reference
29690
- var following
29691
- var warning
29692
- var reason
29693
- var output
29694
- var entity
29695
- var begin
29696
- var start
29697
- var type
29698
- var test
29699
- var prev
29700
- var next
29701
- var diff
29702
- var end
29703
-
29704
- if (typeof additional === 'string') {
29705
- additional = additional.charCodeAt(0)
29706
- }
29707
-
29708
- // Cache the current point.
29709
- prev = now()
29710
-
29711
- // Wrap `handleWarning`.
29712
- warning = handleWarning ? parseError : noop
29713
-
29714
- // Ensure the algorithm walks over the first character and the end
29715
- // (inclusive).
29716
- index--
29717
- length++
29718
-
29719
- while (++index < length) {
29720
- // If the previous character was a newline.
29721
- if (character === lineFeed) {
29722
- column = indent[lines] || 1
29723
- }
29724
-
29725
- character = value.charCodeAt(index)
29726
-
29727
- if (character === ampersand) {
29728
- following = value.charCodeAt(index + 1)
29729
-
29730
- // The behaviour depends on the identity of the next character.
29731
- if (
29732
- following === tab ||
29733
- following === lineFeed ||
29734
- following === formFeed ||
29735
- following === space ||
29736
- following === ampersand ||
29737
- following === lessThan ||
29738
- following !== following ||
29739
- (additional && following === additional)
29740
- ) {
29741
- // Not a character reference.
29742
- // No characters are consumed, and nothing is returned.
29743
- // This is not an error, either.
29744
- queue += fromCharCode(character)
29745
- column++
29746
-
29747
- continue
29748
- }
29749
-
29750
- start = index + 1
29751
- begin = start
29752
- end = start
29753
-
29754
- if (following === numberSign) {
29755
- // Numerical entity.
29756
- end = ++begin
29757
-
29758
- // The behaviour further depends on the next character.
29759
- following = value.charCodeAt(end)
29760
-
29761
- if (following === uppercaseX || following === lowercaseX) {
29762
- // ASCII hex digits.
29763
- type = hexa
29764
- end = ++begin
29765
- } else {
29766
- // ASCII digits.
29767
- type = deci
29768
- }
29769
- } else {
29770
- // Named entity.
29771
- type = name
29772
- }
29773
-
29774
- entityCharacters = ''
29775
- entity = ''
29776
- characters = ''
29777
- test = tests[type]
29778
- end--
29779
-
29780
- while (++end < length) {
29781
- following = value.charCodeAt(end)
29782
-
29783
- if (!test(following)) {
29784
- break
29785
- }
29786
-
29787
- characters += fromCharCode(following)
29788
-
29789
- // Check if we can match a legacy named reference.
29790
- // If so, we cache that as the last viable named reference.
29791
- // This ensures we do not need to walk backwards later.
29792
- if (type === name && own.call(legacy, characters)) {
29793
- entityCharacters = characters
29794
- entity = legacy[characters]
29795
- }
29796
- }
29797
-
29798
- terminated = value.charCodeAt(end) === semicolon
29799
-
29800
- if (terminated) {
29801
- end++
29802
-
29803
- namedEntity = type === name ? decodeEntity(characters) : false
29804
-
29805
- if (namedEntity) {
29806
- entityCharacters = characters
29807
- entity = namedEntity
29808
- }
29809
- }
29810
-
29811
- diff = 1 + end - start
29812
-
29813
- if (!terminated && !nonTerminated) {
29814
- // Empty.
29815
- } else if (!characters) {
29816
- // An empty (possible) entity is valid, unless it’s numeric (thus an
29817
- // ampersand followed by an octothorp).
29818
- if (type !== name) {
29819
- warning(numericEmpty, diff)
29820
- }
29821
- } else if (type === name) {
29822
- // An ampersand followed by anything unknown, and not terminated, is
29823
- // invalid.
29824
- if (terminated && !entity) {
29825
- warning(namedUnknown, 1)
29826
- } else {
29827
- // If theres something after an entity name which is not known, cap
29828
- // the reference.
29829
- if (entityCharacters !== characters) {
29830
- end = begin + entityCharacters.length
29831
- diff = 1 + end - begin
29832
- terminated = false
29833
- }
29834
-
29835
- // If the reference is not terminated, warn.
29836
- if (!terminated) {
29837
- reason = entityCharacters ? namedNotTerminated : namedEmpty
29838
-
29839
- if (settings.attribute) {
29840
- following = value.charCodeAt(end)
29841
-
29842
- if (following === equalsTo) {
29843
- warning(reason, diff)
29844
- entity = null
29845
- } else if (alphanumerical(following)) {
29846
- entity = null
29847
- } else {
29848
- warning(reason, diff)
29849
- }
29850
- } else {
29851
- warning(reason, diff)
29852
- }
29853
- }
29854
- }
29855
-
29856
- reference = entity
29857
- } else {
29858
- if (!terminated) {
29859
- // All non-terminated numeric entities are not rendered, and trigger a
29860
- // warning.
29861
- warning(numericNotTerminated, diff)
29862
- }
29863
-
29864
- // When terminated and number, parse as either hexadecimal or decimal.
29865
- reference = parseInt(characters, bases[type])
29866
-
29867
- // Trigger a warning when the parsed number is prohibited, and replace
29868
- // with replacement character.
29869
- if (prohibited(reference)) {
29870
- warning(numericProhibited, diff)
29871
- reference = fromCharCode(replacementCharacter)
29872
- } else if (reference in invalid) {
29873
- // Trigger a warning when the parsed number is disallowed, and replace
29874
- // by an alternative.
29875
- warning(numericDisallowed, diff)
29876
- reference = invalid[reference]
29877
- } else {
29878
- // Parse the number.
29879
- output = ''
29880
-
29881
- // Trigger a warning when the parsed number should not be used.
29882
- if (disallowed(reference)) {
29883
- warning(numericDisallowed, diff)
29884
- }
29885
-
29886
- // Stringify the number.
29887
- if (reference > 0xffff) {
29888
- reference -= 0x10000
29889
- output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800)
29890
- reference = 0xdc00 | (reference & 0x3ff)
29891
- }
29892
-
29893
- reference = output + fromCharCode(reference)
29894
- }
29895
- }
29896
-
29897
- // Found it!
29898
- // First eat the queued characters as normal text, then eat an entity.
29899
- if (reference) {
29900
- flush()
29901
-
29902
- prev = now()
29903
- index = end - 1
29904
- column += end - start + 1
29905
- result.push(reference)
29906
- next = now()
29907
- next.offset++
29908
-
29909
- if (handleReference) {
29910
- handleReference.call(
29911
- referenceContext,
29912
- reference,
29913
- {start: prev, end: next},
29914
- value.slice(start - 1, end)
29915
- )
29916
- }
29917
-
29918
- prev = next
29919
- } else {
29920
- // If we could not find a reference, queue the checked characters (as
29921
- // normal characters), and move the pointer to their end.
29922
- // This is possible because we can be certain neither newlines nor
29923
- // ampersands are included.
29924
- characters = value.slice(start - 1, end)
29925
- queue += characters
29926
- column += characters.length
29927
- index = end - 1
29928
- }
29929
- } else {
29930
- // Handle anything other than an ampersand, including newlines and EOF.
29931
- if (
29932
- character === 10 // Line feed
29933
- ) {
29934
- line++
29935
- lines++
29936
- column = 0
29937
- }
29938
-
29939
- if (character === character) {
29940
- queue += fromCharCode(character)
29941
- column++
29942
- } else {
29943
- flush()
29944
- }
29945
- }
29946
- }
29947
-
29948
- // Return the reduced nodes.
29949
- return result.join('')
29950
-
29951
- // Get current position.
29952
- function now() {
29953
- return {
29954
- line: line,
29955
- column: column,
29956
- offset: index + (pos.offset || 0)
29957
- }
29958
- }
29959
-
29960
- // “Throw” a parse-error: a warning.
29961
- function parseError(code, offset) {
29962
- var position = now()
29963
-
29964
- position.column += offset
29965
- position.offset += offset
29966
-
29967
- handleWarning.call(warningContext, messages[code], position, code)
29968
- }
29969
-
29970
- // Flush `queue` (normal text).
29971
- // Macro invoked before each entity and at the end of `value`.
29972
- // Does nothing when `queue` is empty.
29973
- function flush() {
29974
- if (queue) {
29975
- result.push(queue)
29976
-
29977
- if (handleText) {
29978
- handleText.call(textContext, queue, {start: prev, end: now()})
29979
- }
29980
-
29981
- queue = ''
29982
- }
29983
- }
29984
- }
29985
-
29986
- // Check if `character` is outside the permissible unicode range.
29987
- function prohibited(code) {
29988
- return (code >= 0xd800 && code <= 0xdfff) || code > 0x10ffff
29989
- }
29990
-
29991
- // Check if `character` is disallowed.
29992
- function disallowed(code) {
29993
- return (
29994
- (code >= 0x0001 && code <= 0x0008) ||
29995
- code === 0x000b ||
29996
- (code >= 0x000d && code <= 0x001f) ||
29997
- (code >= 0x007f && code <= 0x009f) ||
29998
- (code >= 0xfdd0 && code <= 0xfdef) ||
29999
- (code & 0xffff) === 0xffff ||
30000
- (code & 0xffff) === 0xfffe
30001
- )
30002
- }
30003
-
30004
-
30005
29415
  /***/ }),
30006
29416
 
30007
29417
  /***/ 7089:
@@ -30562,24 +29972,6 @@ module.exports = function () {
30562
29972
  };
30563
29973
 
30564
29974
 
30565
- /***/ }),
30566
-
30567
- /***/ 6221:
30568
- /***/ ((module) => {
30569
-
30570
- "use strict";
30571
-
30572
-
30573
- module.exports = trimLines
30574
-
30575
- var ws = /[ \t]*\n+[ \t]*/g
30576
- var newline = '\n'
30577
-
30578
- function trimLines(value) {
30579
- return String(value).replace(ws, newline)
30580
- }
30581
-
30582
-
30583
29975
  /***/ }),
30584
29976
 
30585
29977
  /***/ 7257:
@@ -30849,11 +30241,12 @@ function unherit(Super) {
30849
30241
  "use strict";
30850
30242
 
30851
30243
 
30852
- var extend = __webpack_require__(4470)
30853
30244
  var bail = __webpack_require__(8841)
30854
- var vfile = __webpack_require__(939)
30855
- var trough = __webpack_require__(8281)
30245
+ var buffer = __webpack_require__(8738)
30246
+ var extend = __webpack_require__(4470)
30856
30247
  var plain = __webpack_require__(8980)
30248
+ var trough = __webpack_require__(8281)
30249
+ var vfile = __webpack_require__(939)
30857
30250
 
30858
30251
  // Expose a frozen processor.
30859
30252
  module.exports = unified().freeze()
@@ -30874,9 +30267,9 @@ function pipelineParse(p, ctx) {
30874
30267
  function pipelineRun(p, ctx, next) {
30875
30268
  p.run(ctx.tree, ctx.file, done)
30876
30269
 
30877
- function done(err, tree, file) {
30878
- if (err) {
30879
- next(err)
30270
+ function done(error, tree, file) {
30271
+ if (error) {
30272
+ next(error)
30880
30273
  } else {
30881
30274
  ctx.tree = tree
30882
30275
  ctx.file = file
@@ -30886,7 +30279,19 @@ function pipelineRun(p, ctx, next) {
30886
30279
  }
30887
30280
 
30888
30281
  function pipelineStringify(p, ctx) {
30889
- ctx.file.contents = p.stringify(ctx.tree, ctx.file)
30282
+ var result = p.stringify(ctx.tree, ctx.file)
30283
+
30284
+ if (result === undefined || result === null) {
30285
+ // Empty.
30286
+ } else if (typeof result === 'string' || buffer(result)) {
30287
+ if ('value' in ctx.file) {
30288
+ ctx.file.value = result
30289
+ }
30290
+
30291
+ ctx.file.contents = result
30292
+ } else {
30293
+ ctx.file.result = result
30294
+ }
30890
30295
  }
30891
30296
 
30892
30297
  // Function to create the first processor.
@@ -30894,8 +30299,8 @@ function unified() {
30894
30299
  var attachers = []
30895
30300
  var transformers = trough()
30896
30301
  var namespace = {}
30897
- var frozen = false
30898
30302
  var freezeIndex = -1
30303
+ var frozen
30899
30304
 
30900
30305
  // Data management.
30901
30306
  processor.data = data
@@ -30921,10 +30326,9 @@ function unified() {
30921
30326
  // Create a new processor based on the processor in the current scope.
30922
30327
  function processor() {
30923
30328
  var destination = unified()
30924
- var length = attachers.length
30925
30329
  var index = -1
30926
30330
 
30927
- while (++index < length) {
30331
+ while (++index < attachers.length) {
30928
30332
  destination.use.apply(null, attachers[index])
30929
30333
  }
30930
30334
 
@@ -30942,8 +30346,6 @@ function unified() {
30942
30346
  // In essence, always invoke this when exporting a processor.
30943
30347
  function freeze() {
30944
30348
  var values
30945
- var plugin
30946
- var options
30947
30349
  var transformer
30948
30350
 
30949
30351
  if (frozen) {
@@ -30952,19 +30354,16 @@ function unified() {
30952
30354
 
30953
30355
  while (++freezeIndex < attachers.length) {
30954
30356
  values = attachers[freezeIndex]
30955
- plugin = values[0]
30956
- options = values[1]
30957
- transformer = null
30958
30357
 
30959
- if (options === false) {
30358
+ if (values[1] === false) {
30960
30359
  continue
30961
30360
  }
30962
30361
 
30963
- if (options === true) {
30362
+ if (values[1] === true) {
30964
30363
  values[1] = undefined
30965
30364
  }
30966
30365
 
30967
- transformer = plugin.apply(processor, values.slice(1))
30366
+ transformer = values[0].apply(processor, values.slice(1))
30968
30367
 
30969
30368
  if (typeof transformer === 'function') {
30970
30369
  transformers.use(transformer)
@@ -30984,9 +30383,7 @@ function unified() {
30984
30383
  // Set `key`.
30985
30384
  if (arguments.length === 2) {
30986
30385
  assertUnfrozen('data', frozen)
30987
-
30988
30386
  namespace[key] = value
30989
-
30990
30387
  return processor
30991
30388
  }
30992
30389
 
@@ -31060,16 +30457,12 @@ function unified() {
31060
30457
  }
31061
30458
 
31062
30459
  function addList(plugins) {
31063
- var length
31064
- var index
30460
+ var index = -1
31065
30461
 
31066
30462
  if (plugins === null || plugins === undefined) {
31067
30463
  // Empty.
31068
30464
  } else if (typeof plugins === 'object' && 'length' in plugins) {
31069
- length = plugins.length
31070
- index = -1
31071
-
31072
- while (++index < length) {
30465
+ while (++index < plugins.length) {
31073
30466
  add(plugins[index])
31074
30467
  }
31075
30468
  } else {
@@ -31082,7 +30475,7 @@ function unified() {
31082
30475
 
31083
30476
  if (entry) {
31084
30477
  if (plain(entry[1]) && plain(value)) {
31085
- value = extend(entry[1], value)
30478
+ value = extend(true, entry[1], value)
31086
30479
  }
31087
30480
 
31088
30481
  entry[1] = value
@@ -31093,15 +30486,11 @@ function unified() {
31093
30486
  }
31094
30487
 
31095
30488
  function find(plugin) {
31096
- var length = attachers.length
31097
30489
  var index = -1
31098
- var entry
31099
30490
 
31100
- while (++index < length) {
31101
- entry = attachers[index]
31102
-
31103
- if (entry[0] === plugin) {
31104
- return entry
30491
+ while (++index < attachers.length) {
30492
+ if (attachers[index][0] === plugin) {
30493
+ return attachers[index]
31105
30494
  }
31106
30495
  }
31107
30496
  }
@@ -31143,10 +30532,10 @@ function unified() {
31143
30532
  function executor(resolve, reject) {
31144
30533
  transformers.run(node, vfile(file), done)
31145
30534
 
31146
- function done(err, tree, file) {
30535
+ function done(error, tree, file) {
31147
30536
  tree = tree || node
31148
- if (err) {
31149
- reject(err)
30537
+ if (error) {
30538
+ reject(error)
31150
30539
  } else if (resolve) {
31151
30540
  resolve(tree)
31152
30541
  } else {
@@ -31159,8 +30548,8 @@ function unified() {
31159
30548
  // Run transforms on a unist node representation of a file (in string or
31160
30549
  // vfile representation), sync.
31161
30550
  function runSync(node, file) {
31162
- var complete = false
31163
30551
  var result
30552
+ var complete
31164
30553
 
31165
30554
  run(node, file, done)
31166
30555
 
@@ -31168,10 +30557,10 @@ function unified() {
31168
30557
 
31169
30558
  return result
31170
30559
 
31171
- function done(err, tree) {
30560
+ function done(error, tree) {
31172
30561
  complete = true
31173
- bail(err)
31174
30562
  result = tree
30563
+ bail(error)
31175
30564
  }
31176
30565
  }
31177
30566
 
@@ -31213,9 +30602,9 @@ function unified() {
31213
30602
 
31214
30603
  pipeline.run(processor, {file: file}, done)
31215
30604
 
31216
- function done(err) {
31217
- if (err) {
31218
- reject(err)
30605
+ function done(error) {
30606
+ if (error) {
30607
+ reject(error)
31219
30608
  } else if (resolve) {
31220
30609
  resolve(file)
31221
30610
  } else {
@@ -31227,8 +30616,8 @@ function unified() {
31227
30616
 
31228
30617
  // Process the given document (in string or vfile representation), sync.
31229
30618
  function processSync(doc) {
31230
- var complete = false
31231
30619
  var file
30620
+ var complete
31232
30621
 
31233
30622
  freeze()
31234
30623
  assertParser('processSync', processor.Parser)
@@ -31241,9 +30630,9 @@ function unified() {
31241
30630
 
31242
30631
  return file
31243
30632
 
31244
- function done(err) {
30633
+ function done(error) {
31245
30634
  complete = true
31246
- bail(err)
30635
+ bail(error)
31247
30636
  }
31248
30637
  }
31249
30638
  }
@@ -31385,15 +30774,16 @@ function flatMap(ast, fn) {
31385
30774
  module.exports = generated
31386
30775
 
31387
30776
  function generated(node) {
31388
- var position = optional(optional(node).position)
31389
- var start = optional(position.start)
31390
- var end = optional(position.end)
31391
-
31392
- return !start.line || !start.column || !end.line || !end.column
31393
- }
31394
-
31395
- function optional(value) {
31396
- return value && typeof value === 'object' ? value : {}
30777
+ return (
30778
+ !node ||
30779
+ !node.position ||
30780
+ !node.position.start ||
30781
+ !node.position.start.line ||
30782
+ !node.position.start.column ||
30783
+ !node.position.end ||
30784
+ !node.position.end.line ||
30785
+ !node.position.end.column
30786
+ )
31397
30787
  }
31398
30788
 
31399
30789
 
@@ -31555,6 +30945,203 @@ function soft(node) {
31555
30945
  }
31556
30946
 
31557
30947
 
30948
+ /***/ }),
30949
+
30950
+ /***/ 7627:
30951
+ /***/ ((module) => {
30952
+
30953
+ "use strict";
30954
+
30955
+
30956
+ module.exports = convert
30957
+
30958
+ function convert(test) {
30959
+ if (test == null) {
30960
+ return ok
30961
+ }
30962
+
30963
+ if (typeof test === 'string') {
30964
+ return typeFactory(test)
30965
+ }
30966
+
30967
+ if (typeof test === 'object') {
30968
+ return 'length' in test ? anyFactory(test) : allFactory(test)
30969
+ }
30970
+
30971
+ if (typeof test === 'function') {
30972
+ return test
30973
+ }
30974
+
30975
+ throw new Error('Expected function, string, or object as test')
30976
+ }
30977
+
30978
+ // Utility assert each property in `test` is represented in `node`, and each
30979
+ // values are strictly equal.
30980
+ function allFactory(test) {
30981
+ return all
30982
+
30983
+ function all(node) {
30984
+ var key
30985
+
30986
+ for (key in test) {
30987
+ if (node[key] !== test[key]) return false
30988
+ }
30989
+
30990
+ return true
30991
+ }
30992
+ }
30993
+
30994
+ function anyFactory(tests) {
30995
+ var checks = []
30996
+ var index = -1
30997
+
30998
+ while (++index < tests.length) {
30999
+ checks[index] = convert(tests[index])
31000
+ }
31001
+
31002
+ return any
31003
+
31004
+ function any() {
31005
+ var index = -1
31006
+
31007
+ while (++index < checks.length) {
31008
+ if (checks[index].apply(this, arguments)) {
31009
+ return true
31010
+ }
31011
+ }
31012
+
31013
+ return false
31014
+ }
31015
+ }
31016
+
31017
+ // Utility to convert a string into a function which checks a given node’s type
31018
+ // for said string.
31019
+ function typeFactory(test) {
31020
+ return type
31021
+
31022
+ function type(node) {
31023
+ return Boolean(node && node.type === test)
31024
+ }
31025
+ }
31026
+
31027
+ // Utility to return true.
31028
+ function ok() {
31029
+ return true
31030
+ }
31031
+
31032
+
31033
+ /***/ }),
31034
+
31035
+ /***/ 3351:
31036
+ /***/ ((module) => {
31037
+
31038
+ module.exports = color
31039
+ function color(d) {
31040
+ return '\u001B[33m' + d + '\u001B[39m'
31041
+ }
31042
+
31043
+
31044
+ /***/ }),
31045
+
31046
+ /***/ 5195:
31047
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
31048
+
31049
+ "use strict";
31050
+
31051
+
31052
+ module.exports = visitParents
31053
+
31054
+ var convert = __webpack_require__(7627)
31055
+ var color = __webpack_require__(3351)
31056
+
31057
+ var CONTINUE = true
31058
+ var SKIP = 'skip'
31059
+ var EXIT = false
31060
+
31061
+ visitParents.CONTINUE = CONTINUE
31062
+ visitParents.SKIP = SKIP
31063
+ visitParents.EXIT = EXIT
31064
+
31065
+ function visitParents(tree, test, visitor, reverse) {
31066
+ var step
31067
+ var is
31068
+
31069
+ if (typeof test === 'function' && typeof visitor !== 'function') {
31070
+ reverse = visitor
31071
+ visitor = test
31072
+ test = null
31073
+ }
31074
+
31075
+ is = convert(test)
31076
+ step = reverse ? -1 : 1
31077
+
31078
+ factory(tree, null, [])()
31079
+
31080
+ function factory(node, index, parents) {
31081
+ var value = typeof node === 'object' && node !== null ? node : {}
31082
+ var name
31083
+
31084
+ if (typeof value.type === 'string') {
31085
+ name =
31086
+ typeof value.tagName === 'string'
31087
+ ? value.tagName
31088
+ : typeof value.name === 'string'
31089
+ ? value.name
31090
+ : undefined
31091
+
31092
+ visit.displayName =
31093
+ 'node (' + color(value.type + (name ? '<' + name + '>' : '')) + ')'
31094
+ }
31095
+
31096
+ return visit
31097
+
31098
+ function visit() {
31099
+ var grandparents = parents.concat(node)
31100
+ var result = []
31101
+ var subresult
31102
+ var offset
31103
+
31104
+ if (!test || is(node, index, parents[parents.length - 1] || null)) {
31105
+ result = toResult(visitor(node, parents))
31106
+
31107
+ if (result[0] === EXIT) {
31108
+ return result
31109
+ }
31110
+ }
31111
+
31112
+ if (node.children && result[0] !== SKIP) {
31113
+ offset = (reverse ? node.children.length : -1) + step
31114
+
31115
+ while (offset > -1 && offset < node.children.length) {
31116
+ subresult = factory(node.children[offset], offset, grandparents)()
31117
+
31118
+ if (subresult[0] === EXIT) {
31119
+ return subresult
31120
+ }
31121
+
31122
+ offset =
31123
+ typeof subresult[1] === 'number' ? subresult[1] : offset + step
31124
+ }
31125
+ }
31126
+
31127
+ return result
31128
+ }
31129
+ }
31130
+ }
31131
+
31132
+ function toResult(value) {
31133
+ if (value !== null && typeof value === 'object' && 'length' in value) {
31134
+ return value
31135
+ }
31136
+
31137
+ if (typeof value === 'number') {
31138
+ return [CONTINUE, value]
31139
+ }
31140
+
31141
+ return [value]
31142
+ }
31143
+
31144
+
31558
31145
  /***/ }),
31559
31146
 
31560
31147
  /***/ 750:
@@ -31565,7 +31152,7 @@ function soft(node) {
31565
31152
 
31566
31153
  module.exports = visit
31567
31154
 
31568
- var visitParents = __webpack_require__(9294)
31155
+ var visitParents = __webpack_require__(5195)
31569
31156
 
31570
31157
  var CONTINUE = visitParents.CONTINUE
31571
31158
  var SKIP = visitParents.SKIP
@@ -31747,74 +31334,54 @@ function toResult(value) {
31747
31334
  module.exports = factory
31748
31335
 
31749
31336
  function factory(file) {
31750
- var contents = indices(String(file))
31337
+ var value = String(file)
31338
+ var indices = []
31339
+ var search = /\r?\n|\r/g
31751
31340
 
31752
- return {
31753
- toPosition: offsetToPositionFactory(contents),
31754
- toOffset: positionToOffsetFactory(contents)
31341
+ while (search.exec(value)) {
31342
+ indices.push(search.lastIndex)
31755
31343
  }
31756
- }
31757
31344
 
31758
- // Factory to get the line and column-based `position` for `offset` in the bound
31759
- // indices.
31760
- function offsetToPositionFactory(indices) {
31761
- return offsetToPosition
31345
+ indices.push(value.length + 1)
31762
31346
 
31763
- // Get the line and column-based `position` for `offset` in the bound indices.
31764
- function offsetToPosition(offset) {
31765
- var index = -1
31766
- var length = indices.length
31347
+ return {
31348
+ toPoint: offsetToPoint,
31349
+ toPosition: offsetToPoint,
31350
+ toOffset: pointToOffset
31351
+ }
31767
31352
 
31768
- if (offset < 0) {
31769
- return {}
31770
- }
31353
+ // Get the line and column-based `point` for `offset` in the bound indices.
31354
+ function offsetToPoint(offset) {
31355
+ var index = -1
31771
31356
 
31772
- while (++index < length) {
31773
- if (indices[index] > offset) {
31774
- return {
31775
- line: index + 1,
31776
- column: offset - (indices[index - 1] || 0) + 1,
31777
- offset: offset
31357
+ if (offset > -1 && offset < indices[indices.length - 1]) {
31358
+ while (++index < indices.length) {
31359
+ if (indices[index] > offset) {
31360
+ return {
31361
+ line: index + 1,
31362
+ column: offset - (indices[index - 1] || 0) + 1,
31363
+ offset: offset
31364
+ }
31778
31365
  }
31779
31366
  }
31780
31367
  }
31781
31368
 
31782
31369
  return {}
31783
31370
  }
31784
- }
31785
31371
 
31786
- // Factory to get the `offset` for a line and column-based `position` in the
31787
- // bound indices.
31788
- function positionToOffsetFactory(indices) {
31789
- return positionToOffset
31790
-
31791
- // Get the `offset` for a line and column-based `position` in the bound
31372
+ // Get the `offset` for a line and column-based `point` in the bound
31792
31373
  // indices.
31793
- function positionToOffset(position) {
31794
- var line = position && position.line
31795
- var column = position && position.column
31374
+ function pointToOffset(point) {
31375
+ var line = point && point.line
31376
+ var column = point && point.column
31377
+ var offset
31796
31378
 
31797
31379
  if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {
31798
- return (indices[line - 2] || 0) + column - 1 || 0
31380
+ offset = (indices[line - 2] || 0) + column - 1 || 0
31799
31381
  }
31800
31382
 
31801
- return -1
31802
- }
31803
- }
31804
-
31805
- // Get indices of line-breaks in `value`.
31806
- function indices(value) {
31807
- var result = []
31808
- var index = value.indexOf('\n')
31809
-
31810
- while (index !== -1) {
31811
- result.push(index + 1)
31812
- index = value.indexOf('\n', index + 1)
31383
+ return offset > -1 && offset < indices[indices.length - 1] ? offset : -1
31813
31384
  }
31814
-
31815
- result.push(value.length + 1)
31816
-
31817
- return result
31818
31385
  }
31819
31386
 
31820
31387
 
@@ -34779,11 +34346,12 @@ function plain(text) {
34779
34346
  var _setup6 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_setup5, 2);
34780
34347
  text = _setup6[0];
34781
34348
  opts = _setup6[1];
34782
- return htmlProcessor(opts).use(rehypeReact, {
34349
+ var proc = htmlProcessor(opts).use(rehypeReact, {
34783
34350
  createElement: React.createElement,
34784
34351
  Fragment: React.Fragment,
34785
34352
  components: components
34786
- }).processSync(text).contents;
34353
+ });
34354
+ return proc.processSync(text).result;
34787
34355
  }
34788
34356
 
34789
34357
  /**