securemark 0.294.7 → 0.294.9

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/index.js +185 -205
  3. package/markdown.d.ts +13 -36
  4. package/package.json +1 -1
  5. package/src/combinator/control/constraint/block.ts +2 -2
  6. package/src/combinator/control/constraint/line.ts +7 -5
  7. package/src/combinator/control/manipulation/convert.ts +2 -1
  8. package/src/combinator/control/manipulation/fence.ts +4 -4
  9. package/src/combinator/control/manipulation/surround.ts +9 -9
  10. package/src/combinator/data/parser/some.ts +1 -1
  11. package/src/combinator/data/parser/union.ts +6 -2
  12. package/src/parser/api/bind.test.ts +0 -1
  13. package/src/parser/api/normalize.test.ts +5 -8
  14. package/src/parser/api/normalize.ts +4 -2
  15. package/src/parser/autolink.ts +1 -2
  16. package/src/parser/block/blockquote.ts +3 -3
  17. package/src/parser/block/extension/fig.ts +4 -1
  18. package/src/parser/block/heading.ts +12 -2
  19. package/src/parser/block/reply/quote.ts +1 -2
  20. package/src/parser/block/ulist.ts +1 -1
  21. package/src/parser/block.ts +0 -4
  22. package/src/parser/header.ts +28 -40
  23. package/src/parser/inline/annotation.ts +2 -3
  24. package/src/parser/inline/autolink/account.ts +49 -17
  25. package/src/parser/inline/autolink/anchor.test.ts +0 -1
  26. package/src/parser/inline/autolink/anchor.ts +16 -15
  27. package/src/parser/inline/autolink/email.test.ts +1 -1
  28. package/src/parser/inline/autolink/email.ts +10 -11
  29. package/src/parser/inline/autolink/hashnum.ts +17 -13
  30. package/src/parser/inline/autolink/hashtag.ts +19 -15
  31. package/src/parser/inline/autolink/url.ts +24 -19
  32. package/src/parser/inline/autolink.ts +1 -2
  33. package/src/parser/inline/bracket.ts +14 -14
  34. package/src/parser/inline/deletion.ts +2 -1
  35. package/src/parser/inline/emphasis.ts +2 -1
  36. package/src/parser/inline/emstrong.ts +2 -1
  37. package/src/parser/inline/extension/index.ts +4 -4
  38. package/src/parser/inline/extension/indexer.ts +1 -1
  39. package/src/parser/inline/extension/label.ts +1 -1
  40. package/src/parser/inline/extension/placeholder.ts +4 -3
  41. package/src/parser/inline/html.ts +4 -4
  42. package/src/parser/inline/htmlentity.ts +2 -2
  43. package/src/parser/inline/insertion.ts +2 -1
  44. package/src/parser/inline/italic.ts +2 -1
  45. package/src/parser/inline/link.ts +12 -24
  46. package/src/parser/inline/mark.ts +2 -1
  47. package/src/parser/inline/math.ts +4 -2
  48. package/src/parser/inline/media.ts +28 -33
  49. package/src/parser/inline/reference.ts +4 -4
  50. package/src/parser/inline/remark.ts +2 -1
  51. package/src/parser/inline/ruby.ts +3 -4
  52. package/src/parser/inline/strong.ts +2 -1
  53. package/src/parser/inline/template.ts +10 -10
  54. package/src/parser/segment.ts +2 -2
  55. package/src/parser/source/escapable.ts +3 -4
  56. package/src/parser/source/line.ts +3 -1
  57. package/src/parser/source/text.ts +5 -10
  58. package/src/parser/source/unescapable.ts +2 -4
  59. package/src/parser/source.ts +1 -2
  60. package/src/parser/inline/autolink/channel.ts +0 -44
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! securemark v0.294.7 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
1
+ /*! securemark v0.294.9 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory(require("Prism"), require("DOMPurify"));
@@ -2585,7 +2585,7 @@ function block(parser, separation = true) {
2585
2585
  if (position === source.length) return;
2586
2586
  const result = parser(input);
2587
2587
  if (result === undefined) return;
2588
- if (separation && !(0, line_1.isBlank)((0, line_1.firstline)(source, context.position))) return;
2588
+ if (separation && !(0, line_1.isBlankline)(source, context.position)) return;
2589
2589
  return context.position === source.length || source[context.position - 1] === '\n' ? result : undefined;
2590
2590
  });
2591
2591
  }
@@ -2653,7 +2653,7 @@ exports.verify = verify;
2653
2653
  Object.defineProperty(exports, "__esModule", ({
2654
2654
  value: true
2655
2655
  }));
2656
- exports.isBlank = exports.firstline = exports.line = void 0;
2656
+ exports.isBlankline = exports.firstline = exports.line = void 0;
2657
2657
  const parser_1 = __webpack_require__(605);
2658
2658
  function line(parser) {
2659
2659
  return (0, parser_1.failsafe)(({
@@ -2673,7 +2673,7 @@ function line(parser) {
2673
2673
  context.source = source;
2674
2674
  context.offset -= position;
2675
2675
  if (result === undefined) return;
2676
- if (!isBlank(source.slice(context.position, position + line.length))) return;
2676
+ if (context.position < position + line.length && !isBlankline(source, context.position)) return;
2677
2677
  context.position = position + line.length;
2678
2678
  return result;
2679
2679
  });
@@ -2684,10 +2684,12 @@ function firstline(source, position) {
2684
2684
  return i === -1 ? source.slice(position) : source.slice(position, i + 1);
2685
2685
  }
2686
2686
  exports.firstline = firstline;
2687
- function isBlank(line) {
2688
- return line === '' || line === '\n' || line.trimStart() === '';
2687
+ const blankline = /[^\S\n]*(?:$|\n)/y;
2688
+ function isBlankline(source, position) {
2689
+ blankline.lastIndex = position;
2690
+ return source.length === position || source[position] === '\n' || blankline.test(source);
2689
2691
  }
2690
- exports.isBlank = isBlank;
2692
+ exports.isBlankline = isBlankline;
2691
2693
 
2692
2694
  /***/ },
2693
2695
 
@@ -2826,20 +2828,20 @@ function fence(opener, limit, separation = true) {
2826
2828
  context.position += matches[0].length;
2827
2829
  // Prevent annoying parsing in editing.
2828
2830
  const secondline = (0, line_1.firstline)(source, context.position);
2829
- if ((0, line_1.isBlank)(secondline) && (0, line_1.firstline)(source, context.position + secondline.length).trimEnd() !== delim) return;
2831
+ if ((0, line_1.isBlankline)(secondline, 0) && (0, line_1.firstline)(source, context.position + secondline.length).trimEnd() !== delim) return;
2830
2832
  let block = '';
2831
2833
  let closer = '';
2832
2834
  let overflow = '';
2833
2835
  for (let count = 1;; ++count) {
2834
2836
  if (context.position === source.length) break;
2835
2837
  const line = (0, line_1.firstline)(source, context.position);
2836
- if ((closer || count > limit + 1) && (0, line_1.isBlank)(line)) break;
2838
+ if ((closer || count > limit + 1) && (0, line_1.isBlankline)(line, 0)) break;
2837
2839
  if (closer) {
2838
2840
  overflow += line;
2839
2841
  }
2840
2842
  if (!closer && count <= limit + 1 && line.slice(0, delim.length) === delim && line.trimEnd() === delim) {
2841
2843
  closer = line;
2842
- if ((0, line_1.isBlank)((0, line_1.firstline)(source, context.position + line.length))) {
2844
+ if ((0, line_1.isBlankline)(source, context.position + line.length)) {
2843
2845
  context.position += line.length;
2844
2846
  break;
2845
2847
  }
@@ -3086,7 +3088,7 @@ Object.defineProperty(exports, "__esModule", ({
3086
3088
  exports.setBacktrack = exports.isBacktrack = exports.close = exports.open = exports.surround = void 0;
3087
3089
  const parser_1 = __webpack_require__(605);
3088
3090
  const combinator_1 = __webpack_require__(3484);
3089
- function surround(opener, parser, closer, optional = false, f, g, backtracks = []) {
3091
+ function surround(opener, parser, closer, optional = false, backtracks = [], f, g) {
3090
3092
  switch (typeof opener) {
3091
3093
  case 'string':
3092
3094
  case 'object':
@@ -3149,11 +3151,11 @@ function surround(opener, parser, closer, optional = false, f, g, backtracks = [
3149
3151
  }
3150
3152
  exports.surround = surround;
3151
3153
  function open(opener, parser, optional, backtracks) {
3152
- return surround(opener, parser, '', optional, undefined, undefined, backtracks);
3154
+ return surround(opener, parser, '', optional, backtracks);
3153
3155
  }
3154
3156
  exports.open = open;
3155
3157
  function close(parser, closer, optional, backtracks) {
3156
- return surround('', parser, closer, optional, undefined, undefined, backtracks);
3158
+ return surround('', parser, closer, optional, backtracks);
3157
3159
  }
3158
3160
  exports.close = close;
3159
3161
  const statesize = 2;
@@ -3943,7 +3945,7 @@ function some(parser, end, delimiters = [], limit = -1) {
3943
3945
  context.delimiters.push(delims);
3944
3946
  }
3945
3947
  // whileは数倍遅い
3946
- for (; context.position < source.length;) {
3948
+ for (const len = source.length; context.position < len;) {
3947
3949
  if (match(input)) break;
3948
3950
  if (context.delimiters?.match(input)) break;
3949
3951
  const result = parser(input);
@@ -4016,7 +4018,7 @@ function union(parsers) {
4016
4018
  case 1:
4017
4019
  return parsers[0];
4018
4020
  default:
4019
- return eval(['input =>', parsers.map((_, i) => `|| parsers[${i}](input)`).join('').slice(2)].join(''));
4021
+ return eval(['((', parsers.map((_, i) => `parser${i},`).join(''), ') =>', 'input =>', parsers.map((_, i) => `|| parser${i}(input)`).join('').slice(2), ')'].join(''))(...parsers);
4020
4022
  }
4021
4023
  }
4022
4024
  exports.union = union;
@@ -4395,7 +4397,11 @@ exports.normalize = normalize;
4395
4397
  function format(source) {
4396
4398
  return source.replace(/\r\n?/g, '\n');
4397
4399
  }
4398
- const invalid = new RegExp([/(?![\t\r\n])[\x00-\x1F\x7F]/g.source, /(?!\u200D)[\u2006\u200B-\u200F\u202A-\u202F\u2060\uFEFF]|(?<![\u1820\u1821])\u180E/g.source, /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g.source].join('|'), 'g');
4400
+ const invalid = new RegExp([/(?![\t\r\n])[\x00-\x1F\x7F]/g.source, /(?!\u200D)[\u2006\u200B-\u200F\u202A-\u202F\u2060\uFEFF]/g.source
4401
+ // 後読みが重い
4402
+ ///(?<![\u1820\u1821])\u180E/g.source,
4403
+ ///[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g.source,
4404
+ ].join('|'), 'g');
4399
4405
  function sanitize(source) {
4400
4406
  return source.replace(invalid, UNICODE_REPLACEMENT_CHARACTER);
4401
4407
  }
@@ -4508,7 +4514,7 @@ exports.autolink = void 0;
4508
4514
  const combinator_1 = __webpack_require__(3484);
4509
4515
  const autolink_1 = __webpack_require__(8072);
4510
4516
  const source_1 = __webpack_require__(8745);
4511
- exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([autolink_1.autolink, source_1.linebreak, source_1.unescsource])));
4517
+ exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([autolink_1.autolink, source_1.unescsource])));
4512
4518
 
4513
4519
  /***/ },
4514
4520
 
@@ -4560,9 +4566,6 @@ exports.block = (0, combinator_1.reset)({
4560
4566
  if (position === source.length) return;
4561
4567
  const fst = source[position];
4562
4568
  switch (fst) {
4563
- case '\n':
4564
- input.context.position = source.length;
4565
- return new parser_1.List();
4566
4569
  case '=':
4567
4570
  if (source.startsWith('===', position)) return (0, pagebreak_1.pagebreak)(input);
4568
4571
  break;
@@ -4656,9 +4659,10 @@ const opener = /(?=>>+(?:$|[ \n]))/y;
4656
4659
  const indent = (0, combinator_1.block)((0, combinator_1.open)(opener, (0, combinator_1.some)(source_1.contentline, />(?:$|[ \n])/y)), false);
4657
4660
  const unindent = source => source.replace(/(?<=^|\n)>(?: |(?=>*(?:$|[ \n])))|\n$/g, '');
4658
4661
  const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(2 /* Recursion.blockquote */, (0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, source, false, true)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)(autolink_1.autolink, ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('pre', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false, true))]))), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('blockquote', (0, util_1.unwrap)(ns)))])));
4659
- const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(2 /* Recursion.blockquote */, (0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, markdown, false, true)), (0, combinator_1.creation)(10, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, ({
4662
+ const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(2 /* Recursion.blockquote */, (0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, markdown, false, true)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, ({
4660
4663
  context
4661
4664
  }) => {
4665
+ (0, combinator_1.consume)(10, context);
4662
4666
  const {
4663
4667
  source
4664
4668
  } = context;
@@ -4673,7 +4677,7 @@ const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combina
4673
4677
  }, context);
4674
4678
  context.position = source.length;
4675
4679
  return new parser_1.List([new parser_1.Data((0, dom_1.html)('section', [document, (0, dom_1.html)('h2', 'References'), references]))]);
4676
- }, false, true)))]))), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('blockquote', (0, util_1.unwrap)(ns)))])));
4680
+ }, false, true))]))), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('blockquote', (0, util_1.unwrap)(ns)))])));
4677
4681
 
4678
4682
  /***/ },
4679
4683
 
@@ -4923,9 +4927,14 @@ exports.segment = (0, combinator_1.block)((0, combinator_1.sequence)([(0, combin
4923
4927
  exports.fig = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.verify)((0, combinator_1.convert)((source, context) => {
4924
4928
  // Bug: TypeScript
4925
4929
  const fence = (/^[^\n]*\n!?>+ /.test(source) && source.match(/^~{3,}(?=[^\S\n]*$)/mg) || []).reduce((max, fence) => fence > max ? fence : max, '~~') + '~';
4926
- return parser({
4930
+ const {
4931
+ position
4932
+ } = context;
4933
+ const result = parser({
4927
4934
  context
4928
- }) ? `${fence}figure ${source.replace(/^(.+\n.+\n)([\S\s]+?)\n?$/, '$1\n$2')}\n${fence}` : `${fence}figure ${source}\n\n${fence}`;
4935
+ });
4936
+ context.position = position;
4937
+ return result ? `${fence}figure ${source.replace(/^(.+\n.+\n)([\S\s]+?)\n?$/, '$1\n$2')}\n${fence}` : `${fence}figure ${source}\n\n${fence}`;
4929
4938
  }, (0, combinator_1.union)([figure_1.figure]), false), ([{
4930
4939
  value: el
4931
4940
  }]) => el.tagName === 'FIGURE')));
@@ -5420,11 +5429,21 @@ const source_1 = __webpack_require__(8745);
5420
5429
  const visibility_1 = __webpack_require__(6364);
5421
5430
  const util_1 = __webpack_require__(4992);
5422
5431
  const dom_1 = __webpack_require__(394);
5423
- exports.segment = (0, combinator_1.block)((0, combinator_1.focus)(/#+ +\S[^\n]*(?:\n#+(?=$|[ \n])[^\n]*)*(?:$|\n)/y, (0, combinator_1.some)((0, combinator_1.line)(({
5424
- context: {
5432
+ exports.segment = (0, combinator_1.block)((0, combinator_1.focus)(/#+ +\S[^\n]*(?:\n#+(?=$|[ \n])[^\n]*)*(?:$|\n)/y, input => {
5433
+ const {
5434
+ context
5435
+ } = input;
5436
+ const {
5425
5437
  source
5438
+ } = context;
5439
+ const acc = new parser_1.List();
5440
+ for (; context.position < source.length;) {
5441
+ const line = (0, combinator_1.firstline)(source, context.position);
5442
+ acc.push(new parser_1.Data(line));
5443
+ context.position += line.length;
5426
5444
  }
5427
- }) => new parser_1.List([new parser_1.Data(source)])))));
5445
+ return acc;
5446
+ }));
5428
5447
  exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment,
5429
5448
  // その他の表示制御は各所のCSSで行う。
5430
5449
  (0, combinator_1.state)(128 /* State.annotation */ | 64 /* State.reference */ | 32 /* State.index */ | 16 /* State.label */ | 8 /* State.link */, (0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.open)((0, source_1.str)(/##+/y), (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), (0, combinator_1.open)((0, source_1.str)('#'), (0, combinator_1.state)(251 /* State.linkers */, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline]))))), true)]), (nodes, context) => {
@@ -5811,7 +5830,7 @@ exports.quote = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combina
5811
5830
  // TODO: インデント数を渡してインデント数前の行頭確認を行う実装に置き換える
5812
5831
  source => source.replace(/(?<=^>+ )/mg, '\r'), (0, combinator_1.some)((0, combinator_1.union)([
5813
5832
  // quote補助関数が残した数式をパースする。
5814
- math_1.math, autolink_1.autolink, source_1.linebreak, source_1.unescsource])), false)), (ns, {
5833
+ math_1.math, autolink_1.autolink, source_1.unescsource])), false)), (ns, {
5815
5834
  source,
5816
5835
  position
5817
5836
  }) => new parser_1.List([new parser_1.Data(source[position - 1] === '\n' ? ns.pop().value : (0, dom_1.html)('br')), new parser_1.Data((0, dom_1.html)('span', {
@@ -5924,7 +5943,7 @@ const inline_1 = __webpack_require__(7973);
5924
5943
  const visibility_1 = __webpack_require__(6364);
5925
5944
  const util_1 = __webpack_require__(4992);
5926
5945
  const dom_1 = __webpack_require__(394);
5927
- exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/- /y, exports.ulist_)));
5946
+ exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)('- ', exports.ulist_)));
5928
5947
  exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/-(?=$|[ \n])/y, (0, combinator_1.some)((0, combinator_1.recursion)(3 /* Recursion.listitem */, (0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/-(?:$|[ \n])/y, (0, combinator_1.subsequence)([exports.checkbox, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline]))))]), true)), (0, combinator_1.indent)((0, combinator_1.union)([exports.ulist_, olist_1.olist_, ilist_1.ilist_]))]), ilist_1.ilistitem), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('li', {
5929
5948
  'data-index': (0, inline_1.dataindex)(ns)
5930
5949
  }, (0, dom_1.defrag)((0, util_1.unwrap)(fillFirstLine(ns)))))])))])))), ns => new parser_1.List([new parser_1.Data(format((0, dom_1.html)('ul', (0, util_1.unwrap)(ns))))]))));
@@ -5967,24 +5986,11 @@ Object.defineProperty(exports, "__esModule", ({
5967
5986
  exports.header = void 0;
5968
5987
  const parser_1 = __webpack_require__(605);
5969
5988
  const combinator_1 = __webpack_require__(3484);
5970
- const segment_1 = __webpack_require__(3967);
5971
5989
  const source_1 = __webpack_require__(8745);
5972
5990
  const util_1 = __webpack_require__(4992);
5973
5991
  const normalize_1 = __webpack_require__(4490);
5974
5992
  const dom_1 = __webpack_require__(394);
5975
- exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+ *\r?\n(?=\S)/y, (0, combinator_1.inits)([(0, combinator_1.rewrite)(({
5976
- context
5977
- }) => {
5978
- const {
5979
- source
5980
- } = context;
5981
- if (context.header ?? true) {
5982
- context.position += (0, segment_1.segment)(source).next().value.length;
5983
- } else {
5984
- context.position = source.length;
5985
- }
5986
- return new parser_1.List();
5987
- }, (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(({
5993
+ exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+ *\r?\n(?=\S)/y, (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(({
5988
5994
  context
5989
5995
  }) => context.header ?? true, (0, combinator_1.focus)(/(---+) *\r?\n(?:[A-Za-z][0-9A-Za-z]*(?:-[0-9A-Za-z]+)*:[ \t]+\S[^\r\n]*\r?\n){1,100}\1 *(?:$|\r?\n)/y, (0, combinator_1.convert)(source => (0, normalize_1.normalize)(source.slice(source.indexOf('\n') + 1, source.trimEnd().lastIndexOf('\n'))).replace(/(\S)\s+$/mg, '$1'), (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([field])), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('aside', {
5990
5996
  class: 'header'
@@ -6003,7 +6009,7 @@ exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+ *
6003
6009
  translate: 'no',
6004
6010
  ...(0, util_1.invalid)('header', 'syntax', 'Invalid syntax')
6005
6011
  }, (0, normalize_1.normalize)(source.slice(position))))]);
6006
- }]))), (0, combinator_1.clear)((0, source_1.str)(/ *\r?\n/y))])));
6012
+ }])), (0, combinator_1.clear)((0, source_1.str)(/ *\r?\n/y))])));
6007
6013
  const field = (0, combinator_1.line)(({
6008
6014
  context: {
6009
6015
  source,
@@ -6185,9 +6191,9 @@ const inline_1 = __webpack_require__(7973);
6185
6191
  const visibility_1 = __webpack_require__(6364);
6186
6192
  const util_1 = __webpack_require__(4992);
6187
6193
  const dom_1 = __webpack_require__(394);
6188
- exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(128 /* State.annotation */, (0, combinator_1.surround)('((', (0, combinator_1.precedence)(1, (0, combinator_1.state)(128 /* State.annotation */, (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[')', 1]])))), '))', false, ([, ns], context) => context.linebreak === 0 ? new parser_1.List([new parser_1.Data((0, dom_1.html)('sup', {
6194
+ exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(128 /* State.annotation */, (0, combinator_1.surround)('((', (0, combinator_1.precedence)(1, (0, combinator_1.state)(128 /* State.annotation */, (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[')', 1]])))), '))', false, [1 | 64 /* Backtrack.bracket */, 3 | 32 /* Backtrack.doublebracket */], ([, ns], context) => context.linebreak === 0 ? new parser_1.List([new parser_1.Data((0, dom_1.html)('sup', {
6189
6195
  class: 'annotation'
6190
- }, [(0, dom_1.html)('span', (0, dom_1.defrag)((0, util_1.unwrap)((0, visibility_1.trimBlankNodeEnd)(ns))))]))]) : undefined, undefined, [1 | 64 /* Backtrack.bracket */, 3 | 32 /* Backtrack.doublebracket */])));
6196
+ }, [(0, dom_1.html)('span', (0, dom_1.defrag)((0, util_1.unwrap)((0, visibility_1.trimBlankNodeEnd)(ns))))]))]) : undefined)));
6191
6197
 
6192
6198
  /***/ },
6193
6199
 
@@ -6204,7 +6210,6 @@ exports.autolink = void 0;
6204
6210
  const combinator_1 = __webpack_require__(3484);
6205
6211
  const url_1 = __webpack_require__(2129);
6206
6212
  const email_1 = __webpack_require__(5836);
6207
- const channel_1 = __webpack_require__(4639);
6208
6213
  const account_1 = __webpack_require__(4107);
6209
6214
  const hashtag_1 = __webpack_require__(5764);
6210
6215
  const hashnum_1 = __webpack_require__(8684);
@@ -6221,7 +6226,7 @@ exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.state)(~1 /* St
6221
6226
  const fst = source[position];
6222
6227
  switch (fst) {
6223
6228
  case '@':
6224
- return (0, channel_1.channel)(input) || (0, account_1.account)(input);
6229
+ return (0, account_1.account)(input);
6225
6230
  case '#':
6226
6231
  return (0, hashtag_1.hashtag)(input) || (0, hashnum_1.hashnum)(input);
6227
6232
  case '>':
@@ -6264,13 +6269,37 @@ exports.account = void 0;
6264
6269
  const parser_1 = __webpack_require__(605);
6265
6270
  const combinator_1 = __webpack_require__(3484);
6266
6271
  const link_1 = __webpack_require__(3628);
6272
+ const hashtag_1 = __webpack_require__(5764);
6273
+ const source_1 = __webpack_require__(8745);
6267
6274
  const dom_1 = __webpack_require__(394);
6268
6275
  // https://example/@user must be a user page or a redirect page going there.
6269
- exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.surround)(/(?<![0-9a-z])@/yi, /[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?)*\//yi, /[a-z][0-9a-z]*(?:[-.][0-9a-z]+)*(?![-.]?[0-9a-z@#]|>>|:\S)/yi, true, undefined, undefined, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1).replace('/', '/@')}` : `/${source}`} }`, (0, combinator_1.union)([link_1.unsafelink]), false), ([{
6276
+ // https://example/@user?ch=a+b must be a user channel page or a redirect page going there.
6277
+ exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)((0, combinator_1.surround)(/(?<![0-9a-z])@/yi, (0, source_1.str)(/[0-9a-z](?:[.-](?=[0-9a-z])|[0-9a-z]){0,254}\/|/yi), (0, source_1.str)(/[a-z][0-9a-z]*(?:[-.][0-9a-z]+)*(?![-.]?[0-9a-z@]|>>|:\S)/yi), false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.some)((0, combinator_1.surround)('#', (0, combinator_1.verify)((0, source_1.str)(new RegExp([/(?!['_])(?:[^\p{C}\p{S}\p{P}\s]|emoji|'(?=[0-9A-Za-z])|_(?=[^\p{C}\p{S}\p{P}\s]|emoji))+/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu')), ([{
6270
6278
  value
6271
- }]) => new parser_1.List([new parser_1.Data((0, dom_1.define)(value, {
6272
- class: 'account'
6273
- }))]))))));
6279
+ }]) => /^[0-9]{0,4}[^0-9]/.test(value)), new RegExp([/(?![0-9a-z@]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu'), false, [3 | 0 /* Backtrack.autolink */])), '', false, [], ([[{
6280
+ value: host
6281
+ }, {
6282
+ value: account
6283
+ }], nodes], context) => {
6284
+ const hashes = nodes.foldl((acc, {
6285
+ value
6286
+ }) => acc + '#' + value, '');
6287
+ const param = nodes.foldl((acc, {
6288
+ value
6289
+ }) => acc ? acc + '+' + value : value, '');
6290
+ return new parser_1.List([new parser_1.Data((0, dom_1.define)((0, link_1.parse)(new parser_1.List([new parser_1.Data(`@${host}${account}${hashes}`)]), new parser_1.List([new parser_1.Data(host ? `https://${host}@${account}?ch=${param}` : `/@${account}?ch=${param}`)]), context), {
6291
+ class: 'channel'
6292
+ }))]);
6293
+ }, ([[{
6294
+ value: host
6295
+ }, {
6296
+ value: account
6297
+ }]], context) => {
6298
+ if (context.source[context.position] === '#') return;
6299
+ return new parser_1.List([new parser_1.Data((0, dom_1.define)((0, link_1.parse)(new parser_1.List([new parser_1.Data(`@${host}${account}`)]), new parser_1.List([new parser_1.Data(host ? `https://${host}@${account}` : `/@${account}`)]), context), {
6300
+ class: 'account'
6301
+ }))]);
6302
+ }))));
6274
6303
 
6275
6304
  /***/ },
6276
6305
 
@@ -6287,6 +6316,7 @@ exports.anchor = void 0;
6287
6316
  const parser_1 = __webpack_require__(605);
6288
6317
  const combinator_1 = __webpack_require__(3484);
6289
6318
  const link_1 = __webpack_require__(3628);
6319
+ const source_1 = __webpack_require__(8745);
6290
6320
  const dom_1 = __webpack_require__(394);
6291
6321
  // Timeline(pseudonym): user/tid
6292
6322
  // Thread(anonymous): cid
@@ -6295,47 +6325,11 @@ const dom_1 = __webpack_require__(394);
6295
6325
  // cid: YYYY-MMDD-HHMM-SSmmm
6296
6326
  // 内部表現はUnixTimeに統一する(時系列順)
6297
6327
  // 外部表現は投稿ごとに投稿者の投稿時のタイムゾーンに統一する(非時系列順)
6298
- exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9a-z])>>/yi, /(?:[a-z][0-9a-z]*(?:-[0-9a-z]+)*\/)?[0-9a-z]+(?:-[0-9a-z]+)*(?!-?[0-9a-z@#]|>>|:\S)/yi, false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `/@${source.slice(2).replace('/', '/timeline?at=')}` : `?at=${source.slice(2)}`} }`, (0, combinator_1.union)([link_1.unsafelink]), false), ([{
6328
+ exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)(/(?<![0-9a-z])>>/yi, (0, source_1.str)(/[0-9a-z]+(?:-[0-9a-z]+)*(?!-?[0-9a-z@#]|>>|:\S)/yi), '', false, [3 | 0 /* Backtrack.autolink */], ([, [{
6299
6329
  value
6300
- }]) => new parser_1.List([new parser_1.Data((0, dom_1.define)(value, {
6330
+ }]], context) => new parser_1.List([new parser_1.Data((0, dom_1.define)((0, link_1.parse)(new parser_1.List([new parser_1.Data(`>>${value}`)]), new parser_1.List([new parser_1.Data(`?at=${value}`)]), context), {
6301
6331
  class: 'anchor'
6302
- }))]))))));
6303
-
6304
- /***/ },
6305
-
6306
- /***/ 4639
6307
- (__unused_webpack_module, exports, __webpack_require__) {
6308
-
6309
- "use strict";
6310
-
6311
-
6312
- Object.defineProperty(exports, "__esModule", ({
6313
- value: true
6314
- }));
6315
- exports.channel = void 0;
6316
- const parser_1 = __webpack_require__(605);
6317
- const combinator_1 = __webpack_require__(3484);
6318
- const link_1 = __webpack_require__(3628);
6319
- const hashtag_1 = __webpack_require__(5764);
6320
- const source_1 = __webpack_require__(8745);
6321
- const dom_1 = __webpack_require__(394);
6322
- // https://example/@user?ch=a+b must be a user channel page or a redirect page going there.
6323
- exports.channel = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.sequence)([(0, combinator_1.surround)(/(?<![0-9a-z])@/yi, /[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?)*\//yi, /[a-z][0-9a-z]*(?:[-.][0-9a-z]+)*(?![-.]?[0-9a-z@]|>>|:\S)/yi, true, undefined, undefined, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.some)((0, combinator_1.verify)((0, combinator_1.surround)('#', (0, source_1.str)(new RegExp([/(?!['_])(?:[^\p{C}\p{S}\p{P}\s]|emoji|'(?=[0-9A-Za-z])|_(?=[^\p{C}\p{S}\p{P}\s]|emoji))+/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu')), new RegExp([/(?![0-9a-z@]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu'), false, undefined, undefined, [3 | 0 /* Backtrack.autolink */]), ([{
6324
- value
6325
- }]) => !/^[0-9]{1,4}$|^[0-9]{5}/.test(value)))]), (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1, source.indexOf('#')).replace('/', '/@')}` : `/${source.slice(0, source.indexOf('#'))}`} }`, (0, combinator_1.union)([link_1.unsafelink]), false), ([{
6326
- value: el
6327
- }], {
6328
- source,
6329
- position,
6330
- range = 0
6331
- }) => {
6332
- const src = source.slice(position - range, position);
6333
- const url = `${el.getAttribute('href')}?ch=${src.slice(src.indexOf('#') + 1).replace(/#/g, '+')}`;
6334
- return new parser_1.List([new parser_1.Data((0, dom_1.define)(el, {
6335
- class: 'channel',
6336
- href: url
6337
- }, src))]);
6338
- })))));
6332
+ }))])))));
6339
6333
 
6340
6334
  /***/ },
6341
6335
 
@@ -6354,16 +6348,14 @@ const combinator_1 = __webpack_require__(3484);
6354
6348
  const source_1 = __webpack_require__(8745);
6355
6349
  const dom_1 = __webpack_require__(394);
6356
6350
  // https://html.spec.whatwg.org/multipage/input.html
6357
- exports.email = (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9a-z][_.+-]?|[@#])(?=[0-9a-z])/yi, (0, combinator_1.verify)((0, source_1.str)(/[0-9a-z](?:[_.+-](?=[0-9a-z])|[0-9a-z]){0,255}@[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?)*(?![.-]?[0-9a-z@#]|>>|:\S)/yi), ([{
6351
+ exports.email = (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)(/(?<![0-9a-z][_.+-]?|[@#])(?=[0-9a-z])/yi, (0, combinator_1.verify)((0, source_1.str)(/[0-9a-z](?:[_.+-](?=[0-9a-z])|[0-9a-z]){0,63}@[0-9a-z](?:[.-](?=[0-9a-z])|[0-9a-z]){0,254}(?![.-]?[0-9a-z@#]|>>|:\S)/yi), ([{
6358
6352
  value
6359
- }]) => value.length <= 255), false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.union)([({
6360
- context: {
6361
- source
6362
- }
6363
- }) => new parser_1.List([new parser_1.Data((0, dom_1.html)('a', {
6353
+ }]) => value.length <= 254), '', false, [3 | 0 /* Backtrack.autolink */], ([, [{
6354
+ value
6355
+ }]]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('a', {
6364
6356
  class: 'email',
6365
- href: `mailto:${source}`
6366
- }, source))])]))));
6357
+ href: `mailto:${value}`
6358
+ }, value))]))));
6367
6359
 
6368
6360
  /***/ },
6369
6361
 
@@ -6381,13 +6373,14 @@ const parser_1 = __webpack_require__(605);
6381
6373
  const combinator_1 = __webpack_require__(3484);
6382
6374
  const link_1 = __webpack_require__(3628);
6383
6375
  const hashtag_1 = __webpack_require__(5764);
6376
+ const source_1 = __webpack_require__(8745);
6384
6377
  const dom_1 = __webpack_require__(394);
6385
- exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(new RegExp([/(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu'), new RegExp([/[0-9]{1,9}(?![0-9a-z@#]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu'), false, [1 | 0 /* Backtrack.autolink */]), (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.slice(1)} }`, (0, combinator_1.union)([link_1.unsafelink]), false), ([{
6378
+ exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)(new RegExp([/(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu'), (0, source_1.str)(new RegExp([/[0-9]{1,9}(?![0-9a-z@#]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu')), '', false, [1 | 0 /* Backtrack.autolink */], ([, [{
6386
6379
  value
6387
- }]) => new parser_1.List([new parser_1.Data((0, dom_1.define)(value, {
6380
+ }]], context) => new parser_1.List([new parser_1.Data((0, dom_1.define)((0, link_1.parse)(new parser_1.List([new parser_1.Data(`#${value}`)]), new parser_1.List([new parser_1.Data(value)]), context), {
6388
6381
  class: 'hashnum',
6389
6382
  href: null
6390
- }))]))))));
6383
+ }))])))));
6391
6384
 
6392
6385
  /***/ },
6393
6386
 
@@ -6409,13 +6402,13 @@ const dom_1 = __webpack_require__(394);
6409
6402
  // https://example/hashtags/a must be a hashtag page or a redirect page going there.
6410
6403
  // https://github.com/tc39/proposal-regexp-unicode-property-escapes#matching-emoji
6411
6404
  exports.emoji = /\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F|\u200D/u;
6412
- exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.verify)((0, combinator_1.surround)(new RegExp([/(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yu.source].join('|').replace(/emoji/g, exports.emoji.source), 'yu'), (0, source_1.str)(new RegExp([/(?!['_])(?:[^\p{C}\p{S}\p{P}\s]|emoji|'(?=[0-9A-Za-z])|_(?=[^\p{C}\p{S}\p{P}\s]|emoji))+/yu.source].join('|').replace(/emoji/g, exports.emoji.source), 'yu')), new RegExp([/(?![0-9a-z@#]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, exports.emoji.source), 'yu'), false, undefined, undefined, [3 | 0 /* Backtrack.autolink */]), ([{
6405
+ exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)(new RegExp([/(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yu.source].join('|').replace(/emoji/g, exports.emoji.source), 'yu'), (0, combinator_1.verify)((0, source_1.str)(new RegExp([/(?!['_])(?:[^\p{C}\p{S}\p{P}\s]|emoji|'(?=[0-9A-Za-z])|_(?=[^\p{C}\p{S}\p{P}\s]|emoji))+/yu.source].join('|').replace(/emoji/g, exports.emoji.source), 'yu')), ([{
6413
6406
  value
6414
- }]) => !/^[0-9]{1,4}$|^[0-9]{5}/.test(value)), (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${`/hashtags/${source.slice(1)}`} }`, (0, combinator_1.union)([link_1.unsafelink]), false), ([{
6407
+ }]) => /^[0-9]{0,4}[^0-9]/.test(value)), new RegExp([/(?![0-9a-z@#]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, exports.emoji.source), 'yu'), false, [3 | 0 /* Backtrack.autolink */], ([, [{
6415
6408
  value
6416
- }]) => new parser_1.List([new parser_1.Data((0, dom_1.define)(value, {
6409
+ }]], context) => new parser_1.List([new parser_1.Data((0, dom_1.define)((0, link_1.parse)(new parser_1.List([new parser_1.Data(`#${value}`)]), new parser_1.List([new parser_1.Data(`/hashtags/${value}`)]), context), {
6417
6410
  class: 'hashtag'
6418
- }))]))))));
6411
+ }))])))));
6419
6412
 
6420
6413
  /***/ },
6421
6414
 
@@ -6434,9 +6427,21 @@ const combinator_1 = __webpack_require__(3484);
6434
6427
  const inline_1 = __webpack_require__(7973);
6435
6428
  const link_1 = __webpack_require__(3628);
6436
6429
  const source_1 = __webpack_require__(8745);
6437
- exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9A-Za-z][.+-]?|[@#])https?:\/\/(?=[\x21-\x7E])/y, (0, combinator_1.precedence)(0, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(source_1.unescsource, /(?<![-+*=~^_,.;:!?]|\/{3})(?:[-+*=~^_,.;:!?]|\/{3,}(?!\/))*(?=[\\$"`\[\](){}<>()[]{}|]|[^\x21-\x7E]|$)/y), (0, combinator_1.precedence)(1, (0, combinator_1.verify)(bracket, ns => ns.length > 0))]), undefined, [[/[^\x21-\x7E]|\$/y, 9]])), false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.convert)(url => `{ ${url} }`, link_1.unsafelink, false))), (0, combinator_1.open)((0, source_1.str)(/[^:]+/y), (0, combinator_1.some)(inline_1.inline))])));
6438
- exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.focus)(/(?<=^|[\r\n])!?https?:\/\/\S+(?=[^\S\n]*(?=$|\n))/y, (0, combinator_1.tails)([(0, source_1.str)('!'), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.convert)(url => `{ ${url} }`, link_1.unsafelink, false))), (0, combinator_1.open)((0, source_1.str)(/[^:]+/y), (0, combinator_1.some)(inline_1.inline))])])));
6439
- const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')')), (0, source_1.str)(')'), true, undefined, () => new parser_1.List(), [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']')), (0, source_1.str)(']'), true, undefined, () => new parser_1.List(), [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}')), (0, source_1.str)('}'), true, undefined, () => new parser_1.List(), [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)(source_1.unescsource, '"'))), (0, source_1.str)('"'), true, undefined, () => new parser_1.List(), [3 | 0 /* Backtrack.autolink */])]));
6430
+ exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9A-Za-z][.+-]?|[@#])https?:\/\/(?=[\x21-\x7E])/y, (0, combinator_1.precedence)(0, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(source_1.unescsource, /(?<![-+*=~^_,.;:!?]|\/{3})(?:[-+*=~^_,.;:!?]|\/{3,}(?!\/))*(?=[\\$"`\[\](){}<>()[]{}|]|[^\x21-\x7E]|$)/y), (0, combinator_1.precedence)(1, (0, combinator_1.verify)(bracket, ns => ns.length > 0))]), undefined, [[/[^\x21-\x7E]|\$/y, 9]])), false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, ({
6431
+ context
6432
+ }) => new parser_1.List([new parser_1.Data((0, link_1.parse)(new parser_1.List(), new parser_1.List([new parser_1.Data(context.source)]), context))]))), (0, combinator_1.open)((0, source_1.str)(/[^:]+/y), (0, combinator_1.some)(inline_1.inline))])));
6433
+ exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.focus)(/(?<=^|[\r\n])!?https?:\/\/\S+(?=[^\S\n]*(?=$|\n))/y, (0, combinator_1.tails)([(0, source_1.str)('!'), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, ({
6434
+ context
6435
+ }) => {
6436
+ const {
6437
+ source,
6438
+ position
6439
+ } = context;
6440
+ context.position -= source[0] === '!' ? 1 : 0;
6441
+ context.position += source.length;
6442
+ return new parser_1.List([new parser_1.Data((0, link_1.parse)(new parser_1.List(), new parser_1.List([new parser_1.Data(source.slice(position))]), context))]);
6443
+ })), (0, combinator_1.open)((0, source_1.str)(/[^:]+/y), (0, combinator_1.some)(inline_1.inline))])])));
6444
+ const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')')), (0, source_1.str)(')'), true, [3 | 0 /* Backtrack.autolink */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']')), (0, source_1.str)(']'), true, [3 | 0 /* Backtrack.autolink */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}')), (0, source_1.str)('}'), true, [3 | 0 /* Backtrack.autolink */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)(source_1.unescsource, '"'))), (0, source_1.str)('"'), true, [3 | 0 /* Backtrack.autolink */], undefined, () => new parser_1.List())]));
6440
6445
 
6441
6446
  /***/ },
6442
6447
 
@@ -6483,7 +6488,7 @@ exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([input =>
6483
6488
  return d1(input);
6484
6489
  }
6485
6490
  }]));
6486
- const p1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ')', [[')', 1]]))), (0, source_1.str)(')'), true, ([as, bs = new parser_1.List(), cs], {
6491
+ const p1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ')', [[')', 1]]))), (0, source_1.str)(')'), true, [2 | 64 /* Backtrack.bracket */], ([as, bs = new parser_1.List(), cs], {
6487
6492
  source,
6488
6493
  position,
6489
6494
  range = 0
@@ -6492,8 +6497,8 @@ const p1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.
6492
6497
  return indexA.test(str) ? new parser_1.List([new parser_1.Data(as.head.value), new parser_1.Data(str), new parser_1.Data(cs.head.value)]) : new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
6493
6498
  class: 'paren'
6494
6499
  }, (0, dom_1.defrag)((0, util_1.unwrap)(as.import(bs).import(cs)))))]);
6495
- }, ([as, bs = new parser_1.List()]) => as.import(bs), [2 | 64 /* Backtrack.bracket */]));
6496
- const p2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ')', [[')', 1]]))), (0, source_1.str)(')'), true, ([as, bs = [], cs], {
6500
+ }, ([as, bs = new parser_1.List()]) => as.import(bs)));
6501
+ const p2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ')', [[')', 1]]))), (0, source_1.str)(')'), true, [2 | 64 /* Backtrack.bracket */], ([as, bs = [], cs], {
6497
6502
  source,
6498
6503
  position,
6499
6504
  range = 0
@@ -6502,8 +6507,8 @@ const p2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.
6502
6507
  return indexF.test(str) ? new parser_1.List([new parser_1.Data(as.head.value), new parser_1.Data(str), new parser_1.Data(cs.head.value)]) : new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
6503
6508
  class: 'paren'
6504
6509
  }, (0, dom_1.defrag)((0, util_1.unwrap)(as.import(bs).import(cs)))))]);
6505
- }, ([as, bs = new parser_1.List()]) => as.import(bs), [2 | 64 /* Backtrack.bracket */]));
6506
- const s1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (0, source_1.str)(']'), true, ([as, bs = new parser_1.List(), cs], context) => {
6510
+ }, ([as, bs = new parser_1.List()]) => as.import(bs)));
6511
+ const s1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (0, source_1.str)(']'), true, [2 | 64 /* Backtrack.bracket */], ([as, bs = new parser_1.List(), cs], context) => {
6507
6512
  if (context.state & 8 /* State.link */) {
6508
6513
  const {
6509
6514
  source,
@@ -6527,13 +6532,13 @@ const s1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.
6527
6532
  }
6528
6533
  }
6529
6534
  return as.import(bs).import(cs);
6530
- }, ([as, bs = new parser_1.List()]) => as.import(bs), [2 | 64 /* Backtrack.bracket */]));
6531
- const s2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (0, source_1.str)(']'), true, undefined, ([as, bs = new parser_1.List()]) => as.import(bs), [2 | 64 /* Backtrack.bracket */]));
6532
- const c1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, undefined, ([as, bs = new parser_1.List()]) => as.import(bs), [2 | 64 /* Backtrack.bracket */]));
6533
- const c2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, undefined, ([as, bs = new parser_1.List()]) => as.import(bs), [2 | 64 /* Backtrack.bracket */]));
6535
+ }, ([as, bs = new parser_1.List()]) => as.import(bs)));
6536
+ const s2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (0, source_1.str)(']'), true, [2 | 64 /* Backtrack.bracket */], undefined, ([as, bs = new parser_1.List()]) => as.import(bs)));
6537
+ const c1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, [2 | 64 /* Backtrack.bracket */], undefined, ([as, bs = new parser_1.List()]) => as.import(bs)));
6538
+ const c2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, [2 | 64 /* Backtrack.bracket */], undefined, ([as, bs = new parser_1.List()]) => as.import(bs)));
6534
6539
  const d1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('"'),
6535
6540
  // 改行の優先度を構文ごとに変える場合シグネチャの優先度対応が必要
6536
- (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, /["\n]/y, [['"', 2], ['\n', 3]]))), (0, source_1.str)('"'), true, undefined, ([as, bs = new parser_1.List()]) => as.import(bs), [2 | 64 /* Backtrack.bracket */]));
6541
+ (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, /["\n]/y, [['"', 2], ['\n', 3]]))), (0, source_1.str)('"'), true, [2 | 64 /* Backtrack.bracket */], undefined, ([as, bs = new parser_1.List()]) => as.import(bs)));
6537
6542
 
6538
6543
  /***/ },
6539
6544
 
@@ -6579,7 +6584,7 @@ const inline_1 = __webpack_require__(7973);
6579
6584
  const visibility_1 = __webpack_require__(6364);
6580
6585
  const util_1 = __webpack_require__(4992);
6581
6586
  const dom_1 = __webpack_require__(394);
6582
- exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('~~', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '~~')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '~'), true)]))), '~~', false, ([, bs], {
6587
+ exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('~~', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '~~')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '~'), true)]))), '~~', false, [], ([, bs], {
6583
6588
  buffer
6584
6589
  }) => buffer.import(bs), ([, bs], {
6585
6590
  buffer
@@ -6605,7 +6610,7 @@ const source_1 = __webpack_require__(8745);
6605
6610
  const visibility_1 = __webpack_require__(6364);
6606
6611
  const util_1 = __webpack_require__(4992);
6607
6612
  const dom_1 = __webpack_require__(394);
6608
- exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)(/\*(?!\*)/y), (0, combinator_1.precedence)(0, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)]))))), (0, source_1.str)('*'), false, ([, bs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('em', (0, dom_1.defrag)((0, util_1.unwrap)(bs))))]), ([as, bs]) => bs && as.import(bs)));
6613
+ exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)(/\*(?!\*)/y), (0, combinator_1.precedence)(0, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)]))))), (0, source_1.str)('*'), false, [], ([, bs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('em', (0, dom_1.defrag)((0, util_1.unwrap)(bs))))]), ([as, bs]) => bs && as.import(bs)));
6609
6614
 
6610
6615
  /***/ },
6611
6616
 
@@ -6633,7 +6638,7 @@ const subemphasis = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, comb
6633
6638
  // 開閉が明示的でない構文は開閉の不明確な記号による再帰的適用を行わず
6634
6639
  // 可能な限り早く閉じるよう解析しなければならない。
6635
6640
  // このため終端記号の後ろを見て終端を中止し同じ構文を再帰的に適用してはならない。
6636
- exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('***', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)])))), (0, source_1.str)(/\*{1,3}/y), false, ([, bs, cs], context) => {
6641
+ exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('***', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)])))), (0, source_1.str)(/\*{1,3}/y), false, [], ([, bs, cs], context) => {
6637
6642
  const {
6638
6643
  buffer = new parser_1.List()
6639
6644
  } = context;
@@ -6789,9 +6794,9 @@ const source_1 = __webpack_require__(8745);
6789
6794
  const visibility_1 = __webpack_require__(6364);
6790
6795
  const util_1 = __webpack_require__(4992);
6791
6796
  const dom_1 = __webpack_require__(394);
6792
- exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(32 /* State.index */, (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)((0, source_1.str)('[#'), (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.inits)([inline_1.inline, exports.signature]), ']', [[']', 1]])))), (0, source_1.str)(']'), false, ([, bs], context) => context.linebreak === 0 && (0, visibility_1.trimBlankNodeEnd)(bs).length > 0 ? new parser_1.List([new parser_1.Data((0, dom_1.html)('a', {
6797
+ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(32 /* State.index */, (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)((0, source_1.str)('[#'), (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.inits)([inline_1.inline, exports.signature]), ']', [[']', 1]])))), (0, source_1.str)(']'), false, [3 | 64 /* Backtrack.bracket */], ([, bs], context) => context.linebreak === 0 && (0, visibility_1.trimBlankNodeEnd)(bs).length > 0 ? new parser_1.List([new parser_1.Data((0, dom_1.html)('a', {
6793
6798
  'data-index': dataindex(bs)
6794
- }, (0, dom_1.defrag)((0, util_1.unwrap)(bs))))]) : undefined, undefined, [3 | 64 /* Backtrack.bracket */])), ns => {
6799
+ }, (0, dom_1.defrag)((0, util_1.unwrap)(bs))))]) : undefined, undefined)), ns => {
6795
6800
  if (ns.length === 1) {
6796
6801
  const el = ns.head.value;
6797
6802
  return new parser_1.List([new parser_1.Data((0, dom_1.define)(el, {
@@ -6804,7 +6809,7 @@ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(32 /*
6804
6809
  return ns;
6805
6810
  }
6806
6811
  })));
6807
- exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|', (0, combinator_1.surround)((0, source_1.str)(/\|(?!\\?\s)/y), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, (0, combinator_1.some)(source_1.txt, /(?:[$"`\[\](){}<>()[]{}])/y)]), ']'), /(?=])/y, false, ([, ns], context) => {
6812
+ exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|', (0, combinator_1.surround)((0, source_1.str)(/\|(?!\\?\s)/y), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, (0, combinator_1.some)(source_1.txt, /(?:[$"`\[\](){}<>()[]{}])/y)]), ']'), /(?=])/y, false, [3 | 64 /* Backtrack.bracket */], ([, ns], context) => {
6808
6813
  const index = (0, indexee_1.identity)('index', undefined, ns.foldl((acc, {
6809
6814
  value
6810
6815
  }) => acc + value, ''))?.slice(7);
@@ -6812,7 +6817,7 @@ exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|',
6812
6817
  class: 'indexer',
6813
6818
  'data-index': index
6814
6819
  }))]) : undefined;
6815
- }, ([as, bs]) => bs && as.import(bs), [3 | 64 /* Backtrack.bracket */])));
6820
+ }, ([as, bs]) => bs && as.import(bs))));
6816
6821
  function dataindex(nodes) {
6817
6822
  let node = nodes.last;
6818
6823
  if (typeof node?.value !== 'object') return;
@@ -6989,7 +6994,7 @@ const dom_1 = __webpack_require__(394);
6989
6994
  exports.indexer = (0, combinator_1.surround)(/ \[(?=\|\S)/y, (0, combinator_1.union)([index_1.signature, (0, combinator_1.focus)(/\|(?=\])/y, () => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
6990
6995
  class: 'indexer',
6991
6996
  'data-index': ''
6992
- }))]))]), /\]\s*$/y);
6997
+ }))]))]), /\][^\S\n]*(?:$|\n)/y);
6993
6998
 
6994
6999
  /***/ },
6995
7000
 
@@ -7009,7 +7014,7 @@ const source_1 = __webpack_require__(8745);
7009
7014
  const dom_1 = __webpack_require__(394);
7010
7015
  const body = (0, source_1.str)(/\$[A-Za-z]*(?:(?:-[A-Za-z][0-9A-Za-z]*)+|-(?:(?:0|[1-9][0-9]*)\.)*(?:0|[1-9][0-9]*)(?![0-9A-Za-z]))/y);
7011
7016
  exports.segment = (0, combinator_1.clear)((0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body]));
7012
- exports.label = (0, combinator_1.constraint)(16 /* State.label */, (0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']', false, undefined, undefined, [1 | 64 /* Backtrack.bracket */, 1]), body]), ([{
7017
+ exports.label = (0, combinator_1.constraint)(16 /* State.label */, (0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']', false, [1 | 64 /* Backtrack.bracket */, 1]), body]), ([{
7013
7018
  value
7014
7019
  }]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('a', {
7015
7020
  class: 'label',
@@ -7056,10 +7061,10 @@ const dom_1 = __webpack_require__(394);
7056
7061
  // All syntax surrounded by square brackets shouldn't contain line breaks.
7057
7062
  exports.placeholder = (0, combinator_1.lazy)(() => (0, combinator_1.surround)(
7058
7063
  // ^はabbrで使用済みだが^:などのようにして分離使用可能
7059
- (0, source_1.str)(/\[[:^|]/y), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])))), (0, source_1.str)(']'), false, (_, context) => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
7064
+ (0, source_1.str)(/\[[:^|]/y), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])))), (0, source_1.str)(']'), false, [3 | 64 /* Backtrack.bracket */], (_, context) => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
7060
7065
  class: 'invalid',
7061
7066
  ...(0, util_1.invalid)('extension', 'syntax', `Invalid start symbol or linebreak`)
7062
- }, context.source.slice(context.position - context.range, context.position)))]), ([as, bs]) => bs && as.import(bs), [3 | 64 /* Backtrack.bracket */]));
7067
+ }, context.source.slice(context.position - context.range, context.position)))]), ([as, bs]) => bs && as.import(bs)));
7063
7068
 
7064
7069
  /***/ },
7065
7070
 
@@ -7092,14 +7097,14 @@ Object.setPrototypeOf(attrspecs, null);
7092
7097
  Object.values(attrspecs).forEach(o => Object.setPrototypeOf(o, null));
7093
7098
  exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/<[a-z]+(?=[ >])/yi, (0, combinator_1.union)([(0, combinator_1.surround)(
7094
7099
  // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
7095
- (0, source_1.str)(/<(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)(?=[ >])/y), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, combinator_1.open)((0, source_1.str)(/ ?/y), (0, source_1.str)('>'), true), true, ([as, bs = new parser_1.List(), cs], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs).import(cs))], new parser_1.List(), new parser_1.List(), context))]), ([as, bs = new parser_1.List()], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs))], new parser_1.List(), new parser_1.List(), context))])), (0, combinator_1.match)(new RegExp(String.raw`<(${TAGS.join('|')})(?=[ >])`, 'y'), (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${tag}`), (0, combinator_1.some)(exports.attribute), (0, combinator_1.open)((0, source_1.str)(/ ?/y), (0, source_1.str)('>'), true), true, ([as, bs = new parser_1.List(), cs]) => as.import(bs).import(cs), ([as, bs = new parser_1.List()]) => as.import(bs)),
7100
+ (0, source_1.str)(/<(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)(?=[ >])/y), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, combinator_1.open)((0, source_1.str)(/ ?/y), (0, source_1.str)('>'), true), true, [], ([as, bs = new parser_1.List(), cs], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs).import(cs))], new parser_1.List(), new parser_1.List(), context))]), ([as, bs = new parser_1.List()], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs))], new parser_1.List(), new parser_1.List(), context))])), (0, combinator_1.match)(new RegExp(String.raw`<(${TAGS.join('|')})(?=[ >])`, 'y'), (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${tag}`), (0, combinator_1.some)(exports.attribute), (0, combinator_1.open)((0, source_1.str)(/ ?/y), (0, source_1.str)('>'), true), true, [], ([as, bs = new parser_1.List(), cs]) => as.import(bs).import(cs), ([as, bs = new parser_1.List()]) => as.import(bs)),
7096
7101
  // 不可視のHTML構造が可視構造を変化させるべきでない。
7097
7102
  // 可視のHTMLは優先度変更を検討する。
7098
7103
  // このため<>は将来的に共通構造を変化させる可能性があり
7099
7104
  // 共通構造を変化させない非構造文字列としては依然としてエスケープを要する。
7100
- (0, combinator_1.precedence)(0, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', `</${tag}>`)), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, `</${tag}>`), true)])))), (0, source_1.str)(`</${tag}>`), true, ([as, bs = new parser_1.List(), cs], context) => new parser_1.List([new parser_1.Data(elem(tag, true, [...(0, util_1.unwrap)(as)], bs, cs, context))]), ([as, bs = new parser_1.List()], context) => new parser_1.List([new parser_1.Data(elem(tag, true, [...(0, util_1.unwrap)(as)], bs, new parser_1.List(), context))])), ([, tag]) => tag, new Map())), (0, combinator_1.surround)(
7105
+ (0, combinator_1.precedence)(0, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', `</${tag}>`)), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, `</${tag}>`), true)])))), (0, source_1.str)(`</${tag}>`), true, [], ([as, bs = new parser_1.List(), cs], context) => new parser_1.List([new parser_1.Data(elem(tag, true, [...(0, util_1.unwrap)(as)], bs, cs, context))]), ([as, bs = new parser_1.List()], context) => new parser_1.List([new parser_1.Data(elem(tag, true, [...(0, util_1.unwrap)(as)], bs, new parser_1.List(), context))])), ([, tag]) => tag, new Map())), (0, combinator_1.surround)(
7101
7106
  // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
7102
- (0, source_1.str)(/<[a-z]+(?=[ >])/yi), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, combinator_1.open)((0, source_1.str)(/ ?/y), (0, source_1.str)('>'), true), true, ([as, bs = new parser_1.List(), cs], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs).import(cs))], new parser_1.List(), new parser_1.List(), context))]), ([as, bs = new parser_1.List()], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs))], new parser_1.List(), new parser_1.List(), context))]))])));
7107
+ (0, source_1.str)(/<[a-z]+(?=[ >])/yi), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, combinator_1.open)((0, source_1.str)(/ ?/y), (0, source_1.str)('>'), true), true, [], ([as, bs = new parser_1.List(), cs], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs).import(cs))], new parser_1.List(), new parser_1.List(), context))]), ([as, bs = new parser_1.List()], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs))], new parser_1.List(), new parser_1.List(), context))]))])));
7103
7108
  exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/ [a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[ >])/yi), (0, source_1.str)(/ [^\s<>]+/y)]);
7104
7109
  function elem(tag, content, as, bs, cs, context) {
7105
7110
  if (!tags.includes(tag)) return ielem('tag', `Invalid HTML tag name "${tag}"`, context);
@@ -7170,7 +7175,7 @@ const combinator_1 = __webpack_require__(3484);
7170
7175
  const source_1 = __webpack_require__(8745);
7171
7176
  const util_1 = __webpack_require__(4992);
7172
7177
  const dom_1 = __webpack_require__(394);
7173
- exports.unsafehtmlentity = (0, combinator_1.surround)((0, source_1.str)('&'), (0, source_1.str)(/[0-9A-Za-z]+/y), (0, source_1.str)(';'), false, ([as, bs, cs]) => new parser_1.List([new parser_1.Data(parser(as.head.value + bs.head.value + cs.head.value))]), ([as, bs]) => new parser_1.List([new parser_1.Data(as.head.value + (bs?.head?.value ?? ''))]), [3 | 64 /* Backtrack.bracket */]);
7178
+ exports.unsafehtmlentity = (0, combinator_1.surround)((0, source_1.str)('&'), (0, source_1.str)(/[0-9A-Za-z]+/y), (0, source_1.str)(';'), false, [3 | 64 /* Backtrack.bracket */], ([as, bs, cs]) => new parser_1.List([new parser_1.Data(parser(as.head.value + bs.head.value + cs.head.value))]), ([as, bs]) => new parser_1.List([new parser_1.Data(as.head.value + (bs?.head?.value ?? ''))]));
7174
7179
  exports.htmlentity = (0, combinator_1.fmap)((0, combinator_1.union)([exports.unsafehtmlentity]), ([{
7175
7180
  value
7176
7181
  }]) => new parser_1.List([length === 1 || value.at(-1) !== ';' ? new parser_1.Data(value) : new parser_1.Data((0, dom_1.html)('span', {
@@ -7201,7 +7206,7 @@ const inline_1 = __webpack_require__(7973);
7201
7206
  const visibility_1 = __webpack_require__(6364);
7202
7207
  const util_1 = __webpack_require__(4992);
7203
7208
  const dom_1 = __webpack_require__(394);
7204
- exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('++', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '++')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '+'), true)]))), '++', false, ([, bs], {
7209
+ exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('++', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '++')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '+'), true)]))), '++', false, [], ([, bs], {
7205
7210
  buffer
7206
7211
  }) => buffer.import(bs), ([, bs], {
7207
7212
  buffer
@@ -7228,7 +7233,7 @@ const dom_1 = __webpack_require__(394);
7228
7233
  // 可読性のため実際にはオブリーク体を指定する。
7229
7234
  // 斜体は単語に使うとかえって見づらく読み飛ばしやすくなるため使わないべきであり
7230
7235
  // ある程度の長さのある文に使うのが望ましい。
7231
- exports.italic = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('///', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('///')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '/'), inline_1.inline)])))), '///', false, ([, bs], {
7236
+ exports.italic = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('///', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('///')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '/'), inline_1.inline)])))), '///', false, [], ([, bs], {
7232
7237
  buffer
7233
7238
  }) => buffer.import(bs), ([, bs], {
7234
7239
  buffer
@@ -7245,7 +7250,7 @@ exports.italic = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0
7245
7250
  Object.defineProperty(exports, "__esModule", ({
7246
7251
  value: true
7247
7252
  }));
7248
- exports.decode = exports.resolve = exports.option = exports.uri = exports.unsafelink = exports.medialink = exports.textlink = void 0;
7253
+ exports.decode = exports.resolve = exports.parse = exports.option = exports.uri = exports.medialink = exports.textlink = void 0;
7249
7254
  const parser_1 = __webpack_require__(605);
7250
7255
  const combinator_1 = __webpack_require__(3484);
7251
7256
  const inline_1 = __webpack_require__(7973);
@@ -7259,15 +7264,15 @@ const optspec = {
7259
7264
  rel: ['nofollow']
7260
7265
  };
7261
7266
  Object.setPrototypeOf(optspec, null);
7262
- exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */, (0, combinator_1.creation)(10, (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.subsequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])), ']', true, ([, ns = new parser_1.List()], context) => context.linebreak === 0 ? ns.push(new parser_1.Data("\u001F" /* Command.Separator */)) && ns : undefined, undefined, [3 | 64 /* Backtrack.bracket */, 3 | 16 /* Backtrack.link */, 2 | 8 /* Backtrack.ruby */])),
7267
+ exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */, (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.subsequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])), ']', true, [3 | 64 /* Backtrack.bracket */, 3 | 16 /* Backtrack.link */, 2 | 8 /* Backtrack.ruby */], ([, ns = new parser_1.List()], context) => context.linebreak === 0 ? ns.push(new parser_1.Data("\u001F" /* Command.Separator */)) && ns : undefined)),
7263
7268
  // `{ `と`{`で個別にバックトラックが発生し+1nされる。
7264
7269
  // 自己再帰的にパースしてもオプションの不要なパースによる計算量の増加により相殺される。
7265
- (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), / ?}/y, false, undefined, ([as, bs], context) => {
7270
+ (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), / ?}/y, false, [3 | 16 /* Backtrack.link */], undefined, ([as, bs], context) => {
7266
7271
  if (!bs) return;
7267
7272
  const head = context.position - context.range;
7268
7273
  (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
7269
7274
  return as.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && as;
7270
- }, [3 | 16 /* Backtrack.link */]))]), ([{
7275
+ }))]), ([{
7271
7276
  value: content
7272
7277
  }, {
7273
7278
  value: params = undefined
@@ -7291,21 +7296,17 @@ exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /
7291
7296
  }
7292
7297
  if (content.length !== 0 && (0, visibility_1.trimBlankNodeEnd)(content).length === 0) return;
7293
7298
  return new parser_1.List([new parser_1.Data(parse(content, params, context))]);
7294
- }))))));
7295
- exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */ | 4 /* State.media */, (0, combinator_1.creation)(10, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.sequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.union)([inline_1.media, inline_1.shortmedia]), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), / ?}/y))]), ([{
7299
+ })))));
7300
+ exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */ | 4 /* State.media */, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.sequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.union)([inline_1.media, inline_1.shortmedia]), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), / ?}/y))]), ([{
7296
7301
  value: content
7297
7302
  }, {
7298
7303
  value: params
7299
- }], context) => new parser_1.List([new parser_1.Data(parse(content, params, context))]))))));
7300
- exports.unsafelink = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(10, (0, combinator_1.bind)((0, combinator_1.reverse)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([source_1.unescsource]), ']'), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), / ?}/y))])), ([{
7301
- value: params
7302
- }, {
7303
- value: content
7304
- } = new parser_1.Data(new parser_1.List())], context) => new parser_1.List([new parser_1.Data(parse(content, params, context))]))));
7304
+ }], context) => new parser_1.List([new parser_1.Data(parse(content, params, context))])))));
7305
7305
  exports.uri = (0, combinator_1.union)([(0, combinator_1.open)(/ /y, (0, source_1.str)(/\S+/y)), (0, source_1.str)(/[^\s{}]+/y)]);
7306
7306
  exports.option = (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/ nofollow(?=[ }])/y), () => new parser_1.List([new parser_1.Data(' rel="nofollow"')])), (0, source_1.str)(/ [a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[ }])/yi), (0, source_1.str)(/ [^\s{}]+/y)]);
7307
7307
  function parse(content, params, context) {
7308
7308
  const INSECURE_URI = params.shift().value;
7309
+ (0, combinator_1.consume)(10, context);
7309
7310
  let uri;
7310
7311
  try {
7311
7312
  uri = new url_1.ReadonlyURL(resolve(INSECURE_URI, context.host ?? location, context.url ?? context.host ?? location), context.host?.href || location.href);
@@ -7313,6 +7314,7 @@ function parse(content, params, context) {
7313
7314
  const el = elem(INSECURE_URI, content, uri, context.host?.origin || location.origin);
7314
7315
  return el.classList.contains('invalid') ? el : (0, dom_1.define)(el, (0, html_1.attributes)('link', optspec, (0, util_1.unwrap)(params))[0]);
7315
7316
  }
7317
+ exports.parse = parse;
7316
7318
  function elem(INSECURE_URI, content, uri, origin) {
7317
7319
  let type;
7318
7320
  let message;
@@ -7410,7 +7412,7 @@ const indexee_1 = __webpack_require__(7610);
7410
7412
  const visibility_1 = __webpack_require__(6364);
7411
7413
  const util_1 = __webpack_require__(4992);
7412
7414
  const dom_1 = __webpack_require__(394);
7413
- exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(251 /* State.linkers */ & ~2 /* State.mark */, (0, combinator_1.precedence)(0, (0, combinator_1.state)(2 /* State.mark */, (0, util_1.repeat)('==', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('==')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '='), inline_1.inline)])))), '==', false, ([, bs], {
7415
+ exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(251 /* State.linkers */ & ~2 /* State.mark */, (0, combinator_1.precedence)(0, (0, combinator_1.state)(2 /* State.mark */, (0, util_1.repeat)('==', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('==')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '='), inline_1.inline)])))), '==', false, [], ([, bs], {
7414
7416
  buffer
7415
7417
  }) => buffer.import(bs), ([, bs], {
7416
7418
  buffer
@@ -7444,7 +7446,7 @@ const source_1 = __webpack_require__(8745);
7444
7446
  const util_1 = __webpack_require__(4992);
7445
7447
  const dom_1 = __webpack_require__(394);
7446
7448
  const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![a-z])|:\/\//i;
7447
- exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.union)([(0, combinator_1.surround)(/\$(?={)/y, (0, combinator_1.precedence)(4, bracket), '$', false, undefined, undefined, [3 | 64 /* Backtrack.bracket */]), (0, combinator_1.surround)(/\$(?![\s{}])/y, (0, combinator_1.precedence)(2, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(source_1.escsource, /\s?\$|[`"{}\n]/y), (0, combinator_1.precedence)(4, bracket)]))), /\$(?![-0-9A-Za-z])/y, false, undefined, undefined, [3 | 64 /* Backtrack.bracket */])]), ({
7449
+ exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.union)([(0, combinator_1.surround)(/\$(?={)/y, (0, combinator_1.precedence)(4, bracket), '$', false, [3 | 64 /* Backtrack.bracket */]), (0, combinator_1.surround)(/\$(?![\s{}])/y, (0, combinator_1.precedence)(2, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(source_1.escsource, /\s?\$|[`"{}\n]/y), (0, combinator_1.precedence)(4, bracket)]))), /\$(?![-0-9A-Za-z])/y, false, [3 | 64 /* Backtrack.bracket */])]), ({
7448
7450
  context: {
7449
7451
  source,
7450
7452
  caches: {
@@ -7490,12 +7492,12 @@ const optspec = {
7490
7492
  rel: undefined
7491
7493
  };
7492
7494
  Object.setPrototypeOf(optspec, null);
7493
- exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.creation)(10, (0, combinator_1.open)('!', (0, combinator_1.bind)((0, combinator_1.fmap)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']')), ']', true, ([, ns = new parser_1.List()], context) => context.linebreak === 0 ? ns : undefined, undefined, [3 | 4 /* Backtrack.escbracket */])), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), / ?}/y, false, undefined, ([as, bs], context) => {
7495
+ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.open)('!', (0, combinator_1.bind)((0, combinator_1.fmap)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']')), ']', true, [3 | 4 /* Backtrack.escbracket */], ([, ns = new parser_1.List()], context) => context.linebreak === 0 ? ns : undefined)), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), / ?}/y, false, [3 | 16 /* Backtrack.link */], undefined, ([as, bs], context) => {
7494
7496
  if (!bs) return;
7495
7497
  const head = context.position - context.range;
7496
7498
  (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
7497
7499
  return as.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && as;
7498
- }, [3 | 16 /* Backtrack.link */]))]), nodes => nodes.length === 1 ? new parser_1.List([new parser_1.Data(new parser_1.List([new parser_1.Data('')])), nodes.delete(nodes.head)]) : new parser_1.List([new parser_1.Data(new parser_1.List([new parser_1.Data(nodes.head.value.foldl((acc, {
7500
+ }))]), nodes => nodes.length === 1 ? new parser_1.List([new parser_1.Data(new parser_1.List([new parser_1.Data('')])), nodes.delete(nodes.head)]) : new parser_1.List([new parser_1.Data(new parser_1.List([new parser_1.Data(nodes.head.value.foldl((acc, {
7499
7501
  value
7500
7502
  }) => acc + value, ''))])), nodes.delete(nodes.last)])), ([{
7501
7503
  value: [{
@@ -7506,6 +7508,7 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* S
7506
7508
  }], context) => {
7507
7509
  if (text && text.trimStart() === '') return;
7508
7510
  text = text.trim();
7511
+ (0, combinator_1.consume)(100, context);
7509
7512
  if (params.last.value === "\u0018" /* Command.Cancel */) {
7510
7513
  params.pop();
7511
7514
  return new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
@@ -7535,23 +7538,13 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* S
7535
7538
  }
7536
7539
  if (context.state & 8 /* State.link */) return new parser_1.List([new parser_1.Data(el)]);
7537
7540
  if (cache && cache.tagName !== 'IMG') return new parser_1.List([new parser_1.Data(el)]);
7538
- const {
7539
- source,
7540
- position
7541
- } = context;
7542
- return (0, combinator_1.fmap)(link_1.unsafelink, ([{
7543
- value
7544
- }]) => {
7545
- context.source = source;
7546
- context.position = position;
7547
- return new parser_1.List([new parser_1.Data((0, dom_1.define)(value, {
7548
- class: null,
7549
- target: '_blank'
7550
- }, [el]))]);
7551
- })((0, parser_1.subinput)(`{ ${INSECURE_URI}${linkparams.join('')} }`, context));
7552
- })))));
7553
- const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true, undefined, () => new parser_1.List(), [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true, undefined, () => new parser_1.List(), [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true, undefined, () => new parser_1.List(), [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, source_1.txt]), '"')), (0, source_1.str)('"'), true, undefined, () => new parser_1.List(), [3 | 4 /* Backtrack.escbracket */])])));
7554
- const option = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, combinator_1.open)(/ /y, (0, source_1.str)(/[1-9][0-9]*/y)), (0, source_1.str)(/[x:]/y), (0, source_1.str)(/[1-9][0-9]*(?=[ }])/y), false, ([[{
7541
+ return new parser_1.List([new parser_1.Data((0, dom_1.define)((0, link_1.parse)(new parser_1.List(), linkparams.reduce((acc, p) => acc.push(new parser_1.Data(p)) && acc, new parser_1.List([new parser_1.Data(INSECURE_URI)])), context), {
7542
+ class: null,
7543
+ target: '_blank'
7544
+ }, [el]))]);
7545
+ }))));
7546
+ const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true, [3 | 4 /* Backtrack.escbracket */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true, [3 | 4 /* Backtrack.escbracket */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true, [3 | 4 /* Backtrack.escbracket */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, source_1.txt]), '"')), (0, source_1.str)('"'), true, [3 | 4 /* Backtrack.escbracket */], undefined, () => new parser_1.List())])));
7547
+ const option = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, combinator_1.open)(/ /y, (0, source_1.str)(/[1-9][0-9]*/y)), (0, source_1.str)(/[x:]/y), (0, source_1.str)(/[1-9][0-9]*(?=[ }])/y), false, [], ([[{
7555
7548
  value: a
7556
7549
  }], [{
7557
7550
  value: b
@@ -7576,11 +7569,6 @@ function sanitize(target, uri) {
7576
7569
  type = 'argument';
7577
7570
  message = 'Invalid protocol';
7578
7571
  }
7579
- //else {
7580
- // target.setAttribute('alt', alt.replace(CmdRegExp.Error, ''));
7581
- // type = 'argument';
7582
- // message = `Invalid HTML entitiy "${alt.match(/&[0-9A-Za-z]+;/)![0]}"`;
7583
- //}
7584
7572
  (0, dom_1.define)(target, {
7585
7573
  'data-src': null,
7586
7574
  class: 'invalid',
@@ -7609,7 +7597,7 @@ const source_1 = __webpack_require__(8745);
7609
7597
  const visibility_1 = __webpack_require__(6364);
7610
7598
  const util_1 = __webpack_require__(4992);
7611
7599
  const dom_1 = __webpack_require__(394);
7612
- exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64 /* State.reference */, (0, combinator_1.surround)((0, source_1.str)('[['), (0, combinator_1.precedence)(1, (0, combinator_1.state)(128 /* State.annotation */ | 64 /* State.reference */, (0, combinator_1.subsequence)([abbr, (0, visibility_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))]))), ']]', false, ([, ns], context) => {
7600
+ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64 /* State.reference */, (0, combinator_1.surround)((0, source_1.str)('[['), (0, combinator_1.precedence)(1, (0, combinator_1.state)(128 /* State.annotation */ | 64 /* State.reference */, (0, combinator_1.subsequence)([abbr, (0, visibility_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))]))), ']]', false, [1 | 64 /* Backtrack.bracket */, 3 | 32 /* Backtrack.doublebracket */], ([, ns], context) => {
7613
7601
  const {
7614
7602
  position,
7615
7603
  range = 0,
@@ -7657,7 +7645,7 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
7657
7645
  if (context.position === source.length) {
7658
7646
  (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
7659
7647
  } else {
7660
- const next = (0, combinator_1.surround)('', (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]), (0, source_1.str)(']'), true, ([, cs = new parser_1.List(), ds]) => cs.import(ds), ([, cs = new parser_1.List()]) => {
7648
+ const next = (0, combinator_1.surround)('', (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]), (0, source_1.str)(']'), true, [], ([, cs = new parser_1.List(), ds]) => cs.import(ds), ([, cs = new parser_1.List()]) => {
7661
7649
  (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
7662
7650
  return cs;
7663
7651
  })({
@@ -7670,9 +7658,9 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
7670
7658
  context.position = position;
7671
7659
  }
7672
7660
  return state & 128 /* State.annotation */ ? as.import(bs) : undefined;
7673
- }, [1 | 64 /* Backtrack.bracket */, 3 | 32 /* Backtrack.doublebracket */])));
7661
+ })));
7674
7662
  // Chicago-Style
7675
- const abbr = (0, combinator_1.surround)((0, source_1.str)('^'), (0, combinator_1.union)([(0, source_1.str)(/(?=[A-Z])(?:[0-9A-Za-z]'?|(?:[-.:]|\.?\??,? ?)(?!['\-.:?, ]))+/y)]), /\|?(?=]])|\|/y, true, ([, ns], context) => {
7663
+ const abbr = (0, combinator_1.surround)((0, source_1.str)('^'), (0, combinator_1.union)([(0, source_1.str)(/(?=[A-Z])(?:[0-9A-Za-z]'?|(?:[-.:]|\.?\??,? ?)(?!['\-.:?, ]))+/y)]), /\|?(?=]])|\|/y, true, [], ([, ns], context) => {
7676
7664
  const {
7677
7665
  source,
7678
7666
  position,
@@ -7724,7 +7712,7 @@ const inline_1 = __webpack_require__(7973);
7724
7712
  const source_1 = __webpack_require__(8745);
7725
7713
  const util_1 = __webpack_require__(4992);
7726
7714
  const dom_1 = __webpack_require__(394);
7727
- exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.fallback)((0, combinator_1.surround)((0, source_1.str)(/\[%(?=[ \n])/y), (0, combinator_1.precedence)(3, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /[ \n]%\]/y, [[/[ \n]%\]/y, 3]]))), (0, combinator_1.close)(source_1.text, (0, source_1.str)(`%]`)), true, ([as, bs = new parser_1.List(), cs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
7715
+ exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.fallback)((0, combinator_1.surround)((0, source_1.str)(/\[%(?=[ \n])/y), (0, combinator_1.precedence)(3, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /[ \n]%\]/y, [[/[ \n]%\]/y, 3]]))), (0, combinator_1.close)(source_1.text, (0, source_1.str)(`%]`)), true, [], ([as, bs = new parser_1.List(), cs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
7728
7716
  class: 'remark'
7729
7717
  }, [(0, dom_1.html)('input', {
7730
7718
  type: 'checkbox'
@@ -7756,10 +7744,10 @@ const source_1 = __webpack_require__(8745);
7756
7744
  const visibility_1 = __webpack_require__(6364);
7757
7745
  const util_1 = __webpack_require__(4992);
7758
7746
  const dom_1 = __webpack_require__(394);
7759
- exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.bind)((0, combinator_1.inits)([(0, combinator_1.dup)((0, combinator_1.surround)('[', text, ']', false, ([, ns]) => {
7747
+ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.bind)((0, combinator_1.inits)([(0, combinator_1.dup)((0, combinator_1.surround)('[', text, ']', false, [1 | 64 /* Backtrack.bracket */, 3 | 8 /* Backtrack.ruby */], ([, ns]) => {
7760
7748
  ns && ns.last?.value === '' && ns.pop();
7761
7749
  return (0, visibility_1.isTightNodeStart)(ns) ? ns : undefined;
7762
- }, undefined, [1 | 64 /* Backtrack.bracket */, 3 | 8 /* Backtrack.ruby */])), (0, combinator_1.dup)((0, combinator_1.surround)('(', text, ')', false, undefined, undefined, [1 | 64 /* Backtrack.bracket */, 3 | 8 /* Backtrack.ruby */]))]), ([{
7750
+ })), (0, combinator_1.dup)((0, combinator_1.surround)('(', text, ')', false, [1 | 64 /* Backtrack.bracket */, 3 | 8 /* Backtrack.ruby */]))]), ([{
7763
7751
  value: texts
7764
7752
  }, {
7765
7753
  value: rubies = undefined
@@ -7879,7 +7867,7 @@ const source_1 = __webpack_require__(8745);
7879
7867
  const visibility_1 = __webpack_require__(6364);
7880
7868
  const util_1 = __webpack_require__(4992);
7881
7869
  const dom_1 = __webpack_require__(394);
7882
- exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)(/\*\*(?!\*)/y), (0, combinator_1.precedence)(0, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([emphasis_1.emphasis, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)]))))), (0, source_1.str)('**'), false, ([, bs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('strong', (0, dom_1.defrag)((0, util_1.unwrap)(bs))))]), ([as, bs]) => bs && as.import(bs)));
7870
+ exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)(/\*\*(?!\*)/y), (0, combinator_1.precedence)(0, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([emphasis_1.emphasis, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)]))))), (0, source_1.str)('**'), false, [], ([, bs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('strong', (0, dom_1.defrag)((0, util_1.unwrap)(bs))))]), ([as, bs]) => bs && as.import(bs)));
7883
7871
 
7884
7872
  /***/ },
7885
7873
 
@@ -7898,13 +7886,13 @@ const combinator_1 = __webpack_require__(3484);
7898
7886
  const source_1 = __webpack_require__(8745);
7899
7887
  const util_1 = __webpack_require__(4992);
7900
7888
  const dom_1 = __webpack_require__(394);
7901
- exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{{'), (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), (0, source_1.str)('}}'), true, ([as, bs = new parser_1.List(), cs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
7889
+ exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{{'), (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), (0, source_1.str)('}}'), true, [3 | 32 /* Backtrack.doublebracket */, 3 | 4 /* Backtrack.escbracket */], ([as, bs = new parser_1.List(), cs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
7902
7890
  class: 'template'
7903
7891
  }, (0, dom_1.defrag)((0, util_1.unwrap)(as.import(bs).import(cs)))))]), ([, bs], context) => bs && new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
7904
7892
  class: 'invalid',
7905
7893
  ...(0, util_1.invalid)('template', 'syntax', `Missing the closing symbol "}}"`)
7906
- }, context.source.slice(context.position - context.range, context.position)))]), [3 | 32 /* Backtrack.doublebracket */, 3 | 4 /* Backtrack.escbracket */]));
7907
- const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')')), (0, source_1.str)(')'), true, undefined, () => new parser_1.List(), [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ']')), (0, source_1.str)(']'), true, undefined, () => new parser_1.List(), [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), (0, source_1.str)('}'), true, undefined, () => new parser_1.List(), [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)(source_1.escsource, /["\n]/y, [['"', 2], ['\n', 3]]))), (0, source_1.str)('"'), true, ([as, bs = new parser_1.List(), cs], context) => context.linebreak === 0 ? as.import(bs).import(cs) : (context.position -= 1, as.import(bs)), ([as, bs]) => bs && as.import(bs), [3 | 4 /* Backtrack.escbracket */])]));
7894
+ }, context.source.slice(context.position - context.range, context.position)))])));
7895
+ const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')')), (0, source_1.str)(')'), true, [3 | 4 /* Backtrack.escbracket */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ']')), (0, source_1.str)(']'), true, [3 | 4 /* Backtrack.escbracket */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), (0, source_1.str)('}'), true, [3 | 4 /* Backtrack.escbracket */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)(source_1.escsource, /["\n]/y, [['"', 2], ['\n', 3]]))), (0, source_1.str)('"'), true, [3 | 4 /* Backtrack.escbracket */], ([as, bs = new parser_1.List(), cs], context) => context.linebreak === 0 ? as.import(bs).import(cs) : (context.position -= 1, as.import(bs)), ([as, bs]) => bs && as.import(bs))]));
7908
7896
 
7909
7897
  /***/ },
7910
7898
 
@@ -8233,7 +8221,7 @@ const extension_1 = __webpack_require__(6193);
8233
8221
  const source_1 = __webpack_require__(8745);
8234
8222
  exports.MAX_SEGMENT_SIZE = 100_000; // 100,000 bytes (Max value size of FDB)
8235
8223
  exports.MAX_INPUT_SIZE = exports.MAX_SEGMENT_SIZE * 10;
8236
- const parser = (0, combinator_1.union)([input => {
8224
+ const parser = (0, combinator_1.union)([(0, combinator_1.some)(source_1.emptyline), input => {
8237
8225
  const {
8238
8226
  context: {
8239
8227
  source,
@@ -8259,7 +8247,7 @@ const parser = (0, combinator_1.union)([input => {
8259
8247
  case '$':
8260
8248
  return (0, extension_1.segment)(input);
8261
8249
  }
8262
- }, (0, combinator_1.some)(source_1.contentline, exports.MAX_SEGMENT_SIZE + 1), (0, combinator_1.some)(source_1.emptyline, exports.MAX_SEGMENT_SIZE + 1)]);
8250
+ }, (0, combinator_1.some)(source_1.contentline)]);
8263
8251
  function* segment(source) {
8264
8252
  if (!validate(source, exports.MAX_INPUT_SIZE)) return yield `${"\u0007" /* Command.Error */}Too large input over ${exports.MAX_INPUT_SIZE.toLocaleString('en')} bytes.\n${source.slice(0, 1001)}`;
8265
8253
  for (let position = 0; position < source.length;) {
@@ -8297,7 +8285,7 @@ exports.validate = validate;
8297
8285
  Object.defineProperty(exports, "__esModule", ({
8298
8286
  value: true
8299
8287
  }));
8300
- exports.anyline = exports.emptyline = exports.contentline = exports.strs = exports.str = exports.unescsource = exports.escsource = exports.linebreak = exports.txt = exports.text = void 0;
8288
+ exports.anyline = exports.emptyline = exports.contentline = exports.strs = exports.str = exports.unescsource = exports.escsource = exports.txt = exports.text = void 0;
8301
8289
  var text_1 = __webpack_require__(5655);
8302
8290
  Object.defineProperty(exports, "text", ({
8303
8291
  enumerable: true,
@@ -8311,12 +8299,6 @@ Object.defineProperty(exports, "txt", ({
8311
8299
  return text_1.txt;
8312
8300
  }
8313
8301
  }));
8314
- Object.defineProperty(exports, "linebreak", ({
8315
- enumerable: true,
8316
- get: function () {
8317
- return text_1.linebreak;
8318
- }
8319
- }));
8320
8302
  var escapable_1 = __webpack_require__(3770);
8321
8303
  Object.defineProperty(exports, "escsource", ({
8322
8304
  enumerable: true,
@@ -8393,9 +8375,6 @@ const escsource = ({
8393
8375
  (0, combinator_1.consume)(1, context);
8394
8376
  context.position += 1;
8395
8377
  switch (char) {
8396
- case '\r':
8397
- (0, combinator_1.consume)(-1, context);
8398
- return new parser_1.List();
8399
8378
  case "\u001B" /* Command.Escape */:
8400
8379
  (0, combinator_1.consume)(1, context);
8401
8380
  context.position += 1;
@@ -8411,6 +8390,9 @@ const escsource = ({
8411
8390
  context.position += 1;
8412
8391
  return new parser_1.List([new parser_1.Data(source.slice(position, position + 2))]);
8413
8392
  }
8393
+ case '\r':
8394
+ (0, combinator_1.consume)(-1, context);
8395
+ return new parser_1.List();
8414
8396
  case '\n':
8415
8397
  context.linebreak ||= source.length - position;
8416
8398
  return new parser_1.List([new parser_1.Data((0, dom_1.html)('br'))]);
@@ -8536,7 +8518,7 @@ exports.strs = strs;
8536
8518
  Object.defineProperty(exports, "__esModule", ({
8537
8519
  value: true
8538
8520
  }));
8539
- exports.isAlphanumeric = exports.backToEmailHead = exports.backToUrlHead = exports.backToWhitespace = exports.next = exports.canSkip = exports.linebreak = exports.txt = exports.text = exports.nonWhitespace = void 0;
8521
+ exports.isAlphanumeric = exports.backToEmailHead = exports.backToUrlHead = exports.backToWhitespace = exports.next = exports.canSkip = exports.txt = exports.text = exports.nonWhitespace = void 0;
8540
8522
  const parser_1 = __webpack_require__(605);
8541
8523
  const combinator_1 = __webpack_require__(3484);
8542
8524
  const dom_1 = __webpack_require__(394);
@@ -8555,9 +8537,6 @@ const text = input => {
8555
8537
  (0, combinator_1.consume)(1, context);
8556
8538
  context.position += 1;
8557
8539
  switch (char) {
8558
- case '\r':
8559
- (0, combinator_1.consume)(-1, context);
8560
- return new parser_1.List();
8561
8540
  case "\u001B" /* Command.Escape */:
8562
8541
  case '\\':
8563
8542
  switch (source[position + 1]) {
@@ -8570,6 +8549,9 @@ const text = input => {
8570
8549
  context.position += 1;
8571
8550
  return new parser_1.List([new parser_1.Data(source.slice(position + 1, context.position))]);
8572
8551
  }
8552
+ case '\r':
8553
+ (0, combinator_1.consume)(-1, context);
8554
+ return new parser_1.List();
8573
8555
  case '\n':
8574
8556
  context.linebreak ||= source.length - position;
8575
8557
  return new parser_1.List([new parser_1.Data((0, dom_1.html)('br'))]);
@@ -8589,7 +8571,6 @@ const text = input => {
8589
8571
  };
8590
8572
  exports.text = text;
8591
8573
  exports.txt = (0, combinator_1.union)([exports.text]);
8592
- exports.linebreak = (0, combinator_1.focus)(/[\r\n]/y, (0, combinator_1.union)([exports.text]));
8593
8574
  function canSkip(source, position) {
8594
8575
  if (!isWhitespace(source[position], false)) return false;
8595
8576
  if (position + 1 === source.length) return true;
@@ -8841,13 +8822,12 @@ const unescsource = ({
8841
8822
  (0, combinator_1.consume)(1, context);
8842
8823
  context.position += 1;
8843
8824
  switch (char) {
8844
- case '\r':
8845
- (0, combinator_1.consume)(-1, context);
8846
- return new parser_1.List();
8847
8825
  case "\u001B" /* Command.Escape */:
8848
8826
  (0, combinator_1.consume)(1, context);
8849
8827
  context.position += 1;
8850
8828
  return new parser_1.List([new parser_1.Data(source.slice(position + 1, position + 2))]);
8829
+ case '\r':
8830
+ return new parser_1.List();
8851
8831
  case '\n':
8852
8832
  context.linebreak ||= source.length - position;
8853
8833
  return new parser_1.List([new parser_1.Data((0, dom_1.html)('br'))]);