@readme/markdown 6.62.6 → 6.64.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
 
@@ -9011,7 +8958,10 @@ module.exports = function CodeTabsCompiler() {
9011
8958
  var Compiler = this.Compiler;
9012
8959
  var visitors = Compiler.prototype.visitors;
9013
8960
  function compile(node) {
9014
- return this.block(node).split('```\n\n').join('```\n');
8961
+ var fence = '```';
8962
+ return node.children.map(function (code) {
8963
+ return "".concat(fence).concat(code.lang || '').concat(code.meta ? " ".concat(code.meta) : '', "\n").concat(code.value ? "".concat(code.value, "\n") : '').concat(fence);
8964
+ }).join('\n');
9015
8965
  }
9016
8966
  visitors['code-tabs'] = compile;
9017
8967
  };
@@ -9369,8 +9319,6 @@ function tokenizer(eat, value) {
9369
9319
  hash = _rgx$exec2[1],
9370
9320
  text = _rgx$exec2[2];
9371
9321
  var now = eat.now();
9372
- now.column += match.length;
9373
- now.offset += match.length;
9374
9322
  return eat(match)({
9375
9323
  type: 'heading',
9376
9324
  depth: hash.length,
@@ -9667,8 +9615,8 @@ function parser() {
9667
9615
  var Parser = this.Parser;
9668
9616
  var tokenizers = Parser.prototype.blockTokenizers;
9669
9617
  var methods = Parser.prototype.blockMethods;
9670
- tokenizers.CodeTabs = tokenizer;
9671
- methods.splice(methods.indexOf('newline'), 0, 'CodeTabs');
9618
+ tokenizers.codeTabs = tokenizer;
9619
+ methods.splice(methods.indexOf('indentedCode') - 1, 0, 'codeTabs');
9672
9620
  }
9673
9621
  module.exports = parser;
9674
9622
  module.exports.sanitize = function (sanitizeSchema) {
@@ -12227,60 +12175,6 @@ exports.doubleQuotesEscapeChars = {
12227
12175
  };
12228
12176
 
12229
12177
 
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
12178
  /***/ }),
12285
12179
 
12286
12180
  /***/ 4470:
@@ -16779,27 +16673,23 @@ function getDefinitionFactory(node, options) {
16779
16673
  }
16780
16674
 
16781
16675
  // Gather all definitions in `node`
16782
- function gather(node, options) {
16676
+ function gather(node) {
16783
16677
  var cache = {}
16784
16678
 
16785
16679
  if (!node || !node.type) {
16786
16680
  throw new Error('mdast-util-definitions expected node')
16787
16681
  }
16788
16682
 
16789
- visit(node, 'definition', options && options.commonmark ? commonmark : normal)
16683
+ visit(node, 'definition', ondefinition)
16790
16684
 
16791
16685
  return cache
16792
16686
 
16793
- function commonmark(definition) {
16687
+ function ondefinition(definition) {
16794
16688
  var id = normalise(definition.identifier)
16795
16689
  if (!own.call(cache, id)) {
16796
16690
  cache[id] = definition
16797
16691
  }
16798
16692
  }
16799
-
16800
- function normal(definition) {
16801
- cache[normalise(definition.identifier)] = definition
16802
- }
16803
16693
  }
16804
16694
 
16805
16695
  // Factory to get a node from the given definition-cache.
@@ -17226,19 +17116,27 @@ function hardBreak(h, node) {
17226
17116
 
17227
17117
  module.exports = code
17228
17118
 
17229
- var detab = __webpack_require__(3128)
17230
17119
  var u = __webpack_require__(914)
17231
17120
 
17232
17121
  function code(h, node) {
17233
- var value = node.value ? detab(node.value + '\n') : ''
17122
+ var value = node.value ? node.value + '\n' : ''
17123
+ // To do: next major, use `node.lang` w/o regex, the splitting’s been going
17124
+ // on for years in remark now.
17234
17125
  var lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/)
17235
17126
  var props = {}
17127
+ var code
17236
17128
 
17237
17129
  if (lang) {
17238
17130
  props.className = ['language-' + lang]
17239
17131
  }
17240
17132
 
17241
- return h(node.position, 'pre', [h(node, 'code', props, [u('text', value)])])
17133
+ code = h(node, 'code', props, [u('text', value)])
17134
+
17135
+ if (node.meta) {
17136
+ code.data = {meta: node.meta}
17137
+ }
17138
+
17139
+ return h(node.position, 'pre', [code])
17242
17140
  }
17243
17141
 
17244
17142
 
@@ -17488,11 +17386,11 @@ function ignore() {
17488
17386
 
17489
17387
  module.exports = inlineCode
17490
17388
 
17491
- var collapse = __webpack_require__(9357)
17492
17389
  var u = __webpack_require__(914)
17493
17390
 
17494
17391
  function inlineCode(h, node) {
17495
- return h(node, 'code', [u('text', collapse(node.value))])
17392
+ var value = node.value.replace(/\r?\n|\r/g, ' ')
17393
+ return h(node, 'code', [u('text', value)])
17496
17394
  }
17497
17395
 
17498
17396
 
@@ -17563,52 +17461,29 @@ function link(h, node) {
17563
17461
  module.exports = listItem
17564
17462
 
17565
17463
  var u = __webpack_require__(914)
17566
- var wrap = __webpack_require__(2931)
17567
17464
  var all = __webpack_require__(5426)
17568
17465
 
17569
17466
  function listItem(h, node, parent) {
17570
- var children = node.children
17571
- var head = children[0]
17572
- var raw = all(h, node)
17467
+ var result = all(h, node)
17468
+ var head = result[0]
17573
17469
  var loose = parent ? listLoose(parent) : listItemLoose(node)
17574
17470
  var props = {}
17575
- var result
17576
- var container
17577
- var index
17471
+ var wrapped = []
17578
17472
  var length
17473
+ var index
17579
17474
  var child
17580
17475
 
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
17476
  if (typeof node.checked === 'boolean') {
17601
- if (loose && (!head || head.type !== 'paragraph')) {
17602
- result.unshift(h(null, 'p', []))
17477
+ if (!head || head.tagName !== 'p') {
17478
+ head = h(null, 'p', [])
17479
+ result.unshift(head)
17603
17480
  }
17604
17481
 
17605
- container = loose ? result[0].children : result
17606
-
17607
- if (container.length !== 0) {
17608
- container.unshift(u('text', ' '))
17482
+ if (head.children.length > 0) {
17483
+ head.children.unshift(u('text', ' '))
17609
17484
  }
17610
17485
 
17611
- container.unshift(
17486
+ head.children.unshift(
17612
17487
  h(null, 'input', {
17613
17488
  type: 'checkbox',
17614
17489
  checked: node.checked,
@@ -17621,11 +17496,30 @@ function listItem(h, node, parent) {
17621
17496
  props.className = ['task-list-item']
17622
17497
  }
17623
17498
 
17624
- if (loose && result.length !== 0) {
17625
- result = wrap(result, true)
17499
+ length = result.length
17500
+ index = -1
17501
+
17502
+ while (++index < length) {
17503
+ child = result[index]
17504
+
17505
+ // Add eols before nodes, except if this is a loose, first paragraph.
17506
+ if (loose || index !== 0 || child.tagName !== 'p') {
17507
+ wrapped.push(u('text', '\n'))
17508
+ }
17509
+
17510
+ if (child.tagName === 'p' && !loose) {
17511
+ wrapped = wrapped.concat(child.children)
17512
+ } else {
17513
+ wrapped.push(child)
17514
+ }
17515
+ }
17516
+
17517
+ // Add a final eol.
17518
+ if (length && (loose || child.tagName !== 'p')) {
17519
+ wrapped.push(u('text', '\n'))
17626
17520
  }
17627
17521
 
17628
- return h(node, 'li', props, result)
17522
+ return h(node, 'li', props, wrapped)
17629
17523
  }
17630
17524
 
17631
17525
  function listLoose(node) {
@@ -17762,7 +17656,7 @@ var all = __webpack_require__(5426)
17762
17656
  function table(h, node) {
17763
17657
  var rows = node.children
17764
17658
  var index = rows.length
17765
- var align = node.align
17659
+ var align = node.align || []
17766
17660
  var alignLength = align.length
17767
17661
  var result = []
17768
17662
  var pos
@@ -17774,7 +17668,7 @@ function table(h, node) {
17774
17668
  while (index--) {
17775
17669
  row = rows[index].children
17776
17670
  name = index === 0 ? 'th' : 'td'
17777
- pos = alignLength
17671
+ pos = alignLength || row.length
17778
17672
  out = []
17779
17673
 
17780
17674
  while (pos--) {
@@ -17789,17 +17683,18 @@ function table(h, node) {
17789
17683
  node,
17790
17684
  'table',
17791
17685
  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
- ],
17686
+ [h(result[0].position, 'thead', wrap([result[0]], true))].concat(
17687
+ result[1]
17688
+ ? h(
17689
+ {
17690
+ start: position.start(result[1]),
17691
+ end: position.end(result[result.length - 1])
17692
+ },
17693
+ 'tbody',
17694
+ wrap(result.slice(1), true)
17695
+ )
17696
+ : []
17697
+ ),
17803
17698
  true
17804
17699
  )
17805
17700
  )
@@ -17817,10 +17712,12 @@ function table(h, node) {
17817
17712
  module.exports = text
17818
17713
 
17819
17714
  var u = __webpack_require__(914)
17820
- var trimLines = __webpack_require__(6221)
17821
17715
 
17822
17716
  function text(h, node) {
17823
- return h.augment(node, u('text', trimLines(node.value)))
17717
+ return h.augment(
17718
+ node,
17719
+ u('text', String(node.value).replace(/[ \t]*(\r?\n|\r)[ \t]*/g, '$1'))
17720
+ )
17824
17721
  }
17825
17722
 
17826
17723
 
@@ -17878,12 +17775,13 @@ function factory(tree, options) {
17878
17775
  var footnoteById = {}
17879
17776
 
17880
17777
  h.dangerous = dangerous
17881
- h.definition = definitions(tree, settings)
17778
+ h.definition = definitions(tree)
17882
17779
  h.footnoteById = footnoteById
17883
17780
  h.footnoteOrder = []
17884
17781
  h.augment = augment
17885
17782
  h.handlers = Object.assign({}, handlers, settings.handlers)
17886
17783
  h.unknownHandler = settings.unknownHandler
17784
+ h.passThrough = settings.passThrough
17887
17785
 
17888
17786
  visit(tree, 'footnoteDefinition', onfootnotedefinition)
17889
17787
 
@@ -17895,10 +17793,19 @@ function factory(tree, options) {
17895
17793
  var ctx
17896
17794
 
17897
17795
  // Handle `data.hName`, `data.hProperties, `data.hChildren`.
17898
- if (left && 'data' in left) {
17796
+ if (left && left.data) {
17899
17797
  data = left.data
17900
17798
 
17901
- if (right.type === 'element' && data.hName) {
17799
+ if (data.hName) {
17800
+ if (right.type !== 'element') {
17801
+ right = {
17802
+ type: 'element',
17803
+ tagName: '',
17804
+ properties: {},
17805
+ children: []
17806
+ }
17807
+ }
17808
+
17902
17809
  right.tagName = data.hName
17903
17810
  }
17904
17811
 
@@ -17946,7 +17853,7 @@ function factory(tree, options) {
17946
17853
  var id = String(definition.identifier).toUpperCase()
17947
17854
 
17948
17855
  // Mimick CM behavior of link definitions.
17949
- // See: <https://github.com/syntax-tree/mdast-util-definitions/blob/8d48e57/index.js#L26>.
17856
+ // See: <https://github.com/syntax-tree/mdast-util-definitions/blob/8290999/index.js#L26>.
17950
17857
  if (!own.call(footnoteById, id)) {
17951
17858
  footnoteById[id] = definition
17952
17859
  }
@@ -17994,13 +17901,21 @@ function unknown(h, node) {
17994
17901
  // Visit a node.
17995
17902
  function one(h, node, parent) {
17996
17903
  var type = node && node.type
17997
- var fn = own.call(h.handlers, type) ? h.handlers[type] : h.unknownHandler
17904
+ var fn
17998
17905
 
17999
17906
  // Fail on non-nodes.
18000
17907
  if (!type) {
18001
17908
  throw new Error('Expected node, got `' + node + '`')
18002
17909
  }
18003
17910
 
17911
+ if (own.call(h.handlers, type)) {
17912
+ fn = h.handlers[type]
17913
+ } else if (h.passThrough && h.passThrough.indexOf(type) > -1) {
17914
+ fn = returnNode
17915
+ } else {
17916
+ fn = h.unknownHandler
17917
+ }
17918
+
18004
17919
  return (typeof fn === 'function' ? fn : unknown)(h, node, parent)
18005
17920
  }
18006
17921
 
@@ -18019,6 +17934,18 @@ function text(node) {
18019
17934
  return 'value' in node
18020
17935
  }
18021
17936
 
17937
+ function returnNode(h, node) {
17938
+ var clone
17939
+
17940
+ if (node.children) {
17941
+ clone = Object.assign({}, node)
17942
+ clone.children = all(h, node)
17943
+ return clone
17944
+ }
17945
+
17946
+ return node
17947
+ }
17948
+
18022
17949
 
18023
17950
  /***/ }),
18024
17951
 
@@ -18103,7 +18030,7 @@ function wrap(nodes, loose) {
18103
18030
  result.push(nodes[index])
18104
18031
  }
18105
18032
 
18106
- if (loose && nodes.length !== 0) {
18033
+ if (loose && nodes.length > 0) {
18107
18034
  result.push(u('text', '\n'))
18108
18035
  }
18109
18036
 
@@ -19299,15 +19226,15 @@ var defaults = {
19299
19226
  // Characters.
19300
19227
  var tab = 9 // '\t'
19301
19228
  var lineFeed = 10 // '\n'
19302
- var formFeed = 12 // '\f'
19229
+ var formFeed = 12 // '\f'
19303
19230
  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'
19231
+ var ampersand = 38 // '&'
19232
+ var semicolon = 59 // ';'
19233
+ var lessThan = 60 // '<'
19234
+ var equalsTo = 61 // '='
19235
+ var numberSign = 35 // '#'
19236
+ var uppercaseX = 88 // 'X'
19237
+ var lowercaseX = 120 // 'x'
19311
19238
  var replacementCharacter = 65533 // '�'
19312
19239
 
19313
19240
  // Reference types.
@@ -19429,7 +19356,8 @@ function parse(value, settings) {
19429
19356
  // Wrap `handleWarning`.
19430
19357
  warning = handleWarning ? parseError : noop
19431
19358
 
19432
- // Ensure the algorithm walks over the first character and the end (inclusive).
19359
+ // Ensure the algorithm walks over the first character and the end
19360
+ // (inclusive).
19433
19361
  index--
19434
19362
  length++
19435
19363
 
@@ -19662,7 +19590,7 @@ function parse(value, settings) {
19662
19590
  }
19663
19591
  }
19664
19592
 
19665
- // Return the reduced nodes, and any possible warnings.
19593
+ // Return the reduced nodes.
19666
19594
  return result.join('')
19667
19595
 
19668
19596
  // Get current position.
@@ -22276,7 +22204,6 @@ module.exports = {
22276
22204
  position: true,
22277
22205
  gfm: true,
22278
22206
  commonmark: false,
22279
- footnotes: false,
22280
22207
  pedantic: false,
22281
22208
  blocks: __webpack_require__(8829)
22282
22209
  }
@@ -22337,6 +22264,65 @@ function locate(value, fromIndex) {
22337
22264
  }
22338
22265
 
22339
22266
 
22267
+ /***/ }),
22268
+
22269
+ /***/ 858:
22270
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
22271
+
22272
+ "use strict";
22273
+
22274
+
22275
+ var decimal = __webpack_require__(6195)
22276
+ var alphabetical = __webpack_require__(6260)
22277
+
22278
+ var plusSign = 43 // '+'
22279
+ var dash = 45 // '-'
22280
+ var dot = 46 // '.'
22281
+ var underscore = 95 // '_'
22282
+
22283
+ module.exports = locate
22284
+
22285
+ // See: <https://github.github.com/gfm/#extended-email-autolink>
22286
+ function locate(value, fromIndex) {
22287
+ var self = this
22288
+ var at
22289
+ var position
22290
+
22291
+ if (!this.options.gfm) {
22292
+ return -1
22293
+ }
22294
+
22295
+ at = value.indexOf('@', fromIndex)
22296
+
22297
+ if (at === -1) {
22298
+ return -1
22299
+ }
22300
+
22301
+ position = at
22302
+
22303
+ if (position === fromIndex || !isGfmAtext(value.charCodeAt(position - 1))) {
22304
+ return locate.call(self, value, at + 1)
22305
+ }
22306
+
22307
+ while (position > fromIndex && isGfmAtext(value.charCodeAt(position - 1))) {
22308
+ position--
22309
+ }
22310
+
22311
+ return position
22312
+ }
22313
+
22314
+ function isGfmAtext(code) {
22315
+ return (
22316
+ decimal(code) ||
22317
+ alphabetical(code) ||
22318
+ code === plusSign ||
22319
+ code === dash ||
22320
+ code === dot ||
22321
+ code === underscore
22322
+ )
22323
+ }
22324
+
22325
+
22340
22326
  /***/ }),
22341
22327
 
22342
22328
  /***/ 6131:
@@ -22453,22 +22439,25 @@ function locate(value, fromIndex) {
22453
22439
 
22454
22440
  module.exports = locate
22455
22441
 
22456
- var protocols = ['https://', 'http://', 'mailto:']
22442
+ var values = ['www.', 'http://', 'https://']
22457
22443
 
22458
22444
  function locate(value, fromIndex) {
22459
- var length = protocols.length
22460
- var index = -1
22461
22445
  var min = -1
22446
+ var index
22447
+ var length
22462
22448
  var position
22463
22449
 
22464
22450
  if (!this.options.gfm) {
22465
- return -1
22451
+ return min
22466
22452
  }
22467
22453
 
22454
+ length = values.length
22455
+ index = -1
22456
+
22468
22457
  while (++index < length) {
22469
- position = value.indexOf(protocols[index], fromIndex)
22458
+ position = value.indexOf(values[index], fromIndex)
22470
22459
 
22471
- if (position !== -1 && (position < min || min === -1)) {
22460
+ if (position !== -1 && (min === -1 || position < min)) {
22472
22461
  min = position
22473
22462
  }
22474
22463
  }
@@ -22585,13 +22574,13 @@ proto.enterBlock = toggle('inBlock', false)
22585
22574
  // In the above example, the thematic break “interupts” the paragraph.
22586
22575
  proto.interruptParagraph = [
22587
22576
  ['thematicBreak'],
22577
+ ['list'],
22588
22578
  ['atxHeading'],
22589
22579
  ['fencedCode'],
22590
22580
  ['blockquote'],
22591
22581
  ['html'],
22592
22582
  ['setextHeading', {commonmark: false}],
22593
- ['definition', {commonmark: false}],
22594
- ['footnote', {commonmark: false}]
22583
+ ['definition', {commonmark: false}]
22595
22584
  ]
22596
22585
 
22597
22586
  // Nodes that can interupt a list:
@@ -22606,8 +22595,7 @@ proto.interruptList = [
22606
22595
  ['atxHeading', {pedantic: false}],
22607
22596
  ['fencedCode', {pedantic: false}],
22608
22597
  ['thematicBreak', {pedantic: false}],
22609
- ['definition', {commonmark: false}],
22610
- ['footnote', {commonmark: false}]
22598
+ ['definition', {commonmark: false}]
22611
22599
  ]
22612
22600
 
22613
22601
  // Nodes that can interupt a blockquote:
@@ -22626,13 +22614,12 @@ proto.interruptBlockquote = [
22626
22614
  ['thematicBreak', {commonmark: true}],
22627
22615
  ['html', {commonmark: true}],
22628
22616
  ['list', {commonmark: true}],
22629
- ['definition', {commonmark: false}],
22630
- ['footnote', {commonmark: false}]
22617
+ ['definition', {commonmark: false}]
22631
22618
  ]
22632
22619
 
22633
22620
  // Handlers.
22634
22621
  proto.blockTokenizers = {
22635
- newline: __webpack_require__(3885),
22622
+ blankLine: __webpack_require__(8086),
22636
22623
  indentedCode: __webpack_require__(1018),
22637
22624
  fencedCode: __webpack_require__(4967),
22638
22625
  blockquote: __webpack_require__(1153),
@@ -22641,7 +22628,6 @@ proto.blockTokenizers = {
22641
22628
  list: __webpack_require__(8332),
22642
22629
  setextHeading: __webpack_require__(6530),
22643
22630
  html: __webpack_require__(5215),
22644
- footnote: __webpack_require__(8574),
22645
22631
  definition: __webpack_require__(856),
22646
22632
  table: __webpack_require__(8029),
22647
22633
  paragraph: __webpack_require__(2431)
@@ -22651,6 +22637,7 @@ proto.inlineTokenizers = {
22651
22637
  escape: __webpack_require__(4833),
22652
22638
  autoLink: __webpack_require__(6507),
22653
22639
  url: __webpack_require__(5044),
22640
+ email: __webpack_require__(1834),
22654
22641
  html: __webpack_require__(3943),
22655
22642
  link: __webpack_require__(8685),
22656
22643
  reference: __webpack_require__(7551),
@@ -22879,6 +22866,57 @@ function autoLink(eat, value, silent) {
22879
22866
  }
22880
22867
 
22881
22868
 
22869
+ /***/ }),
22870
+
22871
+ /***/ 8086:
22872
+ /***/ ((module) => {
22873
+
22874
+ "use strict";
22875
+
22876
+
22877
+ // A line containing no characters, or a line containing only spaces (U+0020) or
22878
+ // tabs (U+0009), is called a blank line.
22879
+ // See <https://spec.commonmark.org/0.29/#blank-line>.
22880
+ var reBlankLine = /^[ \t]*(\n|$)/
22881
+
22882
+ // Note that though blank lines play a special role in lists to determine
22883
+ // whether the list is tight or loose
22884
+ // (<https://spec.commonmark.org/0.29/#blank-lines>), it’s done by the list
22885
+ // tokenizer and this blank line tokenizer does not have to be responsible for
22886
+ // that.
22887
+ // Therefore, configs such as `blankLine.notInList` do not have to be set here.
22888
+ module.exports = blankLine
22889
+
22890
+ function blankLine(eat, value, silent) {
22891
+ var match
22892
+ var subvalue = ''
22893
+ var index = 0
22894
+ var length = value.length
22895
+
22896
+ while (index < length) {
22897
+ match = reBlankLine.exec(value.slice(index))
22898
+
22899
+ if (match == null) {
22900
+ break
22901
+ }
22902
+
22903
+ index += match[0].length
22904
+ subvalue += match[0]
22905
+ }
22906
+
22907
+ if (subvalue === '') {
22908
+ return
22909
+ }
22910
+
22911
+ /* istanbul ignore if - never used (yet) */
22912
+ if (silent) {
22913
+ return true
22914
+ }
22915
+
22916
+ eat(subvalue)
22917
+ }
22918
+
22919
+
22882
22920
  /***/ }),
22883
22921
 
22884
22922
  /***/ 1153:
@@ -23894,6 +23932,128 @@ function strikethrough(eat, value, silent) {
23894
23932
  }
23895
23933
 
23896
23934
 
23935
+ /***/ }),
23936
+
23937
+ /***/ 1834:
23938
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
23939
+
23940
+ "use strict";
23941
+
23942
+
23943
+ var decode = __webpack_require__(7574)
23944
+ var decimal = __webpack_require__(6195)
23945
+ var alphabetical = __webpack_require__(6260)
23946
+ var locate = __webpack_require__(858)
23947
+
23948
+ module.exports = email
23949
+ email.locator = locate
23950
+ email.notInLink = true
23951
+
23952
+ var plusSign = 43 // '+'
23953
+ var dash = 45 // '-'
23954
+ var dot = 46 // '.'
23955
+ var atSign = 64 // '@'
23956
+ var underscore = 95 // '_'
23957
+
23958
+ function email(eat, value, silent) {
23959
+ var self = this
23960
+ var gfm = self.options.gfm
23961
+ var tokenizers = self.inlineTokenizers
23962
+ var index = 0
23963
+ var length = value.length
23964
+ var firstDot = -1
23965
+ var code
23966
+ var content
23967
+ var children
23968
+ var exit
23969
+
23970
+ if (!gfm) {
23971
+ return
23972
+ }
23973
+
23974
+ code = value.charCodeAt(index)
23975
+
23976
+ while (
23977
+ decimal(code) ||
23978
+ alphabetical(code) ||
23979
+ code === plusSign ||
23980
+ code === dash ||
23981
+ code === dot ||
23982
+ code === underscore
23983
+ ) {
23984
+ code = value.charCodeAt(++index)
23985
+ }
23986
+
23987
+ if (index === 0) {
23988
+ return
23989
+ }
23990
+
23991
+ if (code !== atSign) {
23992
+ return
23993
+ }
23994
+
23995
+ index++
23996
+
23997
+ while (index < length) {
23998
+ code = value.charCodeAt(index)
23999
+
24000
+ if (
24001
+ decimal(code) ||
24002
+ alphabetical(code) ||
24003
+ code === dash ||
24004
+ code === dot ||
24005
+ code === underscore
24006
+ ) {
24007
+ index++
24008
+
24009
+ if (firstDot === -1 && code === dot) {
24010
+ firstDot = index
24011
+ }
24012
+
24013
+ continue
24014
+ }
24015
+
24016
+ break
24017
+ }
24018
+
24019
+ if (
24020
+ firstDot === -1 ||
24021
+ firstDot === index ||
24022
+ code === dash ||
24023
+ code === underscore
24024
+ ) {
24025
+ return
24026
+ }
24027
+
24028
+ if (code === dot) {
24029
+ index--
24030
+ }
24031
+
24032
+ content = value.slice(0, index)
24033
+
24034
+ /* istanbul ignore if - never used (yet) */
24035
+ if (silent) {
24036
+ return true
24037
+ }
24038
+
24039
+ exit = self.enterLink()
24040
+
24041
+ // Temporarily remove all tokenizers except text in url.
24042
+ self.inlineTokenizers = {text: tokenizers.text}
24043
+ children = self.tokenizeInline(content, eat.now())
24044
+ self.inlineTokenizers = tokenizers
24045
+
24046
+ exit()
24047
+
24048
+ return eat(content)({
24049
+ type: 'link',
24050
+ title: null,
24051
+ url: 'mailto:' + decode(content, {nonTerminated: false}),
24052
+ children: children
24053
+ })
24054
+ }
24055
+
24056
+
23897
24057
  /***/ }),
23898
24058
 
23899
24059
  /***/ 8210:
@@ -23924,7 +24084,7 @@ function emphasis(eat, value, silent) {
23924
24084
  var queue
23925
24085
  var subvalue
23926
24086
  var length
23927
- var prev
24087
+ var previous
23928
24088
 
23929
24089
  if (character !== asterisk && character !== underscore) {
23930
24090
  return
@@ -23943,14 +24103,14 @@ function emphasis(eat, value, silent) {
23943
24103
  }
23944
24104
 
23945
24105
  while (index < length) {
23946
- prev = character
24106
+ previous = character
23947
24107
  character = value.charAt(index)
23948
24108
 
23949
- if (character === marker && (!pedantic || !whitespace(prev))) {
24109
+ if (character === marker && (!pedantic || !whitespace(previous))) {
23950
24110
  character = value.charAt(++index)
23951
24111
 
23952
24112
  if (character !== marker) {
23953
- if (!trim(queue) || prev === marker) {
24113
+ if (!trim(queue) || previous === marker) {
23954
24114
  return
23955
24115
  }
23956
24116
 
@@ -24030,200 +24190,6 @@ function escape(eat, value, silent) {
24030
24190
  }
24031
24191
 
24032
24192
 
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
24193
  /***/ }),
24228
24194
 
24229
24195
  /***/ 2867:
@@ -24503,7 +24469,7 @@ var instructionCloseExpression = /\?>/
24503
24469
  var directiveOpenExpression = /^<![A-Za-z]/
24504
24470
  var directiveCloseExpression = />/
24505
24471
  var cdataOpenExpression = /^<!\[CDATA\[/
24506
- var cdataCloseExpression = /\]\]>/
24472
+ var cdataCloseExpression = /]]>/
24507
24473
  var elementCloseExpression = /^$/
24508
24474
  var otherElementOpenExpression = new RegExp(openCloseTag.source + '\\s*$')
24509
24475
 
@@ -24777,20 +24743,6 @@ function link(eat, value, silent) {
24777
24743
  if (depth) {
24778
24744
  depth--
24779
24745
  } 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
24746
  if (value.charAt(index + 1) !== leftParenthesis) {
24795
24747
  return
24796
24748
  }
@@ -25082,7 +25034,7 @@ var lowercaseX = 'x'
25082
25034
 
25083
25035
  var tabSize = 4
25084
25036
  var looseListItemExpression = /\n\n(?!\s*$)/
25085
- var taskItemExpression = /^\[([ \t]|x|X)][ \t]/
25037
+ var taskItemExpression = /^\[([ X\tx])][ \t]/
25086
25038
  var bulletExpression = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/
25087
25039
  var pedanticBulletExpression = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/
25088
25040
  var initialIndentExpression = /^( {1,4}|\t)?/gm
@@ -25096,7 +25048,7 @@ function list(eat, value, silent) {
25096
25048
  var index = 0
25097
25049
  var length = value.length
25098
25050
  var start = null
25099
- var size = 0
25051
+ var size
25100
25052
  var queue
25101
25053
  var ordered
25102
25054
  var character
@@ -25107,7 +25059,7 @@ function list(eat, value, silent) {
25107
25059
  var currentMarker
25108
25060
  var content
25109
25061
  var line
25110
- var prevEmpty
25062
+ var previousEmpty
25111
25063
  var empty
25112
25064
  var items
25113
25065
  var allLines
@@ -25124,21 +25076,13 @@ function list(eat, value, silent) {
25124
25076
  while (index < length) {
25125
25077
  character = value.charAt(index)
25126
25078
 
25127
- if (character === tab) {
25128
- size += tabSize - (size % tabSize)
25129
- } else if (character === space) {
25130
- size++
25131
- } else {
25079
+ if (character !== tab && character !== space) {
25132
25080
  break
25133
25081
  }
25134
25082
 
25135
25083
  index++
25136
25084
  }
25137
25085
 
25138
- if (size >= tabSize) {
25139
- return
25140
- }
25141
-
25142
25086
  character = value.charAt(index)
25143
25087
 
25144
25088
  if (character === asterisk || character === plusSign || character === dash) {
@@ -25168,6 +25112,14 @@ function list(eat, value, silent) {
25168
25112
  return
25169
25113
  }
25170
25114
 
25115
+ /* Slightly abusing `silent` mode, whose goal is to make interrupting
25116
+ * paragraphs work.
25117
+ * Well, that’s exactly what we want to do here: don’t interrupt:
25118
+ * 2. here, because the “list” doesn’t start with `1`. */
25119
+ if (silent && queue !== '1') {
25120
+ return
25121
+ }
25122
+
25171
25123
  start = parseInt(queue, 10)
25172
25124
  marker = character
25173
25125
  }
@@ -25201,7 +25153,6 @@ function list(eat, value, silent) {
25201
25153
  nextIndex = length
25202
25154
  }
25203
25155
 
25204
- end = index + tabSize
25205
25156
  size = 0
25206
25157
 
25207
25158
  while (index < length) {
@@ -25218,10 +25169,6 @@ function list(eat, value, silent) {
25218
25169
  index++
25219
25170
  }
25220
25171
 
25221
- if (size >= tabSize) {
25222
- indented = true
25223
- }
25224
-
25225
25172
  if (item && size >= item.indent) {
25226
25173
  indented = true
25227
25174
  }
@@ -25322,7 +25269,7 @@ function list(eat, value, silent) {
25322
25269
  }
25323
25270
  }
25324
25271
 
25325
- prevEmpty = empty
25272
+ previousEmpty = empty
25326
25273
  empty = !prefixed && !trim(content).length
25327
25274
 
25328
25275
  if (indented && item) {
@@ -25346,13 +25293,13 @@ function list(eat, value, silent) {
25346
25293
  allLines = allLines.concat(emptyLines, line)
25347
25294
  emptyLines = []
25348
25295
  } else if (empty) {
25349
- if (prevEmpty && !commonmark) {
25296
+ if (previousEmpty && !commonmark) {
25350
25297
  break
25351
25298
  }
25352
25299
 
25353
25300
  emptyLines.push(line)
25354
25301
  } else {
25355
- if (prevEmpty) {
25302
+ if (previousEmpty) {
25356
25303
  break
25357
25304
  }
25358
25305
 
@@ -25511,62 +25458,6 @@ function normalListItem(ctx, value, position) {
25511
25458
  }
25512
25459
 
25513
25460
 
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
25461
  /***/ }),
25571
25462
 
25572
25463
  /***/ 2431:
@@ -25576,7 +25467,6 @@ function newline(eat, value, silent) {
25576
25467
 
25577
25468
 
25578
25469
  var trim = __webpack_require__(3059)
25579
- var decimal = __webpack_require__(6195)
25580
25470
  var trimTrailingLines = __webpack_require__(7257)
25581
25471
  var interrupt = __webpack_require__(6588)
25582
25472
 
@@ -25593,7 +25483,6 @@ function paragraph(eat, value, silent) {
25593
25483
  var self = this
25594
25484
  var settings = self.options
25595
25485
  var commonmark = settings.commonmark
25596
- var gfm = settings.gfm
25597
25486
  var tokenizers = self.blockTokenizers
25598
25487
  var interruptors = self.interruptParagraph
25599
25488
  var index = value.indexOf(lineFeed)
@@ -25649,17 +25538,6 @@ function paragraph(eat, value, silent) {
25649
25538
  break
25650
25539
  }
25651
25540
 
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
25541
  position = index
25664
25542
  index = value.indexOf(lineFeed, index + 1)
25665
25543
 
@@ -25671,12 +25549,6 @@ function paragraph(eat, value, silent) {
25671
25549
 
25672
25550
  subvalue = value.slice(0, index)
25673
25551
 
25674
- if (trim(subvalue) === '') {
25675
- eat(subvalue)
25676
-
25677
- return null
25678
- }
25679
-
25680
25552
  /* istanbul ignore if - never used (yet) */
25681
25553
  if (silent) {
25682
25554
  return true
@@ -25709,21 +25581,17 @@ reference.locator = locate
25709
25581
 
25710
25582
  var link = 'link'
25711
25583
  var image = 'image'
25712
- var footnote = 'footnote'
25713
25584
  var shortcut = 'shortcut'
25714
25585
  var collapsed = 'collapsed'
25715
25586
  var full = 'full'
25716
- var space = ' '
25717
25587
  var exclamationMark = '!'
25718
25588
  var leftSquareBracket = '['
25719
25589
  var backslash = '\\'
25720
25590
  var rightSquareBracket = ']'
25721
- var caret = '^'
25722
25591
 
25723
25592
  function reference(eat, value, silent) {
25724
25593
  var self = this
25725
25594
  var commonmark = self.options.commonmark
25726
- var footnotes = self.options.footnotes
25727
25595
  var character = value.charAt(0)
25728
25596
  var index = 0
25729
25597
  var length = value.length
@@ -25755,19 +25623,6 @@ function reference(eat, value, silent) {
25755
25623
  intro += character
25756
25624
  queue = ''
25757
25625
 
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
25626
  // Eat the text.
25772
25627
  depth = 0
25773
25628
 
@@ -25824,13 +25679,7 @@ function reference(eat, value, silent) {
25824
25679
 
25825
25680
  character = value.charAt(index)
25826
25681
 
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
- ) {
25682
+ if (character === leftSquareBracket) {
25834
25683
  identifier = ''
25835
25684
  queue += character
25836
25685
  index++
@@ -25887,13 +25736,6 @@ function reference(eat, value, silent) {
25887
25736
  return true
25888
25737
  }
25889
25738
 
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
25739
  now = eat.now()
25898
25740
  now.column += intro.length
25899
25741
  now.offset += intro.length
@@ -25902,18 +25744,15 @@ function reference(eat, value, silent) {
25902
25744
  node = {
25903
25745
  type: type + 'Reference',
25904
25746
  identifier: normalize(identifier),
25905
- label: identifier
25906
- }
25907
-
25908
- if (type === link || type === image) {
25909
- node.referenceType = referenceType
25747
+ label: identifier,
25748
+ referenceType: referenceType
25910
25749
  }
25911
25750
 
25912
25751
  if (type === link) {
25913
25752
  exit = self.enterLink()
25914
25753
  node.children = self.tokenizeInline(content, now)
25915
25754
  exit()
25916
- } else if (type === image) {
25755
+ } else {
25917
25756
  node.alt = self.decode.raw(self.unescape(content), now) || null
25918
25757
  }
25919
25758
 
@@ -25950,7 +25789,7 @@ function strong(eat, value, silent) {
25950
25789
  var queue
25951
25790
  var subvalue
25952
25791
  var length
25953
- var prev
25792
+ var previous
25954
25793
 
25955
25794
  if (
25956
25795
  (character !== asterisk && character !== underscore) ||
@@ -25972,13 +25811,13 @@ function strong(eat, value, silent) {
25972
25811
  }
25973
25812
 
25974
25813
  while (index < length) {
25975
- prev = character
25814
+ previous = character
25976
25815
  character = value.charAt(index)
25977
25816
 
25978
25817
  if (
25979
25818
  character === marker &&
25980
25819
  value.charAt(index + 1) === marker &&
25981
- (!pedantic || !whitespace(prev))
25820
+ (!pedantic || !whitespace(previous))
25982
25821
  ) {
25983
25822
  character = value.charAt(index + 2)
25984
25823
 
@@ -26205,7 +26044,7 @@ function table(eat, value, silent) {
26205
26044
 
26206
26045
  if (queue.length > 1) {
26207
26046
  if (character) {
26208
- subvalue += queue.slice(0, queue.length - 1)
26047
+ subvalue += queue.slice(0, -1)
26209
26048
  queue = queue.charAt(queue.length - 1)
26210
26049
  } else {
26211
26050
  subvalue += queue
@@ -26405,7 +26244,10 @@ function thematicBreak(eat, value, silent) {
26405
26244
  "use strict";
26406
26245
 
26407
26246
 
26247
+ var ccount = __webpack_require__(932)
26408
26248
  var decode = __webpack_require__(7574)
26249
+ var decimal = __webpack_require__(6195)
26250
+ var alphabetical = __webpack_require__(6260)
26409
26251
  var whitespace = __webpack_require__(2139)
26410
26252
  var locate = __webpack_require__(1020)
26411
26253
 
@@ -26413,148 +26255,202 @@ module.exports = url
26413
26255
  url.locator = locate
26414
26256
  url.notInLink = true
26415
26257
 
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]
26258
+ var exclamationMark = 33 // '!'
26259
+ var ampersand = 38 // '&'
26260
+ var rightParenthesis = 41 // ')'
26261
+ var asterisk = 42 // '*'
26262
+ var comma = 44 // ','
26263
+ var dash = 45 // '-'
26264
+ var dot = 46 // '.'
26265
+ var colon = 58 // ':'
26266
+ var semicolon = 59 // ';'
26267
+ var questionMark = 63 // '?'
26268
+ var lessThan = 60 // '<'
26269
+ var underscore = 95 // '_'
26270
+ var tilde = 126 // '~'
26434
26271
 
26435
- var protocolsLength = protocols.length
26272
+ var leftParenthesisCharacter = '('
26273
+ var rightParenthesisCharacter = ')'
26436
26274
 
26437
26275
  function url(eat, value, silent) {
26438
26276
  var self = this
26439
- var subvalue
26440
- var content
26441
- var character
26277
+ var gfm = self.options.gfm
26278
+ var tokenizers = self.inlineTokenizers
26279
+ var length = value.length
26280
+ var previousDot = -1
26281
+ var protocolless = false
26282
+ var dots
26283
+ var lastTwoPartsStart
26284
+ var start
26442
26285
  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
26286
+ var pathStart
26287
+ var path
26288
+ var code
26289
+ var end
26290
+ var leftCount
26291
+ var rightCount
26292
+ var content
26293
+ var children
26294
+ var url
26451
26295
  var exit
26452
26296
 
26453
- if (!self.options.gfm) {
26297
+ if (!gfm) {
26454
26298
  return
26455
26299
  }
26456
26300
 
26457
- subvalue = ''
26458
- index = -1
26301
+ // `WWW.` doesn’t work.
26302
+ if (value.slice(0, 4) === 'www.') {
26303
+ protocolless = true
26304
+ index = 4
26305
+ } else if (value.slice(0, 7).toLowerCase() === 'http://') {
26306
+ index = 7
26307
+ } else if (value.slice(0, 8).toLowerCase() === 'https://') {
26308
+ index = 8
26309
+ } else {
26310
+ return
26311
+ }
26459
26312
 
26460
- while (++index < protocolsLength) {
26461
- protocol = protocols[index]
26462
- match = value.slice(0, protocol.length)
26313
+ // Act as if the starting boundary is a dot.
26314
+ previousDot = index - 1
26463
26315
 
26464
- if (match.toLowerCase() === protocol) {
26465
- subvalue = match
26466
- break
26316
+ // Parse a valid domain.
26317
+ start = index
26318
+ dots = []
26319
+
26320
+ while (index < length) {
26321
+ code = value.charCodeAt(index)
26322
+
26323
+ if (code === dot) {
26324
+ // Dots may not appear after each other.
26325
+ if (previousDot === index - 1) {
26326
+ break
26327
+ }
26328
+
26329
+ dots.push(index)
26330
+ previousDot = index
26331
+ index++
26332
+ continue
26467
26333
  }
26334
+
26335
+ if (
26336
+ decimal(code) ||
26337
+ alphabetical(code) ||
26338
+ code === dash ||
26339
+ code === underscore
26340
+ ) {
26341
+ index++
26342
+ continue
26343
+ }
26344
+
26345
+ break
26468
26346
  }
26469
26347
 
26470
- if (!subvalue) {
26348
+ // Ignore a final dot:
26349
+ if (code === dot) {
26350
+ dots.pop()
26351
+ index--
26352
+ }
26353
+
26354
+ // If there are not dots, exit.
26355
+ if (dots[0] === undefined) {
26471
26356
  return
26472
26357
  }
26473
26358
 
26474
- index = subvalue.length
26475
- length = value.length
26476
- queue = ''
26477
- parenCount = 0
26359
+ // If there is an underscore in the last two domain parts, exit:
26360
+ // `www.example.c_m` and `www.ex_ample.com` are not OK, but
26361
+ // `www.sub_domain.example.com` is.
26362
+ lastTwoPartsStart = dots.length < 2 ? start : dots[dots.length - 2] + 1
26478
26363
 
26364
+ if (value.slice(lastTwoPartsStart, index).indexOf('_') !== -1) {
26365
+ return
26366
+ }
26367
+
26368
+ /* istanbul ignore if - never used (yet) */
26369
+ if (silent) {
26370
+ return true
26371
+ }
26372
+
26373
+ end = index
26374
+ pathStart = index
26375
+
26376
+ // Parse a path.
26479
26377
  while (index < length) {
26480
- character = value.charAt(index)
26378
+ code = value.charCodeAt(index)
26481
26379
 
26482
- if (whitespace(character) || character === lessThan) {
26380
+ if (whitespace(code) || code === lessThan) {
26483
26381
  break
26484
26382
  }
26485
26383
 
26384
+ index++
26385
+
26486
26386
  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
26387
+ code === exclamationMark ||
26388
+ code === asterisk ||
26389
+ code === comma ||
26390
+ code === dot ||
26391
+ code === colon ||
26392
+ code === questionMark ||
26393
+ code === underscore ||
26394
+ code === tilde
26495
26395
  ) {
26496
- nextCharacter = value.charAt(index + 1)
26497
-
26498
- if (!nextCharacter || whitespace(nextCharacter)) {
26499
- break
26500
- }
26396
+ // Empty
26397
+ } else {
26398
+ end = index
26501
26399
  }
26400
+ }
26502
26401
 
26503
- if (character === leftParenthesis || character === leftSquareBracket) {
26504
- parenCount++
26505
- }
26402
+ index = end
26506
26403
 
26507
- if (character === rightParenthesis || character === rightSquareBracket) {
26508
- parenCount--
26404
+ // If the path ends in a closing paren, and the count of closing parens is
26405
+ // higher than the opening count, then remove the supefluous closing parens.
26406
+ if (value.charCodeAt(index - 1) === rightParenthesis) {
26407
+ path = value.slice(pathStart, index)
26408
+ leftCount = ccount(path, leftParenthesisCharacter)
26409
+ rightCount = ccount(path, rightParenthesisCharacter)
26509
26410
 
26510
- if (parenCount < 0) {
26511
- break
26512
- }
26411
+ while (rightCount > leftCount) {
26412
+ index = pathStart + path.lastIndexOf(rightParenthesisCharacter)
26413
+ path = value.slice(pathStart, index)
26414
+ rightCount--
26513
26415
  }
26514
-
26515
- queue += character
26516
- index++
26517
26416
  }
26518
26417
 
26519
- if (!queue) {
26520
- return
26521
- }
26418
+ if (value.charCodeAt(index - 1) === semicolon) {
26419
+ // GitHub doesn’t document this, but final semicolons aren’t paret of the
26420
+ // URL either.
26421
+ index--
26522
26422
 
26523
- subvalue += queue
26524
- content = subvalue
26423
+ // // If the path ends in what looks like an entity, it’s not part of the path.
26424
+ if (alphabetical(value.charCodeAt(index - 1))) {
26425
+ end = index - 2
26525
26426
 
26526
- if (protocol === mailto) {
26527
- position = queue.indexOf(atSign)
26427
+ while (alphabetical(value.charCodeAt(end))) {
26428
+ end--
26429
+ }
26528
26430
 
26529
- if (position === -1 || position === length - 1) {
26530
- return
26431
+ if (value.charCodeAt(end) === ampersand) {
26432
+ index = end
26433
+ }
26531
26434
  }
26532
-
26533
- content = content.slice(mailto.length)
26534
26435
  }
26535
26436
 
26536
- /* istanbul ignore if - never used (yet) */
26537
- if (silent) {
26538
- return true
26437
+ content = value.slice(0, index)
26438
+ url = decode(content, {nonTerminated: false})
26439
+
26440
+ if (protocolless) {
26441
+ url = 'http://' + url
26539
26442
  }
26540
26443
 
26541
26444
  exit = self.enterLink()
26542
26445
 
26543
26446
  // Temporarily remove all tokenizers except text in url.
26544
- tokenizers = self.inlineTokenizers
26545
26447
  self.inlineTokenizers = {text: tokenizers.text}
26546
-
26547
- content = self.tokenizeInline(content, eat.now())
26548
-
26448
+ children = self.tokenizeInline(content, eat.now())
26549
26449
  self.inlineTokenizers = tokenizers
26450
+
26550
26451
  exit()
26551
26452
 
26552
- return eat(subvalue)({
26553
- type: 'link',
26554
- title: null,
26555
- url: decode(subvalue, {nonTerminated: false}),
26556
- children: content
26557
- })
26453
+ return eat(content)({type: 'link', title: null, url: url, children: children})
26558
26454
  }
26559
26455
 
26560
26456
 
@@ -26612,11 +26508,15 @@ function factory(type) {
26612
26508
  name = methods[index]
26613
26509
  method = tokenizers[name]
26614
26510
 
26511
+ // Previously, we had constructs such as footnotes and YAML that used
26512
+ // these properties.
26513
+ // Those are now external (plus there are userland extensions), that may
26514
+ // still use them.
26615
26515
  if (
26616
26516
  method &&
26617
26517
  /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&
26618
- (!method.notInList || !self.inList) &&
26619
- (!method.notInBlock || !self.inBlock) &&
26518
+ /* istanbul ignore next */ (!method.notInList || !self.inList) &&
26519
+ /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&
26620
26520
  (!method.notInLink || !self.inLink)
26621
26521
  ) {
26622
26522
  valueLength = value.length
@@ -26675,7 +26575,7 @@ function factory(type) {
26675
26575
 
26676
26576
  // Done. Called when the last character is eaten to retrieve the range’s
26677
26577
  // offsets.
26678
- return function() {
26578
+ return function () {
26679
26579
  var last = line + 1
26680
26580
 
26681
26581
  while (pos < last) {
@@ -26726,10 +26626,10 @@ function factory(type) {
26726
26626
 
26727
26627
  // Add the position to a node.
26728
26628
  function update(node, indent) {
26729
- var prev = node.position
26730
- var start = prev ? prev.start : before
26629
+ var previous = node.position
26630
+ var start = previous ? previous.start : before
26731
26631
  var combined = []
26732
- var n = prev && prev.end.line
26632
+ var n = previous && previous.end.line
26733
26633
  var l = before.line
26734
26634
 
26735
26635
  node.position = new Position(start)
@@ -26739,8 +26639,8 @@ function factory(type) {
26739
26639
  // because some information, the indent between `n` and `l` wasn’t
26740
26640
  // tracked. Luckily, that space is (should be?) empty, so we can
26741
26641
  // safely check for it now.
26742
- if (prev && indent && prev.indent) {
26743
- combined = prev.indent
26642
+ if (previous && indent && previous.indent) {
26643
+ combined = previous.indent
26744
26644
 
26745
26645
  if (n < l) {
26746
26646
  while (++n < l) {
@@ -26763,21 +26663,21 @@ function factory(type) {
26763
26663
  // possible.
26764
26664
  function add(node, parent) {
26765
26665
  var children = parent ? parent.children : tokens
26766
- var prev = children[children.length - 1]
26666
+ var previous = children[children.length - 1]
26767
26667
  var fn
26768
26668
 
26769
26669
  if (
26770
- prev &&
26771
- node.type === prev.type &&
26670
+ previous &&
26671
+ node.type === previous.type &&
26772
26672
  (node.type === 'text' || node.type === 'blockquote') &&
26773
- mergeable(prev) &&
26673
+ mergeable(previous) &&
26774
26674
  mergeable(node)
26775
26675
  ) {
26776
26676
  fn = node.type === 'text' ? mergeText : mergeBlockquote
26777
- node = fn.call(self, prev, node)
26677
+ node = fn.call(self, previous, node)
26778
26678
  }
26779
26679
 
26780
- if (node !== prev) {
26680
+ if (node !== previous) {
26781
26681
  children.push(node)
26782
26682
  }
26783
26683
 
@@ -26862,21 +26762,21 @@ function mergeable(node) {
26862
26762
  }
26863
26763
 
26864
26764
  // Merge two text nodes: `node` into `prev`.
26865
- function mergeText(prev, node) {
26866
- prev.value += node.value
26765
+ function mergeText(previous, node) {
26766
+ previous.value += node.value
26867
26767
 
26868
- return prev
26768
+ return previous
26869
26769
  }
26870
26770
 
26871
26771
  // Merge two blockquotes: `node` into `prev`, unless in CommonMark or gfm modes.
26872
- function mergeBlockquote(prev, node) {
26772
+ function mergeBlockquote(previous, node) {
26873
26773
  if (this.options.commonmark || this.options.gfm) {
26874
26774
  return node
26875
26775
  }
26876
26776
 
26877
- prev.children = prev.children.concat(node.children)
26777
+ previous.children = previous.children.concat(node.children)
26878
26778
 
26879
- return prev
26779
+ return previous
26880
26780
  }
26881
26781
 
26882
26782
 
@@ -26898,26 +26798,26 @@ function factory(ctx, key) {
26898
26798
 
26899
26799
  // De-escape a string using the expression at `key` in `ctx`.
26900
26800
  function unescape(value) {
26901
- var prev = 0
26801
+ var previous = 0
26902
26802
  var index = value.indexOf(backslash)
26903
26803
  var escape = ctx[key]
26904
26804
  var queue = []
26905
26805
  var character
26906
26806
 
26907
26807
  while (index !== -1) {
26908
- queue.push(value.slice(prev, index))
26909
- prev = index + 1
26910
- character = value.charAt(prev)
26808
+ queue.push(value.slice(previous, index))
26809
+ previous = index + 1
26810
+ character = value.charAt(previous)
26911
26811
 
26912
26812
  // If the following character is not a valid escape, add the slash.
26913
26813
  if (!character || escape.indexOf(character) === -1) {
26914
26814
  queue.push(backslash)
26915
26815
  }
26916
26816
 
26917
- index = value.indexOf(backslash, prev + 1)
26817
+ index = value.indexOf(backslash, previous + 1)
26918
26818
  }
26919
26819
 
26920
- queue.push(value.slice(prev))
26820
+ queue.push(value.slice(previous))
26921
26821
 
26922
26822
  return queue.join('')
26923
26823
  }
@@ -26947,6 +26847,7 @@ function indentation(value) {
26947
26847
  var character = value.charAt(index)
26948
26848
  var stops = {}
26949
26849
  var size
26850
+ var lastIndent = 0
26950
26851
 
26951
26852
  while (character === tab || character === space) {
26952
26853
  size = character === tab ? tabSize : spaceSize
@@ -26957,7 +26858,10 @@ function indentation(value) {
26957
26858
  indent = Math.floor(indent / size) * size
26958
26859
  }
26959
26860
 
26960
- stops[indent] = index
26861
+ while (lastIndent < indent) {
26862
+ stops[++lastIndent] = index
26863
+ }
26864
+
26961
26865
  character = value.charAt(++index)
26962
26866
  }
26963
26867
 
@@ -27017,7 +26921,7 @@ exports._ = new RegExp(
27017
26921
 
27018
26922
  module.exports = interrupt
27019
26923
 
27020
- function interrupt(interruptors, tokenizers, ctx, params) {
26924
+ function interrupt(interruptors, tokenizers, ctx, parameters) {
27021
26925
  var length = interruptors.length
27022
26926
  var index = -1
27023
26927
  var interruptor
@@ -27041,7 +26945,7 @@ function interrupt(interruptors, tokenizers, ctx, params) {
27041
26945
  continue
27042
26946
  }
27043
26947
 
27044
- if (tokenizers[interruptor[0]].apply(ctx, params)) {
26948
+ if (tokenizers[interruptor[0]].apply(ctx, parameters)) {
27045
26949
  return true
27046
26950
  }
27047
26951
  }
@@ -27083,7 +26987,6 @@ var getIndent = __webpack_require__(2299)
27083
26987
 
27084
26988
  module.exports = indentation
27085
26989
 
27086
- var tab = '\t'
27087
26990
  var lineFeed = '\n'
27088
26991
  var space = ' '
27089
26992
  var exclamationMark = '!'
@@ -27098,7 +27001,6 @@ function indentation(value, maximum) {
27098
27001
  var index
27099
27002
  var indentation
27100
27003
  var stops
27101
- var padding
27102
27004
 
27103
27005
  values.unshift(repeat(space, maximum) + exclamationMark)
27104
27006
 
@@ -27133,18 +27035,7 @@ function indentation(value, maximum) {
27133
27035
  index--
27134
27036
  }
27135
27037
 
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)
27038
+ values[position] = values[position].slice(stops[index] + 1)
27148
27039
  }
27149
27040
  }
27150
27041
 
@@ -27209,8 +27100,8 @@ function bridge(destination, options) {
27209
27100
  function transformer(node, file, next) {
27210
27101
  destination.run(mdast2hast(node, options), file, done)
27211
27102
 
27212
- function done(err) {
27213
- next(err)
27103
+ function done(error) {
27104
+ next(error)
27214
27105
  }
27215
27106
  }
27216
27107
  }
@@ -28513,7 +28404,7 @@ function enter(compiler, node) {
28513
28404
  "use strict";
28514
28405
 
28515
28406
 
28516
- var decode = __webpack_require__(4595)
28407
+ var decode = __webpack_require__(7574)
28517
28408
 
28518
28409
  module.exports = length
28519
28410
 
@@ -29522,486 +29413,6 @@ function thematic() {
29522
29413
  }
29523
29414
 
29524
29415
 
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
29416
  /***/ }),
30006
29417
 
30007
29418
  /***/ 7089:
@@ -30562,24 +29973,6 @@ module.exports = function () {
30562
29973
  };
30563
29974
 
30564
29975
 
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
29976
  /***/ }),
30584
29977
 
30585
29978
  /***/ 7257:
@@ -30849,11 +30242,12 @@ function unherit(Super) {
30849
30242
  "use strict";
30850
30243
 
30851
30244
 
30852
- var extend = __webpack_require__(4470)
30853
30245
  var bail = __webpack_require__(8841)
30854
- var vfile = __webpack_require__(939)
30855
- var trough = __webpack_require__(8281)
30246
+ var buffer = __webpack_require__(8738)
30247
+ var extend = __webpack_require__(4470)
30856
30248
  var plain = __webpack_require__(8980)
30249
+ var trough = __webpack_require__(8281)
30250
+ var vfile = __webpack_require__(939)
30857
30251
 
30858
30252
  // Expose a frozen processor.
30859
30253
  module.exports = unified().freeze()
@@ -30874,9 +30268,9 @@ function pipelineParse(p, ctx) {
30874
30268
  function pipelineRun(p, ctx, next) {
30875
30269
  p.run(ctx.tree, ctx.file, done)
30876
30270
 
30877
- function done(err, tree, file) {
30878
- if (err) {
30879
- next(err)
30271
+ function done(error, tree, file) {
30272
+ if (error) {
30273
+ next(error)
30880
30274
  } else {
30881
30275
  ctx.tree = tree
30882
30276
  ctx.file = file
@@ -30886,7 +30280,19 @@ function pipelineRun(p, ctx, next) {
30886
30280
  }
30887
30281
 
30888
30282
  function pipelineStringify(p, ctx) {
30889
- ctx.file.contents = p.stringify(ctx.tree, ctx.file)
30283
+ var result = p.stringify(ctx.tree, ctx.file)
30284
+
30285
+ if (result === undefined || result === null) {
30286
+ // Empty.
30287
+ } else if (typeof result === 'string' || buffer(result)) {
30288
+ if ('value' in ctx.file) {
30289
+ ctx.file.value = result
30290
+ }
30291
+
30292
+ ctx.file.contents = result
30293
+ } else {
30294
+ ctx.file.result = result
30295
+ }
30890
30296
  }
30891
30297
 
30892
30298
  // Function to create the first processor.
@@ -30894,8 +30300,8 @@ function unified() {
30894
30300
  var attachers = []
30895
30301
  var transformers = trough()
30896
30302
  var namespace = {}
30897
- var frozen = false
30898
30303
  var freezeIndex = -1
30304
+ var frozen
30899
30305
 
30900
30306
  // Data management.
30901
30307
  processor.data = data
@@ -30921,10 +30327,9 @@ function unified() {
30921
30327
  // Create a new processor based on the processor in the current scope.
30922
30328
  function processor() {
30923
30329
  var destination = unified()
30924
- var length = attachers.length
30925
30330
  var index = -1
30926
30331
 
30927
- while (++index < length) {
30332
+ while (++index < attachers.length) {
30928
30333
  destination.use.apply(null, attachers[index])
30929
30334
  }
30930
30335
 
@@ -30942,8 +30347,6 @@ function unified() {
30942
30347
  // In essence, always invoke this when exporting a processor.
30943
30348
  function freeze() {
30944
30349
  var values
30945
- var plugin
30946
- var options
30947
30350
  var transformer
30948
30351
 
30949
30352
  if (frozen) {
@@ -30952,19 +30355,16 @@ function unified() {
30952
30355
 
30953
30356
  while (++freezeIndex < attachers.length) {
30954
30357
  values = attachers[freezeIndex]
30955
- plugin = values[0]
30956
- options = values[1]
30957
- transformer = null
30958
30358
 
30959
- if (options === false) {
30359
+ if (values[1] === false) {
30960
30360
  continue
30961
30361
  }
30962
30362
 
30963
- if (options === true) {
30363
+ if (values[1] === true) {
30964
30364
  values[1] = undefined
30965
30365
  }
30966
30366
 
30967
- transformer = plugin.apply(processor, values.slice(1))
30367
+ transformer = values[0].apply(processor, values.slice(1))
30968
30368
 
30969
30369
  if (typeof transformer === 'function') {
30970
30370
  transformers.use(transformer)
@@ -30984,9 +30384,7 @@ function unified() {
30984
30384
  // Set `key`.
30985
30385
  if (arguments.length === 2) {
30986
30386
  assertUnfrozen('data', frozen)
30987
-
30988
30387
  namespace[key] = value
30989
-
30990
30388
  return processor
30991
30389
  }
30992
30390
 
@@ -31060,16 +30458,12 @@ function unified() {
31060
30458
  }
31061
30459
 
31062
30460
  function addList(plugins) {
31063
- var length
31064
- var index
30461
+ var index = -1
31065
30462
 
31066
30463
  if (plugins === null || plugins === undefined) {
31067
30464
  // Empty.
31068
30465
  } else if (typeof plugins === 'object' && 'length' in plugins) {
31069
- length = plugins.length
31070
- index = -1
31071
-
31072
- while (++index < length) {
30466
+ while (++index < plugins.length) {
31073
30467
  add(plugins[index])
31074
30468
  }
31075
30469
  } else {
@@ -31082,7 +30476,7 @@ function unified() {
31082
30476
 
31083
30477
  if (entry) {
31084
30478
  if (plain(entry[1]) && plain(value)) {
31085
- value = extend(entry[1], value)
30479
+ value = extend(true, entry[1], value)
31086
30480
  }
31087
30481
 
31088
30482
  entry[1] = value
@@ -31093,15 +30487,11 @@ function unified() {
31093
30487
  }
31094
30488
 
31095
30489
  function find(plugin) {
31096
- var length = attachers.length
31097
30490
  var index = -1
31098
- var entry
31099
30491
 
31100
- while (++index < length) {
31101
- entry = attachers[index]
31102
-
31103
- if (entry[0] === plugin) {
31104
- return entry
30492
+ while (++index < attachers.length) {
30493
+ if (attachers[index][0] === plugin) {
30494
+ return attachers[index]
31105
30495
  }
31106
30496
  }
31107
30497
  }
@@ -31143,10 +30533,10 @@ function unified() {
31143
30533
  function executor(resolve, reject) {
31144
30534
  transformers.run(node, vfile(file), done)
31145
30535
 
31146
- function done(err, tree, file) {
30536
+ function done(error, tree, file) {
31147
30537
  tree = tree || node
31148
- if (err) {
31149
- reject(err)
30538
+ if (error) {
30539
+ reject(error)
31150
30540
  } else if (resolve) {
31151
30541
  resolve(tree)
31152
30542
  } else {
@@ -31159,8 +30549,8 @@ function unified() {
31159
30549
  // Run transforms on a unist node representation of a file (in string or
31160
30550
  // vfile representation), sync.
31161
30551
  function runSync(node, file) {
31162
- var complete = false
31163
30552
  var result
30553
+ var complete
31164
30554
 
31165
30555
  run(node, file, done)
31166
30556
 
@@ -31168,10 +30558,10 @@ function unified() {
31168
30558
 
31169
30559
  return result
31170
30560
 
31171
- function done(err, tree) {
30561
+ function done(error, tree) {
31172
30562
  complete = true
31173
- bail(err)
31174
30563
  result = tree
30564
+ bail(error)
31175
30565
  }
31176
30566
  }
31177
30567
 
@@ -31213,9 +30603,9 @@ function unified() {
31213
30603
 
31214
30604
  pipeline.run(processor, {file: file}, done)
31215
30605
 
31216
- function done(err) {
31217
- if (err) {
31218
- reject(err)
30606
+ function done(error) {
30607
+ if (error) {
30608
+ reject(error)
31219
30609
  } else if (resolve) {
31220
30610
  resolve(file)
31221
30611
  } else {
@@ -31227,8 +30617,8 @@ function unified() {
31227
30617
 
31228
30618
  // Process the given document (in string or vfile representation), sync.
31229
30619
  function processSync(doc) {
31230
- var complete = false
31231
30620
  var file
30621
+ var complete
31232
30622
 
31233
30623
  freeze()
31234
30624
  assertParser('processSync', processor.Parser)
@@ -31241,9 +30631,9 @@ function unified() {
31241
30631
 
31242
30632
  return file
31243
30633
 
31244
- function done(err) {
30634
+ function done(error) {
31245
30635
  complete = true
31246
- bail(err)
30636
+ bail(error)
31247
30637
  }
31248
30638
  }
31249
30639
  }
@@ -31385,15 +30775,16 @@ function flatMap(ast, fn) {
31385
30775
  module.exports = generated
31386
30776
 
31387
30777
  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 : {}
30778
+ return (
30779
+ !node ||
30780
+ !node.position ||
30781
+ !node.position.start ||
30782
+ !node.position.start.line ||
30783
+ !node.position.start.column ||
30784
+ !node.position.end ||
30785
+ !node.position.end.line ||
30786
+ !node.position.end.column
30787
+ )
31397
30788
  }
31398
30789
 
31399
30790
 
@@ -31555,6 +30946,203 @@ function soft(node) {
31555
30946
  }
31556
30947
 
31557
30948
 
30949
+ /***/ }),
30950
+
30951
+ /***/ 7627:
30952
+ /***/ ((module) => {
30953
+
30954
+ "use strict";
30955
+
30956
+
30957
+ module.exports = convert
30958
+
30959
+ function convert(test) {
30960
+ if (test == null) {
30961
+ return ok
30962
+ }
30963
+
30964
+ if (typeof test === 'string') {
30965
+ return typeFactory(test)
30966
+ }
30967
+
30968
+ if (typeof test === 'object') {
30969
+ return 'length' in test ? anyFactory(test) : allFactory(test)
30970
+ }
30971
+
30972
+ if (typeof test === 'function') {
30973
+ return test
30974
+ }
30975
+
30976
+ throw new Error('Expected function, string, or object as test')
30977
+ }
30978
+
30979
+ // Utility assert each property in `test` is represented in `node`, and each
30980
+ // values are strictly equal.
30981
+ function allFactory(test) {
30982
+ return all
30983
+
30984
+ function all(node) {
30985
+ var key
30986
+
30987
+ for (key in test) {
30988
+ if (node[key] !== test[key]) return false
30989
+ }
30990
+
30991
+ return true
30992
+ }
30993
+ }
30994
+
30995
+ function anyFactory(tests) {
30996
+ var checks = []
30997
+ var index = -1
30998
+
30999
+ while (++index < tests.length) {
31000
+ checks[index] = convert(tests[index])
31001
+ }
31002
+
31003
+ return any
31004
+
31005
+ function any() {
31006
+ var index = -1
31007
+
31008
+ while (++index < checks.length) {
31009
+ if (checks[index].apply(this, arguments)) {
31010
+ return true
31011
+ }
31012
+ }
31013
+
31014
+ return false
31015
+ }
31016
+ }
31017
+
31018
+ // Utility to convert a string into a function which checks a given node’s type
31019
+ // for said string.
31020
+ function typeFactory(test) {
31021
+ return type
31022
+
31023
+ function type(node) {
31024
+ return Boolean(node && node.type === test)
31025
+ }
31026
+ }
31027
+
31028
+ // Utility to return true.
31029
+ function ok() {
31030
+ return true
31031
+ }
31032
+
31033
+
31034
+ /***/ }),
31035
+
31036
+ /***/ 3351:
31037
+ /***/ ((module) => {
31038
+
31039
+ module.exports = color
31040
+ function color(d) {
31041
+ return '\u001B[33m' + d + '\u001B[39m'
31042
+ }
31043
+
31044
+
31045
+ /***/ }),
31046
+
31047
+ /***/ 5195:
31048
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
31049
+
31050
+ "use strict";
31051
+
31052
+
31053
+ module.exports = visitParents
31054
+
31055
+ var convert = __webpack_require__(7627)
31056
+ var color = __webpack_require__(3351)
31057
+
31058
+ var CONTINUE = true
31059
+ var SKIP = 'skip'
31060
+ var EXIT = false
31061
+
31062
+ visitParents.CONTINUE = CONTINUE
31063
+ visitParents.SKIP = SKIP
31064
+ visitParents.EXIT = EXIT
31065
+
31066
+ function visitParents(tree, test, visitor, reverse) {
31067
+ var step
31068
+ var is
31069
+
31070
+ if (typeof test === 'function' && typeof visitor !== 'function') {
31071
+ reverse = visitor
31072
+ visitor = test
31073
+ test = null
31074
+ }
31075
+
31076
+ is = convert(test)
31077
+ step = reverse ? -1 : 1
31078
+
31079
+ factory(tree, null, [])()
31080
+
31081
+ function factory(node, index, parents) {
31082
+ var value = typeof node === 'object' && node !== null ? node : {}
31083
+ var name
31084
+
31085
+ if (typeof value.type === 'string') {
31086
+ name =
31087
+ typeof value.tagName === 'string'
31088
+ ? value.tagName
31089
+ : typeof value.name === 'string'
31090
+ ? value.name
31091
+ : undefined
31092
+
31093
+ visit.displayName =
31094
+ 'node (' + color(value.type + (name ? '<' + name + '>' : '')) + ')'
31095
+ }
31096
+
31097
+ return visit
31098
+
31099
+ function visit() {
31100
+ var grandparents = parents.concat(node)
31101
+ var result = []
31102
+ var subresult
31103
+ var offset
31104
+
31105
+ if (!test || is(node, index, parents[parents.length - 1] || null)) {
31106
+ result = toResult(visitor(node, parents))
31107
+
31108
+ if (result[0] === EXIT) {
31109
+ return result
31110
+ }
31111
+ }
31112
+
31113
+ if (node.children && result[0] !== SKIP) {
31114
+ offset = (reverse ? node.children.length : -1) + step
31115
+
31116
+ while (offset > -1 && offset < node.children.length) {
31117
+ subresult = factory(node.children[offset], offset, grandparents)()
31118
+
31119
+ if (subresult[0] === EXIT) {
31120
+ return subresult
31121
+ }
31122
+
31123
+ offset =
31124
+ typeof subresult[1] === 'number' ? subresult[1] : offset + step
31125
+ }
31126
+ }
31127
+
31128
+ return result
31129
+ }
31130
+ }
31131
+ }
31132
+
31133
+ function toResult(value) {
31134
+ if (value !== null && typeof value === 'object' && 'length' in value) {
31135
+ return value
31136
+ }
31137
+
31138
+ if (typeof value === 'number') {
31139
+ return [CONTINUE, value]
31140
+ }
31141
+
31142
+ return [value]
31143
+ }
31144
+
31145
+
31558
31146
  /***/ }),
31559
31147
 
31560
31148
  /***/ 750:
@@ -31565,7 +31153,7 @@ function soft(node) {
31565
31153
 
31566
31154
  module.exports = visit
31567
31155
 
31568
- var visitParents = __webpack_require__(9294)
31156
+ var visitParents = __webpack_require__(5195)
31569
31157
 
31570
31158
  var CONTINUE = visitParents.CONTINUE
31571
31159
  var SKIP = visitParents.SKIP
@@ -31747,74 +31335,54 @@ function toResult(value) {
31747
31335
  module.exports = factory
31748
31336
 
31749
31337
  function factory(file) {
31750
- var contents = indices(String(file))
31338
+ var value = String(file)
31339
+ var indices = []
31340
+ var search = /\r?\n|\r/g
31751
31341
 
31752
- return {
31753
- toPosition: offsetToPositionFactory(contents),
31754
- toOffset: positionToOffsetFactory(contents)
31342
+ while (search.exec(value)) {
31343
+ indices.push(search.lastIndex)
31755
31344
  }
31756
- }
31757
31345
 
31758
- // Factory to get the line and column-based `position` for `offset` in the bound
31759
- // indices.
31760
- function offsetToPositionFactory(indices) {
31761
- return offsetToPosition
31346
+ indices.push(value.length + 1)
31762
31347
 
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
31348
+ return {
31349
+ toPoint: offsetToPoint,
31350
+ toPosition: offsetToPoint,
31351
+ toOffset: pointToOffset
31352
+ }
31767
31353
 
31768
- if (offset < 0) {
31769
- return {}
31770
- }
31354
+ // Get the line and column-based `point` for `offset` in the bound indices.
31355
+ function offsetToPoint(offset) {
31356
+ var index = -1
31771
31357
 
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
31358
+ if (offset > -1 && offset < indices[indices.length - 1]) {
31359
+ while (++index < indices.length) {
31360
+ if (indices[index] > offset) {
31361
+ return {
31362
+ line: index + 1,
31363
+ column: offset - (indices[index - 1] || 0) + 1,
31364
+ offset: offset
31365
+ }
31778
31366
  }
31779
31367
  }
31780
31368
  }
31781
31369
 
31782
31370
  return {}
31783
31371
  }
31784
- }
31785
31372
 
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
31373
+ // Get the `offset` for a line and column-based `point` in the bound
31792
31374
  // indices.
31793
- function positionToOffset(position) {
31794
- var line = position && position.line
31795
- var column = position && position.column
31375
+ function pointToOffset(point) {
31376
+ var line = point && point.line
31377
+ var column = point && point.column
31378
+ var offset
31796
31379
 
31797
31380
  if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {
31798
- return (indices[line - 2] || 0) + column - 1 || 0
31381
+ offset = (indices[line - 2] || 0) + column - 1 || 0
31799
31382
  }
31800
31383
 
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)
31384
+ return offset > -1 && offset < indices[indices.length - 1] ? offset : -1
31813
31385
  }
31814
-
31815
- result.push(value.length + 1)
31816
-
31817
- return result
31818
31386
  }
31819
31387
 
31820
31388
 
@@ -34779,11 +34347,12 @@ function plain(text) {
34779
34347
  var _setup6 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_setup5, 2);
34780
34348
  text = _setup6[0];
34781
34349
  opts = _setup6[1];
34782
- return htmlProcessor(opts).use(rehypeReact, {
34350
+ var proc = htmlProcessor(opts).use(rehypeReact, {
34783
34351
  createElement: React.createElement,
34784
34352
  Fragment: React.Fragment,
34785
34353
  components: components
34786
- }).processSync(text).contents;
34354
+ });
34355
+ return proc.processSync(text).result;
34787
34356
  }
34788
34357
 
34789
34358
  /**