securemark 0.292.0 → 0.293.1

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 (127) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/index.js +597 -416
  3. package/markdown.d.ts +35 -60
  4. package/package.json +1 -1
  5. package/src/combinator/control/constraint/contract.ts +6 -15
  6. package/src/combinator/control/manipulation/clear.ts +3 -4
  7. package/src/combinator/control/manipulation/fence.ts +3 -1
  8. package/src/combinator/control/manipulation/indent.ts +5 -11
  9. package/src/combinator/control/manipulation/match.ts +3 -2
  10. package/src/combinator/control/manipulation/recovery.ts +1 -1
  11. package/src/combinator/control/manipulation/scope.ts +3 -10
  12. package/src/combinator/control/manipulation/surround.ts +4 -24
  13. package/src/combinator/data/parser/context/delimiter.ts +10 -9
  14. package/src/combinator/data/parser/context.ts +31 -0
  15. package/src/combinator/data/parser/inits.ts +1 -1
  16. package/src/combinator/data/parser/sequence.ts +1 -1
  17. package/src/combinator/data/parser/some.test.ts +1 -1
  18. package/src/combinator/data/parser/some.ts +4 -5
  19. package/src/combinator/data/parser.ts +0 -1
  20. package/src/combinator.ts +0 -1
  21. package/src/parser/api/parse.test.ts +16 -8
  22. package/src/parser/api/parse.ts +1 -2
  23. package/src/parser/autolink.test.ts +7 -7
  24. package/src/parser/autolink.ts +2 -4
  25. package/src/parser/block/blockquote.test.ts +1 -1
  26. package/src/parser/block/blockquote.ts +7 -7
  27. package/src/parser/block/codeblock.ts +8 -8
  28. package/src/parser/block/dlist.test.ts +1 -1
  29. package/src/parser/block/dlist.ts +5 -6
  30. package/src/parser/block/extension/aside.ts +4 -4
  31. package/src/parser/block/extension/example.ts +4 -4
  32. package/src/parser/block/extension/fig.ts +5 -5
  33. package/src/parser/block/extension/figbase.ts +1 -1
  34. package/src/parser/block/extension/figure.test.ts +1 -1
  35. package/src/parser/block/extension/figure.ts +6 -6
  36. package/src/parser/block/extension/message.ts +4 -4
  37. package/src/parser/block/extension/placeholder.ts +8 -8
  38. package/src/parser/block/extension/table.test.ts +1 -1
  39. package/src/parser/block/extension/table.ts +32 -22
  40. package/src/parser/block/extension.ts +3 -3
  41. package/src/parser/block/heading.test.ts +1 -1
  42. package/src/parser/block/heading.ts +2 -2
  43. package/src/parser/block/ilist.test.ts +3 -3
  44. package/src/parser/block/ilist.ts +5 -5
  45. package/src/parser/block/mathblock.ts +8 -8
  46. package/src/parser/block/mediablock.ts +6 -6
  47. package/src/parser/block/olist.test.ts +16 -14
  48. package/src/parser/block/olist.ts +13 -13
  49. package/src/parser/block/pagebreak.ts +1 -1
  50. package/src/parser/block/paragraph.test.ts +3 -4
  51. package/src/parser/block/paragraph.ts +1 -2
  52. package/src/parser/block/reply/cite.ts +7 -9
  53. package/src/parser/block/reply/quote.ts +6 -6
  54. package/src/parser/block/reply.ts +3 -3
  55. package/src/parser/block/sidefence.ts +3 -3
  56. package/src/parser/block/table.ts +13 -13
  57. package/src/parser/block/ulist.test.ts +8 -7
  58. package/src/parser/block/ulist.ts +6 -7
  59. package/src/parser/block.ts +48 -15
  60. package/src/parser/context.ts +4 -4
  61. package/src/parser/header.ts +3 -3
  62. package/src/parser/inline/annotation.ts +1 -1
  63. package/src/parser/inline/autolink/account.test.ts +8 -7
  64. package/src/parser/inline/autolink/account.ts +11 -8
  65. package/src/parser/inline/autolink/anchor.test.ts +1 -1
  66. package/src/parser/inline/autolink/anchor.ts +21 -17
  67. package/src/parser/inline/autolink/channel.test.ts +8 -8
  68. package/src/parser/inline/autolink/channel.ts +40 -15
  69. package/src/parser/inline/autolink/email.test.ts +15 -15
  70. package/src/parser/inline/autolink/email.ts +5 -7
  71. package/src/parser/inline/autolink/hashnum.test.ts +4 -9
  72. package/src/parser/inline/autolink/hashnum.ts +8 -4
  73. package/src/parser/inline/autolink/hashtag.test.ts +9 -10
  74. package/src/parser/inline/autolink/hashtag.ts +9 -6
  75. package/src/parser/inline/autolink/url.test.ts +72 -74
  76. package/src/parser/inline/autolink/url.ts +19 -24
  77. package/src/parser/inline/autolink.ts +21 -24
  78. package/src/parser/inline/bracket.ts +3 -3
  79. package/src/parser/inline/code.ts +2 -2
  80. package/src/parser/inline/deletion.test.ts +2 -2
  81. package/src/parser/inline/deletion.ts +1 -1
  82. package/src/parser/inline/emphasis.test.ts +5 -5
  83. package/src/parser/inline/emphasis.ts +2 -7
  84. package/src/parser/inline/emstrong.test.ts +14 -14
  85. package/src/parser/inline/emstrong.ts +4 -16
  86. package/src/parser/inline/extension/index.test.ts +5 -3
  87. package/src/parser/inline/extension/index.ts +8 -10
  88. package/src/parser/inline/extension/indexer.test.ts +1 -2
  89. package/src/parser/inline/extension/indexer.ts +3 -3
  90. package/src/parser/inline/extension/label.ts +1 -1
  91. package/src/parser/inline/extension/placeholder.ts +1 -1
  92. package/src/parser/inline/html.test.ts +2 -2
  93. package/src/parser/inline/html.ts +21 -20
  94. package/src/parser/inline/htmlentity.ts +4 -4
  95. package/src/parser/inline/insertion.test.ts +2 -2
  96. package/src/parser/inline/insertion.ts +1 -1
  97. package/src/parser/inline/italic.test.ts +9 -9
  98. package/src/parser/inline/italic.ts +1 -1
  99. package/src/parser/inline/link.ts +14 -19
  100. package/src/parser/inline/mark.test.ts +5 -5
  101. package/src/parser/inline/mark.ts +1 -1
  102. package/src/parser/inline/math.test.ts +6 -6
  103. package/src/parser/inline/math.ts +9 -13
  104. package/src/parser/inline/media.ts +9 -14
  105. package/src/parser/inline/reference.test.ts +4 -4
  106. package/src/parser/inline/reference.ts +5 -5
  107. package/src/parser/inline/remark.test.ts +19 -23
  108. package/src/parser/inline/remark.ts +17 -19
  109. package/src/parser/inline/ruby.ts +5 -3
  110. package/src/parser/inline/shortmedia.ts +6 -9
  111. package/src/parser/inline/strong.test.ts +5 -5
  112. package/src/parser/inline/strong.ts +2 -7
  113. package/src/parser/inline.test.ts +25 -23
  114. package/src/parser/inline.ts +21 -9
  115. package/src/parser/segment.ts +23 -5
  116. package/src/parser/source/escapable.test.ts +6 -6
  117. package/src/parser/source/escapable.ts +20 -5
  118. package/src/parser/source/line.ts +28 -4
  119. package/src/parser/source/str.ts +5 -27
  120. package/src/parser/source/text.test.ts +60 -60
  121. package/src/parser/source/text.ts +121 -6
  122. package/src/parser/source/unescapable.test.ts +8 -8
  123. package/src/parser/source/unescapable.ts +19 -3
  124. package/src/parser/util.ts +3 -3
  125. package/src/parser/visibility.ts +45 -40
  126. package/src/combinator/control/manipulation/trim.test.ts +0 -23
  127. package/src/combinator/control/manipulation/trim.ts +0 -17
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! securemark v0.292.0 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
1
+ /*! securemark v0.293.1 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"));
@@ -2440,7 +2440,6 @@ __exportStar(__webpack_require__(8606), exports);
2440
2440
  __exportStar(__webpack_require__(5781), exports);
2441
2441
  __exportStar(__webpack_require__(1638), exports);
2442
2442
  __exportStar(__webpack_require__(6572), exports);
2443
- __exportStar(__webpack_require__(79), exports);
2444
2443
  __exportStar(__webpack_require__(4750), exports);
2445
2444
  __exportStar(__webpack_require__(2217), exports);
2446
2445
  __exportStar(__webpack_require__(5117), exports);
@@ -2493,12 +2492,11 @@ Object.defineProperty(exports, "__esModule", ({
2493
2492
  value: true
2494
2493
  }));
2495
2494
  exports.verify = exports.validate = void 0;
2496
- const alias_1 = __webpack_require__(5413);
2497
2495
  const parser_1 = __webpack_require__(605);
2498
- function validate(patterns, parser) {
2499
- if (typeof patterns === 'function') return guard(patterns, parser);
2500
- if (!(0, alias_1.isArray)(patterns)) return validate([patterns], parser);
2501
- const match = __webpack_require__.g.eval(['({ source, position }) =>', patterns.map(pattern => typeof pattern === 'string' ? `|| source.startsWith('${pattern}', position)` : `|| /${pattern.source}/${pattern.flags}.test(source.slice(position))`).join('').slice(2)].join(''));
2496
+ const combinator_1 = __webpack_require__(3484);
2497
+ function validate(pattern, parser) {
2498
+ if (typeof pattern === 'function') return guard(pattern, parser);
2499
+ const match = (0, combinator_1.matcher)(pattern, false);
2502
2500
  return input => {
2503
2501
  const {
2504
2502
  context
@@ -2508,7 +2506,7 @@ function validate(patterns, parser) {
2508
2506
  position
2509
2507
  } = context;
2510
2508
  if (position === source.length) return;
2511
- if (!match(context)) return;
2509
+ if (!match(input)) return;
2512
2510
  return parser(input);
2513
2511
  };
2514
2512
  }
@@ -2583,7 +2581,7 @@ exports.isBlank = isBlank;
2583
2581
  /***/ },
2584
2582
 
2585
2583
  /***/ 8606
2586
- (__unused_webpack_module, exports, __webpack_require__) {
2584
+ (__unused_webpack_module, exports) {
2587
2585
 
2588
2586
  "use strict";
2589
2587
 
@@ -2592,9 +2590,8 @@ Object.defineProperty(exports, "__esModule", ({
2592
2590
  value: true
2593
2591
  }));
2594
2592
  exports.clear = void 0;
2595
- const fmap_1 = __webpack_require__(2705);
2596
2593
  function clear(parser) {
2597
- return (0, fmap_1.fmap)(parser, () => []);
2594
+ return input => parser(input) && [[]];
2598
2595
  }
2599
2596
  exports.clear = clear;
2600
2597
 
@@ -2706,7 +2703,8 @@ function fence(opener, limit, separation = true) {
2706
2703
  position
2707
2704
  } = context;
2708
2705
  if (position === source.length) return;
2709
- const matches = source.slice(position).match(opener);
2706
+ opener.lastIndex = position;
2707
+ const matches = opener.exec(source);
2710
2708
  if (!matches) return;
2711
2709
  const delim = matches[1];
2712
2710
  if (matches[0].includes(delim, delim.length)) return;
@@ -2770,7 +2768,7 @@ function indent(opener, parser = false, separation = false) {
2770
2768
  if (typeof opener === 'function') {
2771
2769
  separation = parser;
2772
2770
  parser = opener;
2773
- opener = /^([ \t])\1*/;
2771
+ opener = /([ \t])\1*/y;
2774
2772
  }
2775
2773
  return (0, parser_1.failsafe)((0, bind_1.bind)((0, block_1.block)((0, match_1.match)(opener, (0, memoize_1.memoize)(([indent]) => (0, some_1.some)((0, line_1.line)((0, surround_1.open)(indent, ({
2776
2774
  context
@@ -2782,19 +2780,8 @@ function indent(opener, parser = false, separation = false) {
2782
2780
  context.position = source.length;
2783
2781
  return [[source.slice(position)]];
2784
2782
  }))), ([indent]) => indent.length * 2 + +(indent[0] === ' '), {})), separation), (lines, context) => {
2785
- const {
2786
- source,
2787
- position
2788
- } = context;
2789
- // 影響する使用はないはず
2790
- //const { backtracks } = context;
2791
- //context.backtracks = {};
2792
- const result = parser((0, parser_1.input)(trimBlockEnd(lines.join('')), context));
2793
- //context.backtracks = backtracks;
2794
-
2795
- context.position = position - (context.source.length - context.position);
2796
- context.source = source;
2797
- return result && context.position === position ? [(0, parser_1.eval)(result)] : undefined;
2783
+ const result = parser((0, parser_1.subinput)(trimBlockEnd(lines.join('')), context));
2784
+ return result ? [(0, parser_1.eval)(result)] : undefined;
2798
2785
  }));
2799
2786
  }
2800
2787
  exports.indent = indent;
@@ -2844,7 +2831,8 @@ function match(pattern, f, cost = false) {
2844
2831
  position
2845
2832
  } = context;
2846
2833
  if (position === source.length) return;
2847
- const param = source.slice(position).match(pattern);
2834
+ pattern.lastIndex = position;
2835
+ const param = pattern.exec(source);
2848
2836
  if (!param) return;
2849
2837
  cost && (0, combinator_1.consume)(param[0].length, context);
2850
2838
  const result = f(param)(input);
@@ -2919,7 +2907,7 @@ exports.rewrite = exports.focus = void 0;
2919
2907
  const parser_1 = __webpack_require__(605);
2920
2908
  const combinator_1 = __webpack_require__(3484);
2921
2909
  function focus(scope, parser, cost = true) {
2922
- const match = typeof scope === 'string' ? (source, position) => source.startsWith(scope, position) ? scope : '' : (source, position) => source.slice(position).match(scope)?.[0] ?? '';
2910
+ const match = (0, combinator_1.matcher)(scope, false);
2923
2911
  return (0, parser_1.failsafe)(({
2924
2912
  context
2925
2913
  }) => {
@@ -2928,7 +2916,9 @@ function focus(scope, parser, cost = true) {
2928
2916
  position
2929
2917
  } = context;
2930
2918
  if (position === source.length) return;
2931
- const src = match(source, position);
2919
+ const src = (0, parser_1.eval)(match({
2920
+ context
2921
+ }))?.[0] ?? '';
2932
2922
  if (src === '') return;
2933
2923
  cost && (0, combinator_1.consume)(src.length, context);
2934
2924
  context.range = src.length;
@@ -2953,13 +2943,9 @@ function rewrite(scope, parser) {
2953
2943
  position
2954
2944
  } = context;
2955
2945
  if (position === source.length) return;
2956
- // 影響する使用はないはず
2957
- //const { backtracks } = context;
2958
- //context.backtracks = {};
2959
2946
  const res1 = scope({
2960
2947
  context
2961
2948
  });
2962
- //context.backtracks = backtracks;
2963
2949
  if (res1 === undefined || context.position < position) return;
2964
2950
  const src = source.slice(position, context.position);
2965
2951
  context.offset ??= 0;
@@ -2994,12 +2980,12 @@ function surround(opener, parser, closer, optional = false, f, g, backtracks = [
2994
2980
  switch (typeof opener) {
2995
2981
  case 'string':
2996
2982
  case 'object':
2997
- opener = match(opener);
2983
+ opener = (0, combinator_1.clear)((0, combinator_1.matcher)(opener, true));
2998
2984
  }
2999
2985
  switch (typeof closer) {
3000
2986
  case 'string':
3001
2987
  case 'object':
3002
- closer = match(closer);
2988
+ closer = (0, combinator_1.clear)((0, combinator_1.matcher)(closer, true));
3003
2989
  }
3004
2990
  return (0, parser_1.failsafe)(input => {
3005
2991
  const {
@@ -3108,36 +3094,6 @@ function setBacktrack(context, backtracks, position, length = 1) {
3108
3094
  }
3109
3095
  }
3110
3096
  exports.setBacktrack = setBacktrack;
3111
- function match(pattern) {
3112
- switch (typeof pattern) {
3113
- case 'string':
3114
- return ({
3115
- context
3116
- }) => {
3117
- const {
3118
- source,
3119
- position
3120
- } = context;
3121
- if (!source.startsWith(pattern, position)) return;
3122
- context.position += pattern.length;
3123
- return [[]];
3124
- };
3125
- case 'object':
3126
- return ({
3127
- context
3128
- }) => {
3129
- const {
3130
- source,
3131
- position
3132
- } = context;
3133
- const m = source.slice(position).match(pattern);
3134
- if (m === null) return;
3135
- (0, combinator_1.consume)(m[0].length, context);
3136
- context.position += m[0].length;
3137
- return [[]];
3138
- };
3139
- }
3140
- }
3141
3097
  function revert(context, linebreak) {
3142
3098
  context.linebreak = linebreak;
3143
3099
  }
@@ -3154,32 +3110,6 @@ function size(bits) {
3154
3110
 
3155
3111
  /***/ },
3156
3112
 
3157
- /***/ 79
3158
- (__unused_webpack_module, exports, __webpack_require__) {
3159
-
3160
- "use strict";
3161
-
3162
-
3163
- Object.defineProperty(exports, "__esModule", ({
3164
- value: true
3165
- }));
3166
- exports.trimEnd = exports.trimStart = exports.trim = void 0;
3167
- const convert_1 = __webpack_require__(6572);
3168
- function trim(parser) {
3169
- return (0, convert_1.convert)(source => source.trim(), parser, false);
3170
- }
3171
- exports.trim = trim;
3172
- function trimStart(parser) {
3173
- return (0, convert_1.convert)(source => source.trimStart(), parser, true);
3174
- }
3175
- exports.trimStart = trimStart;
3176
- function trimEnd(parser) {
3177
- return (0, convert_1.convert)(source => source.trimEnd(), parser, false);
3178
- }
3179
- exports.trimEnd = trimEnd;
3180
-
3181
- /***/ },
3182
-
3183
3113
  /***/ 994
3184
3114
  (__unused_webpack_module, exports, __webpack_require__) {
3185
3115
 
@@ -3247,7 +3177,6 @@ function input(source, context) {
3247
3177
  // @ts-expect-error
3248
3178
  context.position = 0;
3249
3179
  return {
3250
- source,
3251
3180
  // @ts-expect-error
3252
3181
  context
3253
3182
  };
@@ -3312,7 +3241,7 @@ exports.failsafe = failsafe;
3312
3241
  Object.defineProperty(exports, "__esModule", ({
3313
3242
  value: true
3314
3243
  }));
3315
- exports.constraint = exports.state = exports.precedence = exports.recursion = exports.consume = exports.creation = exports.context = exports.reset = void 0;
3244
+ exports.matcher = exports.constraint = exports.state = exports.precedence = exports.recursion = exports.consume = exports.creation = exports.context = exports.reset = void 0;
3316
3245
  const alias_1 = __webpack_require__(5413);
3317
3246
  const assign_1 = __webpack_require__(9888);
3318
3247
  function reset(base, parser) {
@@ -3467,11 +3396,48 @@ function constraint(state, positive, parser) {
3467
3396
  };
3468
3397
  }
3469
3398
  exports.constraint = constraint;
3399
+ function matcher(pattern, advance) {
3400
+ const count = typeof pattern === 'object' ? /[^^\\*+][*+]/.test(pattern.source) : false;
3401
+ switch (typeof pattern) {
3402
+ case 'string':
3403
+ return ({
3404
+ context
3405
+ }) => {
3406
+ const {
3407
+ source,
3408
+ position
3409
+ } = context;
3410
+ if (!source.startsWith(pattern, position)) return;
3411
+ if (advance) {
3412
+ context.position += pattern.length;
3413
+ }
3414
+ return [[pattern]];
3415
+ };
3416
+ case 'object':
3417
+ return ({
3418
+ context
3419
+ }) => {
3420
+ const {
3421
+ source,
3422
+ position
3423
+ } = context;
3424
+ pattern.lastIndex = position;
3425
+ if (!pattern.test(source)) return;
3426
+ const src = source.slice(position, pattern.lastIndex);
3427
+ count && consume(src.length, context);
3428
+ if (advance) {
3429
+ context.position += src.length;
3430
+ }
3431
+ return [[src]];
3432
+ };
3433
+ }
3434
+ }
3435
+ exports.matcher = matcher;
3470
3436
 
3471
3437
  /***/ },
3472
3438
 
3473
3439
  /***/ 5691
3474
- (__unused_webpack_module, exports) {
3440
+ (__unused_webpack_module, exports, __webpack_require__) {
3475
3441
 
3476
3442
  "use strict";
3477
3443
 
@@ -3480,6 +3446,7 @@ Object.defineProperty(exports, "__esModule", ({
3480
3446
  value: true
3481
3447
  }));
3482
3448
  exports.Delimiters = void 0;
3449
+ const combinator_1 = __webpack_require__(3484);
3483
3450
  class Delimiters {
3484
3451
  constructor() {
3485
3452
  this.tree = {};
@@ -3509,15 +3476,9 @@ class Delimiters {
3509
3476
  case 'undefined':
3510
3477
  return () => undefined;
3511
3478
  case 'string':
3512
- return ({
3513
- source,
3514
- position
3515
- }) => source.startsWith(pattern, position) || undefined;
3516
3479
  case 'object':
3517
- return ({
3518
- source,
3519
- position
3520
- }) => pattern.test(source.slice(position)) || undefined;
3480
+ const match = (0, combinator_1.matcher)(pattern, false);
3481
+ return input => match(input) !== undefined || undefined;
3521
3482
  }
3522
3483
  }
3523
3484
  registry(signature) {
@@ -3608,18 +3569,18 @@ class Delimiters {
3608
3569
  delimiters[indexes[i]].state = true;
3609
3570
  }
3610
3571
  }
3611
- match(context) {
3572
+ match(input) {
3612
3573
  const {
3613
3574
  precedence = 0,
3614
3575
  linebreak = 0
3615
- } = context;
3576
+ } = input.context;
3616
3577
  const {
3617
3578
  delimiters
3618
3579
  } = this;
3619
3580
  for (let i = delimiters.length; i--;) {
3620
3581
  const delimiter = delimiters[i];
3621
3582
  if (delimiter.precedence <= precedence || !delimiter.state) continue;
3622
- switch (delimiter.matcher(context)) {
3583
+ switch (delimiter.matcher(input)) {
3623
3584
  case true:
3624
3585
  if (!delimiter.linebreakable && linebreak > 0) return false;
3625
3586
  return true;
@@ -3661,7 +3622,7 @@ function inits(parsers, resume) {
3661
3622
  let nodes;
3662
3623
  for (let len = parsers.length, i = 0; i < len; ++i) {
3663
3624
  if (context.position === source.length) break;
3664
- if (context.delimiters?.match(context)) break;
3625
+ if (context.delimiters?.match(input)) break;
3665
3626
  const result = parsers[i](input);
3666
3627
  if (result === undefined) break;
3667
3628
  nodes = nodes ? (0, array_1.push)(nodes, (0, parser_1.eval)(result)) : (0, parser_1.eval)(result);
@@ -3699,7 +3660,7 @@ function sequence(parsers, resume) {
3699
3660
  let nodes;
3700
3661
  for (let len = parsers.length, i = 0; i < len; ++i) {
3701
3662
  if (context.position === source.length) return;
3702
- if (context.delimiters?.match(context)) return;
3663
+ if (context.delimiters?.match(input)) return;
3703
3664
  const result = parsers[i](input);
3704
3665
  if (result === undefined) return;
3705
3666
  nodes = nodes ? (0, array_1.push)(nodes, (0, parser_1.eval)(result)) : (0, parser_1.eval)(result);
@@ -3725,7 +3686,7 @@ exports.some = void 0;
3725
3686
  const parser_1 = __webpack_require__(605);
3726
3687
  const delimiter_1 = __webpack_require__(5691);
3727
3688
  const array_1 = __webpack_require__(6876);
3728
- function some(parser, end, delimiters = [], limit = 0) {
3689
+ function some(parser, end, delimiters = [], limit = -1) {
3729
3690
  if (typeof end === 'number') return some(parser, undefined, delimiters, end);
3730
3691
  const match = delimiter_1.Delimiters.matcher(end);
3731
3692
  const delims = delimiters.map(([delimiter, precedence, linebreakable = true]) => ({
@@ -3750,12 +3711,12 @@ function some(parser, end, delimiters = [], limit = 0) {
3750
3711
  }
3751
3712
  while (true) {
3752
3713
  if (context.position === source.length) break;
3753
- if (match(context)) break;
3754
- if (context.delimiters?.match(context)) break;
3714
+ if (match(input)) break;
3715
+ if (context.delimiters?.match(input)) break;
3755
3716
  const result = parser(input);
3756
3717
  if (result === undefined) break;
3757
3718
  nodes = nodes ? nodes.length < (0, parser_1.eval)(result).length / 8 ? (0, array_1.unshift)(nodes, (0, parser_1.eval)(result)) : (0, array_1.push)(nodes, (0, parser_1.eval)(result)) : (0, parser_1.eval)(result);
3758
- if (limit > 0 && context.position - position > limit) break;
3719
+ if (limit >= 0 && context.position - position > limit) break;
3759
3720
  }
3760
3721
  if (delims.length > 0) {
3761
3722
  context.delimiters.pop(delims.length);
@@ -4272,7 +4233,6 @@ const note_1 = __webpack_require__(165);
4272
4233
  const url_1 = __webpack_require__(1904);
4273
4234
  const dom_1 = __webpack_require__(394);
4274
4235
  function parse(source, opts = {}, context) {
4275
- if (!(0, segment_1.validate)(source, segment_1.MAX_SEGMENT_SIZE)) throw new Error(`Too large input over ${segment_1.MAX_SEGMENT_SIZE.toLocaleString('en')} bytes`);
4276
4236
  const url = (0, header_2.headers)(source).find(field => field.toLowerCase().startsWith('url:'))?.slice(4).trim() ?? '';
4277
4237
  source = !context ? (0, normalize_1.normalize)(source) : source;
4278
4238
  context = {
@@ -4313,7 +4273,7 @@ exports.autolink = void 0;
4313
4273
  const combinator_1 = __webpack_require__(3484);
4314
4274
  const autolink_1 = __webpack_require__(8072);
4315
4275
  const source_1 = __webpack_require__(8745);
4316
- exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.convert)(source => `\r${source}`, (0, combinator_1.some)((0, combinator_1.union)([autolink_1.autolink, source_1.linebreak, source_1.unescsource])), false));
4276
+ exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([autolink_1.autolink, source_1.linebreak, source_1.unescsource])));
4317
4277
 
4318
4278
  /***/ },
4319
4279
 
@@ -4350,11 +4310,58 @@ const dom_1 = __webpack_require__(394);
4350
4310
  exports.block = (0, combinator_1.reset)({
4351
4311
  resources: {
4352
4312
  // バックトラックのせいで文字数制限を受けないようにする。
4353
- clock: segment_1.MAX_SEGMENT_SIZE * 1,
4313
+ clock: segment_1.MAX_SEGMENT_SIZE * 5 + 1,
4354
4314
  recursions: [10 || 0 /* Recursion.block */, 20 || 0 /* Recursion.blockquote */, 40 || 0 /* Recursion.listitem */, 20 || 0 /* Recursion.inline */, 20 || 0 /* Recursion.bracket */, 20 || 0 /* Recursion.terminal */]
4355
4315
  },
4356
4316
  backtracks: {}
4357
- }, error((0, combinator_1.union)([source_1.emptyline, pagebreak_1.pagebreak, heading_1.heading, ulist_1.ulist, olist_1.olist, ilist_1.ilist, dlist_1.dlist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, extension_1.extension, sidefence_1.sidefence, blockquote_1.blockquote, mediablock_1.mediablock, reply_1.reply, paragraph_1.paragraph])));
4317
+ }, error((0, combinator_1.union)([input => {
4318
+ const {
4319
+ context: {
4320
+ source,
4321
+ position
4322
+ }
4323
+ } = input;
4324
+ if (position === source.length) return;
4325
+ switch (source.slice(position, position + 3)) {
4326
+ case '===':
4327
+ return (0, pagebreak_1.pagebreak)(input);
4328
+ case '~~~':
4329
+ return (0, extension_1.extension)(input);
4330
+ case '```':
4331
+ return (0, codeblock_1.codeblock)(input);
4332
+ }
4333
+ switch (source.slice(position, position + 2)) {
4334
+ case '$$':
4335
+ return (0, mathblock_1.mathblock)(input);
4336
+ case '[$':
4337
+ return (0, extension_1.extension)(input);
4338
+ case '[!':
4339
+ return (0, mediablock_1.mediablock)(input);
4340
+ case '!>':
4341
+ return (0, blockquote_1.blockquote)(input);
4342
+ case '>>':
4343
+ return (0, blockquote_1.blockquote)(input) || (0, reply_1.reply)(input);
4344
+ case '- ':
4345
+ return (0, ulist_1.ulist)(input) || (0, ilist_1.ilist)(input);
4346
+ case '+ ':
4347
+ case '* ':
4348
+ return (0, ilist_1.ilist)(input);
4349
+ case '~ ':
4350
+ return (0, dlist_1.dlist)(input);
4351
+ }
4352
+ switch (source[position]) {
4353
+ case '#':
4354
+ return (0, heading_1.heading)(input);
4355
+ case '|':
4356
+ return (0, table_1.table)(input) || (0, sidefence_1.sidefence)(input);
4357
+ case '$':
4358
+ return (0, extension_1.extension)(input);
4359
+ case '>':
4360
+ return (0, blockquote_1.blockquote)(input);
4361
+ case '!':
4362
+ return (0, mediablock_1.mediablock)(input);
4363
+ }
4364
+ }, source_1.emptyline, olist_1.olist, paragraph_1.paragraph])));
4358
4365
  function error(parser) {
4359
4366
  const reg = new RegExp(String.raw`^${"\u0007" /* Command.Error */}.*\n`);
4360
4367
  return (0, combinator_1.recover)((0, combinator_1.fallback)((0, combinator_1.open)("\u0007" /* Command.Error */, ({
@@ -4396,10 +4403,10 @@ const autolink_1 = __webpack_require__(1671);
4396
4403
  const source_1 = __webpack_require__(8745);
4397
4404
  const parse_1 = __webpack_require__(3662);
4398
4405
  const dom_1 = __webpack_require__(394);
4399
- exports.segment = (0, combinator_1.block)((0, combinator_1.validate)(['!>', '>'], (0, combinator_1.union)([(0, combinator_1.validate)(/^!?>+(?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.some)(source_1.contentline))])));
4400
- exports.blockquote = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.union)([(0, combinator_1.open)(/^(?=>)/, source), (0, combinator_1.open)(/^!(?=>)/, markdown)]))));
4401
- const opener = /^(?=>>+(?:$|\s))/;
4402
- const indent = (0, combinator_1.block)((0, combinator_1.open)(opener, (0, combinator_1.some)(source_1.contentline, /^>(?:$|\s)/)), false);
4406
+ exports.segment = (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(/!?>+(?=[^\S\n]|\n[^\S\n]*\S)/y, (0, combinator_1.some)(source_1.contentline))]));
4407
+ exports.blockquote = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.union)([(0, combinator_1.open)(/(?=>)/y, source), (0, combinator_1.open)(/!(?=>)/y, markdown)]))));
4408
+ const opener = /(?=>>+(?:$|\s))/y;
4409
+ const indent = (0, combinator_1.block)((0, combinator_1.open)(opener, (0, combinator_1.some)(source_1.contentline, />(?:$|\s)/y)), false);
4403
4410
  const unindent = source => source.replace(/(?<=^|\n)>(?:[^\S\n]|(?=>*(?:$|\s)))|\n$/g, '');
4404
4411
  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 => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))]), false, true))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
4405
4412
  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, ({
@@ -4438,11 +4445,11 @@ const combinator_1 = __webpack_require__(3484);
4438
4445
  const autolink_1 = __webpack_require__(1671);
4439
4446
  const util_1 = __webpack_require__(4992);
4440
4447
  const dom_1 = __webpack_require__(394);
4441
- const opener = /^(`{3,})(?!`)([^\n]*)(?:$|\n)/;
4448
+ const opener = /(`{3,})(?!`)([^\n]*)(?:$|\n)/y;
4442
4449
  const language = /^[0-9a-z]+(?:-[a-z][0-9a-z]*)*$/i;
4443
- exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('```', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300))));
4444
- exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('```', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false))), false);
4445
- exports.codeblock = (0, combinator_1.block)((0, combinator_1.validate)('```', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
4450
+ exports.segment = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300)));
4451
+ exports.segment_ = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false)), false);
4452
+ exports.codeblock = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
4446
4453
  // Bug: Type mismatch between outer and inner.
4447
4454
  ([body, overflow, closer, opener, delim, param], context) => {
4448
4455
  const params = param.match(/(?:\\.?|\S)+/g)?.reduce((params, value, i) => {
@@ -4480,7 +4487,7 @@ exports.codeblock = (0, combinator_1.block)((0, combinator_1.validate)('```', (0
4480
4487
  ...context
4481
4488
  })), [])));
4482
4489
  return [el];
4483
- })));
4490
+ }));
4484
4491
 
4485
4492
  /***/ },
4486
4493
 
@@ -4497,15 +4504,14 @@ exports.dlist = void 0;
4497
4504
  const combinator_1 = __webpack_require__(3484);
4498
4505
  const inline_1 = __webpack_require__(7973);
4499
4506
  const source_1 = __webpack_require__(8745);
4500
- const util_1 = __webpack_require__(4992);
4501
4507
  const visibility_1 = __webpack_require__(6364);
4502
4508
  const array_1 = __webpack_require__(6876);
4503
4509
  const dom_1 = __webpack_require__(394);
4504
- exports.dlist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^~[^\S\n]+(?=\S)/, (0, combinator_1.some)((0, combinator_1.inits)([(0, combinator_1.state)(128 /* State.annotation */ | 64 /* State.reference */ | 32 /* State.index */ | 16 /* State.label */ | 8 /* State.link */, (0, combinator_1.some)(term)), (0, combinator_1.some)(desc)]))), es => [(0, dom_1.html)('dl', fillTrailingDescription(es))])));
4505
- const term = (0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.open)(/^~[^\S\n]+(?=\S)/, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), ns => [(0, dom_1.html)('dt', {
4510
+ exports.dlist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/~[^\S\n]+(?=\S)/y, (0, combinator_1.some)((0, combinator_1.inits)([(0, combinator_1.state)(128 /* State.annotation */ | 64 /* State.reference */ | 32 /* State.index */ | 16 /* State.label */ | 8 /* State.link */, (0, combinator_1.some)(term)), (0, combinator_1.some)(desc)]))), es => [(0, dom_1.html)('dl', fillTrailingDescription(es))])));
4511
+ const term = (0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.open)(/~[^\S\n]+(?=\S)/y, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), ns => [(0, dom_1.html)('dt', {
4506
4512
  'data-index': (0, inline_1.dataindex)(ns)
4507
4513
  }, (0, dom_1.defrag)(ns))])));
4508
- const desc = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)(/^:[^\S\n]+(?=\S)|/, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, /^[~:][^\S\n]+\S/), (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, util_1.lineable)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline])))))), true), ns => [(0, dom_1.html)('dd', (0, dom_1.defrag)(ns))]), false);
4514
+ const desc = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)(/:[^\S\n]+(?=\S)|/y, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, /[~:][^\S\n]+\S/y), (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('dd', (0, dom_1.defrag)(ns))]), false);
4509
4515
  function fillTrailingDescription(es) {
4510
4516
  return es.length > 0 && es.at(-1).tagName === 'DT' ? (0, array_1.push)(es, [(0, dom_1.html)('dd')]) : es;
4511
4517
  }
@@ -4531,7 +4537,7 @@ const message_1 = __webpack_require__(3949);
4531
4537
  const aside_1 = __webpack_require__(6150);
4532
4538
  const example_1 = __webpack_require__(6624);
4533
4539
  const placeholder_1 = __webpack_require__(4091);
4534
- exports.segment = (0, combinator_1.validate)(['~~~', '[$', '$'], (0, combinator_1.validate)(/^~{3,}|^\[?\$[A-Za-z-]\S+[^\S\n]*(?:$|\n)/, (0, combinator_1.union)([fig_1.segment, figure_1.segment, table_1.segment, placeholder_1.segment])));
4540
+ exports.segment = (0, combinator_1.union)([fig_1.segment, figure_1.segment, table_1.segment, placeholder_1.segment]);
4535
4541
  exports.extension = (0, combinator_1.union)([figbase_1.figbase, fig_1.fig, figure_1.figure, table_1.table, message_1.message, aside_1.aside, example_1.example, placeholder_1.placeholder]);
4536
4542
 
4537
4543
  /***/ },
@@ -4551,7 +4557,7 @@ const indexee_1 = __webpack_require__(7610);
4551
4557
  const util_1 = __webpack_require__(4992);
4552
4558
  const parse_1 = __webpack_require__(3662);
4553
4559
  const dom_1 = __webpack_require__(394);
4554
- exports.aside = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})aside(?!\S)([^\n]*)(?:$|\n)/, 300),
4560
+ exports.aside = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})aside(?!\S)([^\n]*)(?:$|\n)/y, 300),
4555
4561
  // Bug: Type mismatch between outer and inner.
4556
4562
  ([body, overflow, closer, opener, delim, param], context) => {
4557
4563
  if (!closer || overflow || param.trimStart()) return [(0, dom_1.html)('pre', {
@@ -4578,7 +4584,7 @@ exports.aside = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combina
4578
4584
  id: (0, indexee_1.identity)('index', context.id, heading),
4579
4585
  class: 'aside'
4580
4586
  }, [document, (0, dom_1.html)('h2', 'References'), references])];
4581
- }))));
4587
+ })));
4582
4588
 
4583
4589
  /***/ },
4584
4590
 
@@ -4598,8 +4604,8 @@ const mathblock_1 = __webpack_require__(4903);
4598
4604
  const util_1 = __webpack_require__(4992);
4599
4605
  const parse_1 = __webpack_require__(3662);
4600
4606
  const dom_1 = __webpack_require__(394);
4601
- const opener = /^(~{3,})(?:example\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/;
4602
- exports.example = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
4607
+ const opener = /(~{3,})(?:example\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/y;
4608
+ exports.example = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
4603
4609
  // Bug: Type mismatch between outer and inner.
4604
4610
  ([body, overflow, closer, opener, delim, type = 'markdown', param], context) => {
4605
4611
  if (!closer || overflow || param.trimStart()) return [(0, dom_1.html)('pre', {
@@ -4642,7 +4648,7 @@ exports.example = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combi
4642
4648
  ...(0, util_1.invalid)('example', 'type', 'Invalid example type')
4643
4649
  }, `${opener}${body}${closer}`)];
4644
4650
  }
4645
- }))));
4651
+ })));
4646
4652
 
4647
4653
  /***/ },
4648
4654
 
@@ -4666,7 +4672,7 @@ const table_1 = __webpack_require__(3646);
4666
4672
  const blockquote_1 = __webpack_require__(5885);
4667
4673
  const placeholder_1 = __webpack_require__(4091);
4668
4674
  const inline_1 = __webpack_require__(7973);
4669
- exports.segment = (0, combinator_1.block)((0, combinator_1.validate)(['[$', '$'], (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /^(?=\s).*\n/)), (0, combinator_1.union)([codeblock_1.segment, mathblock_1.segment, table_1.segment, blockquote_1.segment, placeholder_1.segment, (0, combinator_1.some)(source_1.contentline)])])));
4675
+ exports.segment = (0, combinator_1.block)((0, combinator_1.validate)(/\[?\$/y, (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /(?=\s).*\n/y)), (0, combinator_1.union)([codeblock_1.segment, mathblock_1.segment, table_1.segment, blockquote_1.segment, placeholder_1.segment, (0, combinator_1.some)(source_1.contentline)])])));
4670
4676
  exports.fig = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.verify)((0, combinator_1.convert)((source, context) => {
4671
4677
  // Bug: TypeScript
4672
4678
  const fence = (/^[^\n]*\n!?>+\s/.test(source) && source.match(/^~{3,}(?=[^\S\n]*$)/mg) || []).reduce((max, fence) => fence > max ? fence : max, '~~') + '~';
@@ -4674,7 +4680,7 @@ exports.fig = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment,
4674
4680
  context
4675
4681
  }) ? `${fence}figure ${source.replace(/^(.+\n.+\n)([\S\s]+?)\n?$/, '$1\n$2')}\n${fence}` : `${fence}figure ${source}\n\n${fence}`;
4676
4682
  }, (0, combinator_1.union)([figure_1.figure]), false), ([el]) => el.tagName === 'FIGURE')));
4677
- const parser = (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /^(?=\s).*\n/)), (0, combinator_1.line)((0, combinator_1.union)([inline_1.media, inline_1.shortmedia])), (0, combinator_1.some)(source_1.contentline)]);
4683
+ const parser = (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /(?=\s).*\n/y)), (0, combinator_1.line)((0, combinator_1.union)([inline_1.media, inline_1.lineshortmedia])), (0, combinator_1.some)(source_1.contentline)]);
4678
4684
 
4679
4685
  /***/ },
4680
4686
 
@@ -4691,7 +4697,7 @@ exports.figbase = void 0;
4691
4697
  const combinator_1 = __webpack_require__(3484);
4692
4698
  const label_1 = __webpack_require__(2178);
4693
4699
  const dom_1 = __webpack_require__(394);
4694
- exports.figbase = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^\[?\$-(?:[0-9]+\.)*0\]?[^\S\n]*(?!\S|\n[^\S\n]*\S)/, (0, combinator_1.line)((0, combinator_1.union)([label_1.label]))), ([el]) => {
4700
+ exports.figbase = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/\[?\$-(?:[0-9]+\.)*0\]?[^\S\n]*(?!\S|\n[^\S\n]*\S)/y, (0, combinator_1.line)((0, combinator_1.union)([label_1.label]))), ([el]) => {
4695
4701
  const label = el.getAttribute('data-label');
4696
4702
  const group = label.split('-', 1)[0];
4697
4703
  return [(0, dom_1.html)('figure', {
@@ -4731,14 +4737,14 @@ const visibility_1 = __webpack_require__(6364);
4731
4737
  const util_1 = __webpack_require__(4992);
4732
4738
  const memoize_1 = __webpack_require__(6925);
4733
4739
  const dom_1 = __webpack_require__(394);
4734
- exports.segment = (0, combinator_1.block)((0, combinator_1.match)(/^(~{3,})(?:figure[^\S\n])?(?=\[?\$)/, (0, memoize_1.memoize)(([, fence], closer = new RegExp(String.raw`^${fence}[^\S\n]*(?:$|\n)`)) => (0, combinator_1.close)((0, combinator_1.sequence)([source_1.contentline, (0, combinator_1.inits)([
4740
+ exports.segment = (0, combinator_1.block)((0, combinator_1.match)(/(~{3,})(?:figure[^\S\n])?(?=\[?\$)/y, (0, memoize_1.memoize)(([, fence], closer = new RegExp(String.raw`${fence}[^\S\n]*(?:$|\n)`, 'y')) => (0, combinator_1.close)((0, combinator_1.sequence)([source_1.contentline, (0, combinator_1.inits)([
4735
4741
  // All parsers which can include closing terms.
4736
4742
  (0, combinator_1.union)([codeblock_1.segment_, mathblock_1.segment_, table_2.segment_, blockquote_1.segment, placeholder_1.segment_, (0, combinator_1.some)(source_1.contentline, closer)]), source_1.emptyline, (0, combinator_1.union)([source_1.emptyline, (0, combinator_1.some)(source_1.contentline, closer)])])]), closer), ([, fence]) => fence.length, {})));
4737
- exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:\w+\s+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.sequence)([label_1.label, (0, source_1.str)(/^(?=\s).*\n/)])), (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([ulist_1.ulist, olist_1.olist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, example_1.example, table_2.table, blockquote_1.blockquote, placeholder_1.placeholder, (0, combinator_1.line)(inline_1.media), (0, combinator_1.line)(inline_1.shortmedia)])), source_1.emptyline, (0, combinator_1.block)((0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))))])]), false), ([label, param, content, ...caption]) => [(0, dom_1.html)('figure', attributes(label.getAttribute('data-label'), param, content, caption), [(0, dom_1.html)('figcaption', [(0, dom_1.html)('span', {
4743
+ exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:\w+\s+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.sequence)([label_1.label, (0, source_1.str)(/(?=\s).*\n/y)])), (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([ulist_1.ulist, olist_1.olist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, example_1.example, table_2.table, blockquote_1.blockquote, placeholder_1.placeholder, (0, combinator_1.line)(inline_1.media), (0, combinator_1.line)(inline_1.lineshortmedia)])), source_1.emptyline, (0, combinator_1.block)((0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))))])]), false), ([label, param, content, ...caption]) => [(0, dom_1.html)('figure', attributes(label.getAttribute('data-label'), param, content, caption), [(0, dom_1.html)('figcaption', [(0, dom_1.html)('span', {
4738
4744
  class: 'figindex'
4739
4745
  }), (0, dom_1.html)('span', {
4740
4746
  class: 'figtext'
4741
- }, (0, dom_1.defrag)(caption))]), (0, dom_1.html)('div', [content])])])), (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})(?:figure|\[?\$\S*)(?!\S)[^\n]*(?:$|\n)/, 300), ([body, overflow, closer, opener, delim], context) => {
4747
+ }, (0, dom_1.defrag)(caption))]), (0, dom_1.html)('div', [content])])])), (0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})(?:figure|\[?\$\S*)(?!\S)[^\n]*(?:$|\n)/y, 300), ([body, overflow, closer, opener, delim], context) => {
4742
4748
  const violation = !closer && ['fence', `Missing the closing delimiter "${delim}"`] || overflow && ['fence', `Invalid trailing line after the closing delimiter "${delim}"`] || !(0, label_1.segment)((0, parser_1.input)(opener.match(/^~+(?:figure[^\S\n]+)?(\[?\$\S+)/)?.[1] ?? '', {
4743
4749
  ...context
4744
4750
  })) && ['label', 'Invalid label'] || /^~+(?:figure[^\S\n]+)?(\[?\$\S+)[^\S\n]+\S/.test(opener) && ['argument', 'Invalid argument'] || ['content', 'Invalid content'];
@@ -4815,7 +4821,7 @@ const paragraph_1 = __webpack_require__(4330);
4815
4821
  const util_1 = __webpack_require__(4992);
4816
4822
  const array_1 = __webpack_require__(6876);
4817
4823
  const dom_1 = __webpack_require__(394);
4818
- exports.message = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})message\/(\S+)([^\n]*)(?:$|\n)/, 300),
4824
+ exports.message = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})message\/(\S+)([^\n]*)(?:$|\n)/y, 300),
4819
4825
  // Bug: Type mismatch between outer and inner.
4820
4826
  ([body, overflow, closer, opener, delim, type, param], context) => {
4821
4827
  if (!closer || overflow || param.trimStart()) return [(0, dom_1.html)('pre', {
@@ -4841,7 +4847,7 @@ exports.message = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0,
4841
4847
  }, (0, array_1.unshift)([(0, dom_1.html)('h1', title(type))], [...(0, segment_1.segment)(body)].reduce((acc, seg) => (0, array_1.push)(acc, (0, parser_1.eval)(content((0, parser_1.input)(seg, {
4842
4848
  ...context
4843
4849
  })), [])), [])))];
4844
- })));
4850
+ }));
4845
4851
  function title(type) {
4846
4852
  switch (type) {
4847
4853
  case 'warning':
@@ -4870,14 +4876,14 @@ exports.placeholder = exports.segment_ = exports.segment = void 0;
4870
4876
  const combinator_1 = __webpack_require__(3484);
4871
4877
  const util_1 = __webpack_require__(4992);
4872
4878
  const dom_1 = __webpack_require__(394);
4873
- const opener = /^(~{3,})(?!~)[^\n]*(?:$|\n)/;
4874
- exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300))));
4875
- exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false))), false);
4876
- exports.placeholder = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, Infinity), ([body, overflow, closer, opener, delim]) => [(0, dom_1.html)('pre', {
4879
+ const opener = /(~{3,})(?!~)[^\n]*(?:$|\n)/y;
4880
+ exports.segment = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300)));
4881
+ exports.segment_ = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false)), false);
4882
+ exports.placeholder = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, Infinity), ([body, overflow, closer, opener, delim]) => [(0, dom_1.html)('pre', {
4877
4883
  class: 'invalid',
4878
4884
  translate: 'no',
4879
4885
  ...(0, util_1.invalid)('extension', 'fence', !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument')
4880
- }, `${opener}${body}${overflow || closer}`)])));
4886
+ }, `${opener}${body}${overflow || closer}`)]));
4881
4887
 
4882
4888
  /***/ },
4883
4889
 
@@ -4900,10 +4906,10 @@ const util_1 = __webpack_require__(4992);
4900
4906
  const visibility_1 = __webpack_require__(6364);
4901
4907
  const array_1 = __webpack_require__(6876);
4902
4908
  const dom_1 = __webpack_require__(394);
4903
- const opener = /^(~{3,})table(?:\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/;
4904
- exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 10000))));
4905
- exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 10000, false))), false);
4906
- exports.table = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 10000),
4909
+ const opener = /(~{3,})table(?:\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/y;
4910
+ exports.segment = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 10000)));
4911
+ exports.segment_ = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 10000, false)), false);
4912
+ exports.table = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 10000),
4907
4913
  // Bug: Type mismatch between outer and inner.
4908
4914
  ([body, overflow, closer, opener, delim, type, param], context) => {
4909
4915
  if (!closer || overflow || param.trimStart()) return [(0, dom_1.html)('pre', {
@@ -4926,15 +4932,15 @@ exports.table = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, co
4926
4932
  ...(0, util_1.invalid)('table', 'argument', 'Invalid table type')
4927
4933
  }, `${opener}${body}${closer}`)];
4928
4934
  }
4929
- })));
4935
+ }));
4930
4936
  const parser = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([row])), rows => [(0, dom_1.html)('table', format(rows))])));
4931
4937
  const row = (0, combinator_1.lazy)(() => (0, combinator_1.dup)((0, combinator_1.fmap)((0, combinator_1.subsequence)([(0, combinator_1.dup)((0, combinator_1.union)([align])), (0, combinator_1.some)((0, combinator_1.union)([head, data, (0, combinator_1.some)(dataline, alignment), source_1.emptyline]))]), ns => !(0, alias_1.isArray)(ns[0]) ? (0, array_1.unshift)([[[]]], ns) : ns)));
4932
- const alignment = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)/;
4938
+ const alignment = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)/y;
4933
4939
  const align = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.union)([(0, source_1.str)(alignment)]), ([s]) => s.split('/').map(s => s.split(''))));
4934
- const delimiter = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|^[#:](?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/;
4935
- const head = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.medialink, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.media, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.shortmedia, /^\s*$/)), (0, combinator_1.open)(/^(?:\s*\n|\s)/, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => [(0, dom_1.html)('th', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false);
4936
- const data = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.medialink, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.media, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.shortmedia, /^\s*$/)), (0, combinator_1.open)(/^(?:\s*\n|\s)/, (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, util_1.lineable)((0, combinator_1.some)(inline_1.inline)))), true)])), true), ns => [(0, dom_1.html)('td', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false);
4937
- const dataline = (0, combinator_1.line)((0, combinator_1.rewrite)(source_1.contentline, (0, combinator_1.union)([(0, combinator_1.validate)(/^!+\s/, (0, combinator_1.convert)(source => `:${source}`, data, false)), (0, combinator_1.convert)(source => `: ${source}`, data, false)])));
4940
+ const delimiter = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|[#:](?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/y;
4941
+ const head = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/y), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/\s/y, (0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia]), /\s*$/y)), (0, combinator_1.open)(/(?:[^\S\n]*\n|\s)/y, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => [(0, dom_1.html)('th', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false);
4942
+ const data = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/y), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/\s/y, (0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia]), /\s*$/y)), (0, combinator_1.open)(/(?:[^\S\n]*\n|\s)/y, (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => [(0, dom_1.html)('td', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false);
4943
+ const dataline = (0, combinator_1.line)((0, combinator_1.rewrite)(source_1.contentline, (0, combinator_1.union)([(0, combinator_1.validate)(/!+\s/y, (0, combinator_1.convert)(source => `:${source}`, data, false)), (0, combinator_1.convert)(source => `: ${source}`, data, false)])));
4938
4944
  function attributes(source) {
4939
4945
  let [, rowspan = undefined, colspan = undefined, highlight = undefined, extension = undefined] = source.match(/^[#:](?:(\d+)?:(\d+)?)?(?:(!+)([+]?))?$/) ?? [];
4940
4946
  rowspan === '1' ? rowspan = undefined : undefined;
@@ -5150,14 +5156,14 @@ const source_1 = __webpack_require__(8745);
5150
5156
  const visibility_1 = __webpack_require__(6364);
5151
5157
  const util_1 = __webpack_require__(4992);
5152
5158
  const dom_1 = __webpack_require__(394);
5153
- exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('#', (0, combinator_1.focus)(/^#+[^\S\n]+\S[^\n]*(?:\n#+(?!\S)[^\n]*)*(?:$|\n)/, (0, combinator_1.some)((0, combinator_1.line)(({
5159
+ exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('#', (0, combinator_1.focus)(/#+[^\S\n]+\S[^\n]*(?:\n#+(?!\S)[^\n]*)*(?:$|\n)/y, (0, combinator_1.some)((0, combinator_1.line)(({
5154
5160
  context: {
5155
5161
  source
5156
5162
  }
5157
5163
  }) => [[source]])))));
5158
5164
  exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment,
5159
5165
  // その他の表示制御は各所のCSSで行う。
5160
- (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)(/^##+/), (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)]), ([h, ...ns], context) => [h.length <= 6 ? (0, dom_1.html)(`h${h.length}`, {
5166
+ (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)]), ([h, ...ns], context) => [h.length <= 6 ? (0, dom_1.html)(`h${h.length}`, {
5161
5167
  'data-index': (0, inline_1.dataindex)(ns)
5162
5168
  }, (0, dom_1.defrag)(ns)) : (0, dom_1.html)(`h6`, {
5163
5169
  class: 'invalid',
@@ -5184,8 +5190,8 @@ const source_1 = __webpack_require__(8745);
5184
5190
  const visibility_1 = __webpack_require__(6364);
5185
5191
  const util_1 = __webpack_require__(4992);
5186
5192
  const dom_1 = __webpack_require__(394);
5187
- exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^[-+*](?=[^\S\n]|\n[^\S\n]*\S)/, exports.ilist_)));
5188
- exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^[-+*](?:$|\s)/, (0, combinator_1.some)((0, combinator_1.recursion)(3 /* Recursion.listitem */, (0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/^[-+*](?:$|\s)/, (0, combinator_1.trim)((0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, util_1.lineable)((0, combinator_1.some)(inline_1.inline))))), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), exports.ilistitem), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])])))), es => [(0, dom_1.html)('ul', {
5193
+ exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/[-+*] /y, exports.ilist_)));
5194
+ exports.ilist_ = (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, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/[-+*](?:$|[ \n])/y, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), exports.ilistitem), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])])))), es => [(0, dom_1.html)('ul', {
5189
5195
  class: 'invalid',
5190
5196
  ...(0, util_1.invalid)('list', 'syntax', 'Use "-" instead of "+" or "*"')
5191
5197
  }, es)])));
@@ -5217,10 +5223,10 @@ exports.mathblock = exports.segment_ = exports.segment = void 0;
5217
5223
  const combinator_1 = __webpack_require__(3484);
5218
5224
  const util_1 = __webpack_require__(4992);
5219
5225
  const dom_1 = __webpack_require__(394);
5220
- const opener = /^(\${2,})(?!\$)([^\n]*)(?:$|\n)/;
5221
- exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300))));
5222
- exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false))), false);
5223
- exports.mathblock = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
5226
+ const opener = /(\${2,})(?!\$)([^\n]*)(?:$|\n)/y;
5227
+ exports.segment = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300)));
5228
+ exports.segment_ = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false)), false);
5229
+ exports.mathblock = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
5224
5230
  // Bug: Type mismatch between outer and inner.
5225
5231
  ([body, overflow, closer, opener, delim, param], {
5226
5232
  caches: {
@@ -5233,7 +5239,7 @@ exports.mathblock = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0,
5233
5239
  class: 'invalid',
5234
5240
  translate: 'no',
5235
5241
  ...(0, util_1.invalid)('mathblock', delim.length > 2 ? 'syntax' : !closer || overflow ? 'fence' : 'argument', delim.length > 2 ? 'Invalid syntax' : !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument')
5236
- }, `${opener}${body}${overflow || closer}`)])));
5242
+ }, `${opener}${body}${overflow || closer}`)]));
5237
5243
 
5238
5244
  /***/ },
5239
5245
 
@@ -5251,14 +5257,14 @@ const combinator_1 = __webpack_require__(3484);
5251
5257
  const inline_1 = __webpack_require__(7973);
5252
5258
  const util_1 = __webpack_require__(4992);
5253
5259
  const dom_1 = __webpack_require__(394);
5254
- exports.mediablock = (0, combinator_1.block)((0, combinator_1.validate)(['[!', '!'], (0, combinator_1.fmap)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.shortmedia])), (0, combinator_1.some)((0, combinator_1.line)((0, combinator_1.fallback)((0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.shortmedia]), ({
5260
+ exports.mediablock = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia])), (0, combinator_1.some)((0, combinator_1.line)((0, combinator_1.fallback)((0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia]), ({
5255
5261
  context: {
5256
5262
  source
5257
5263
  }
5258
5264
  }) => [[(0, dom_1.html)('span', {
5259
5265
  class: 'invalid',
5260
5266
  ...(0, util_1.invalid)('mediablock', 'syntax', 'Not media syntax')
5261
- }, source.replace('\n', ''))]])))]), ns => [(0, dom_1.html)('div', ns)])));
5267
+ }, source.replace('\n', ''))]])))]), ns => [(0, dom_1.html)('div', ns)]));
5262
5268
 
5263
5269
  /***/ },
5264
5270
 
@@ -5281,12 +5287,12 @@ const visibility_1 = __webpack_require__(6364);
5281
5287
  const memoize_1 = __webpack_require__(6925);
5282
5288
  const dom_1 = __webpack_require__(394);
5283
5289
  const openers = {
5284
- '.': /^([0-9]+|[a-z]+|[A-Z]+)(?:-(?!-)[0-9]*)*(?![^\S\n])\.?(?:$|\s)/,
5285
- '(': /^\(([0-9]*|[a-z]*)(?![^)\n])\)?(?:-(?!-)[0-9]*)*(?:$|\s)/
5290
+ '.': /([0-9]+|[a-z]+|[A-Z]+)(?:-(?=$|[0-9\n])[0-9]*)*(?:\.?(?:$|[\n])|\. )/y,
5291
+ '(': /\((?=$|[0-9a-z\n])([0-9]*|[a-z]*)(?=$|[)\n])\)?(?:-(?=$|[0-9\n])[0-9]*)*(?:$|[ \n])/y
5286
5292
  };
5287
- exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(new RegExp([/^([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*\.(?=[^\S\n]|\n[^\S\n]*\S)/.source, /^\(([0-9]+|[a-z]+)\)(?:-[0-9]+)*(?=[^\S\n]|\n[^\S\n]*\S)/.source].join('|')), exports.olist_)));
5293
+ exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(new RegExp([/([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*\. /y.source, /\(([0-9]+|[a-z]+)\)(?:-[0-9]+)* /y.source].join('|'), 'y'), exports.olist_)));
5288
5294
  exports.olist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.match)(openers['.'], (0, memoize_1.memoize)(ms => list(type(ms[1]), '.'), ms => idx(ms[1]), [])), (0, combinator_1.match)(openers['('], (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => idx(ms[1]), []))])));
5289
- const list = (type, form) => (0, combinator_1.fmap)((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)(heads[form], (0, combinator_1.subsequence)([ulist_1.checkbox, (0, combinator_1.trim)((0, visibility_1.visualize)((0, util_1.lineable)((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)([ulist_1.ulist_, exports.olist_, ilist_1.ilist_]))]), ilist_1.ilistitem), ns => [(0, dom_1.html)('li', {
5295
+ const list = (type, form) => (0, combinator_1.fmap)((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)(heads[form], (0, combinator_1.subsequence)([ulist_1.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)([ulist_1.ulist_, exports.olist_, ilist_1.ilist_]))]), ilist_1.ilistitem), ns => [(0, dom_1.html)('li', {
5290
5296
  'data-index': (0, inline_1.dataindex)(ns),
5291
5297
  'data-marker': ns.shift() || undefined
5292
5298
  }, (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))]))]))), es => [format((0, dom_1.html)('ol', es), type, form)]);
@@ -5347,15 +5353,15 @@ function style(type) {
5347
5353
  function pattern(type) {
5348
5354
  switch (type) {
5349
5355
  case 'i':
5350
- return /^\(?i[).]?$/;
5356
+ return /\(?i[).]?$/y;
5351
5357
  case 'a':
5352
- return /^\(?a[).]?$/;
5358
+ return /\(?a[).]?$/y;
5353
5359
  case 'I':
5354
- return /^\(?I[).]?$/;
5360
+ return /\(?I[).]?$/y;
5355
5361
  case 'A':
5356
- return /^\(?A[).]?$/;
5362
+ return /\(?A[).]?$/y;
5357
5363
  default:
5358
- return /^\(?[01][).]?$/;
5364
+ return /\(?[01][).]?$/y;
5359
5365
  }
5360
5366
  }
5361
5367
  function format(list, type, form) {
@@ -5404,7 +5410,7 @@ Object.defineProperty(exports, "__esModule", ({
5404
5410
  exports.pagebreak = void 0;
5405
5411
  const combinator_1 = __webpack_require__(3484);
5406
5412
  const dom_1 = __webpack_require__(394);
5407
- exports.pagebreak = (0, combinator_1.block)((0, combinator_1.line)((0, combinator_1.focus)(/^={3,}[^\S\n]*(?:$|\n)/, () => [[(0, dom_1.html)('hr')]])));
5413
+ exports.pagebreak = (0, combinator_1.block)((0, combinator_1.line)((0, combinator_1.focus)(/={3,}[^\S\n]*(?:$|\n)/y, () => [[(0, dom_1.html)('hr')]])));
5408
5414
 
5409
5415
  /***/ },
5410
5416
 
@@ -5420,10 +5426,9 @@ Object.defineProperty(exports, "__esModule", ({
5420
5426
  exports.paragraph = void 0;
5421
5427
  const combinator_1 = __webpack_require__(3484);
5422
5428
  const inline_1 = __webpack_require__(7973);
5423
- const util_1 = __webpack_require__(4992);
5424
5429
  const visibility_1 = __webpack_require__(6364);
5425
5430
  const dom_1 = __webpack_require__(394);
5426
- exports.paragraph = (0, combinator_1.block)((0, combinator_1.fmap)((0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, util_1.lineable)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), ns => [(0, dom_1.html)('p', (0, dom_1.defrag)(ns))]));
5431
+ exports.paragraph = (0, combinator_1.block)((0, combinator_1.fmap)((0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline])))), ns => [(0, dom_1.html)('p', (0, dom_1.defrag)(ns))]));
5427
5432
 
5428
5433
  /***/ },
5429
5434
 
@@ -5445,8 +5450,8 @@ const source_1 = __webpack_require__(8745);
5445
5450
  const util_1 = __webpack_require__(4992);
5446
5451
  const visibility_1 = __webpack_require__(6364);
5447
5452
  const dom_1 = __webpack_require__(394);
5448
- const delimiter = new RegExp(`${cite_1.syntax.source}|${quote_1.syntax.source}`);
5449
- exports.reply = (0, combinator_1.block)((0, combinator_1.validate)(cite_1.syntax, (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([cite_1.cite, quote_1.quote, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, delimiter), (0, visibility_1.visualize)((0, util_1.lineable)((0, combinator_1.some)(inline_1.inline), 1)))])), ns => [(0, dom_1.html)('p', (0, visibility_1.trimBlankNodeEnd)((0, dom_1.defrag)(ns)))])));
5453
+ const delimiter = new RegExp(`${cite_1.syntax.source}|${quote_1.syntax.source}`, 'y');
5454
+ exports.reply = (0, combinator_1.block)((0, combinator_1.validate)(cite_1.syntax, (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([cite_1.cite, quote_1.quote, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, delimiter), (0, visibility_1.visualize)((0, util_1.linearize)((0, combinator_1.some)(inline_1.inline), 1)))])), ns => [(0, dom_1.html)('p', (0, visibility_1.trimBlankNodeEnd)((0, dom_1.defrag)(ns)))])));
5450
5455
 
5451
5456
  /***/ },
5452
5457
 
@@ -5465,17 +5470,17 @@ const anchor_1 = __webpack_require__(8535);
5465
5470
  const source_1 = __webpack_require__(8745);
5466
5471
  const util_1 = __webpack_require__(4992);
5467
5472
  const dom_1 = __webpack_require__(394);
5468
- exports.syntax = /^>*(?=>>[^>\s]\S*[^\S\n]*(?:$|\n))/;
5469
- exports.cite = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.validate)('>>', (0, combinator_1.open)((0, source_1.str)(exports.syntax), (0, combinator_1.union)([anchor_1.anchor,
5473
+ exports.syntax = />*(?=>>[^>\s]\S*[^\S\n]*(?:$|\n))/y;
5474
+ exports.cite = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(exports.syntax), (0, combinator_1.union)([anchor_1.anchor,
5470
5475
  // Subject page representation.
5471
5476
  // リンクの実装は後で検討
5472
- (0, combinator_1.focus)(/^>>#\S*(?=\s*$)/, ({
5477
+ (0, combinator_1.focus)(/>>#\S*(?=\s*$)/y, ({
5473
5478
  context: {
5474
5479
  source
5475
5480
  }
5476
5481
  }) => [[(0, dom_1.html)('a', {
5477
5482
  class: 'anchor'
5478
- }, source)]]), (0, combinator_1.focus)(/^>>https?:\/\/\S+(?=\s*$)/, ({
5483
+ }, source)]]), (0, combinator_1.focus)(/>>https?:\/\/\S+(?=\s*$)/y, ({
5479
5484
  context: {
5480
5485
  source
5481
5486
  }
@@ -5483,11 +5488,11 @@ exports.cite = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.va
5483
5488
  class: 'anchor',
5484
5489
  href: source.slice(2).trimEnd(),
5485
5490
  target: '_blank'
5486
- }, source)]]), (0, combinator_1.focus)(/^>>.+(?=\s*$)/, ({
5491
+ }, source)]]), (0, combinator_1.focus)(/>>.+(?=\s*$)/y, ({
5487
5492
  context: {
5488
5493
  source
5489
5494
  }
5490
- }) => [[source]])]))), ([quotes, node]) => [(0, dom_1.html)('span', typeof node === 'object' ? {
5495
+ }) => [[source]])])), ([quotes, node]) => [(0, dom_1.html)('span', typeof node === 'object' ? {
5491
5496
  class: 'cite'
5492
5497
  } : {
5493
5498
  class: 'cite invalid',
@@ -5512,11 +5517,12 @@ const combinator_1 = __webpack_require__(3484);
5512
5517
  const math_1 = __webpack_require__(2962);
5513
5518
  const autolink_1 = __webpack_require__(8072);
5514
5519
  const source_1 = __webpack_require__(8745);
5520
+ const util_1 = __webpack_require__(4992);
5515
5521
  const dom_1 = __webpack_require__(394);
5516
- exports.syntax = /^>+[^\S\n]/;
5517
- exports.quote = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)('>', (0, combinator_1.rewrite)((0, combinator_1.some)((0, combinator_1.validate)(exports.syntax, source_1.anyline)), (0, combinator_1.convert)(source => source.replace(/(?<=^>+[^\S\n])/mg, '\r').replace(/\n$/, ''), (0, combinator_1.some)((0, combinator_1.union)([
5522
+ exports.syntax = />+[^\S\n]/y;
5523
+ exports.quote = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.some)((0, combinator_1.validate)(exports.syntax, source_1.anyline)), (0, util_1.linearize)((0, combinator_1.convert)(source => source.replace(/(?<=^>+[^\S\n])/mg, '\r'), (0, combinator_1.some)((0, combinator_1.union)([
5518
5524
  // quote補助関数が残した数式をパースする。
5519
- math_1.math, autolink_1.autolink, source_1.linebreak, source_1.unescsource])), false))), ns => [(0, dom_1.html)('span', {
5525
+ math_1.math, autolink_1.autolink, source_1.linebreak, source_1.unescsource])), false), -1)), ns => [(0, dom_1.html)('span', {
5520
5526
  class: 'quote'
5521
5527
  }, (0, dom_1.defrag)(ns)), (0, dom_1.html)('br')]), false));
5522
5528
 
@@ -5537,13 +5543,13 @@ const autolink_1 = __webpack_require__(1671);
5537
5543
  const source_1 = __webpack_require__(8745);
5538
5544
  const util_1 = __webpack_require__(4992);
5539
5545
  const dom_1 = __webpack_require__(394);
5540
- exports.sidefence = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.focus)(/^(?=\|+(?:[^\S\n]|\n\|))(?:\|+(?:[^\S\n][^\n]*)?(?:$|\n))+$/, (0, combinator_1.union)([source]), false), ([el]) => [(0, dom_1.define)(el, {
5546
+ exports.sidefence = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.focus)(/(?=\|+(?:[^\S\n]|\n\|))(?:\|+(?:[^\S\n][^\n]*)?(?:$|\n))+$/y, (0, combinator_1.union)([source]), false), ([el]) => [(0, dom_1.define)(el, {
5541
5547
  class: 'invalid',
5542
5548
  ...(0, util_1.invalid)('sidefence', 'syntax', 'Reserved syntax')
5543
5549
  })])));
5544
- const opener = /^(?=\|\|+(?:$|\s))/;
5550
+ const opener = /(?=\|\|+(?:$|\s))/y;
5545
5551
  const unindent = source => source.replace(/(?<=^|\n)\|(?:[^\S\n]|(?=\|*(?:$|\s)))|\n$/g, '');
5546
- const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.union)([(0, combinator_1.focus)(/^(?:\|\|+(?:[^\S\n][^\n]*)?(?:$|\n))+/, (0, combinator_1.convert)(unindent, source, false, true), false), (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 => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))]), false, true))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
5552
+ const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.union)([(0, combinator_1.focus)(/(?:\|\|+(?:[^\S\n][^\n]*)?(?:$|\n))+/y, (0, combinator_1.convert)(unindent, source, false, true), false), (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 => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))]), false, true))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
5547
5553
 
5548
5554
  /***/ },
5549
5555
 
@@ -5565,8 +5571,8 @@ const util_1 = __webpack_require__(4992);
5565
5571
  const duff_1 = __webpack_require__(9202);
5566
5572
  const array_1 = __webpack_require__(6876);
5567
5573
  const dom_1 = __webpack_require__(394);
5568
- exports.table = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^\|[^\n]*(?:\n\|[^\n]*){2}/, (0, combinator_1.sequence)([row((0, combinator_1.some)(head), true), row((0, combinator_1.some)(align), false), (0, combinator_1.some)(row((0, combinator_1.some)(data), true))])), rows => [(0, dom_1.html)('table', [(0, dom_1.html)('thead', [rows.shift()]), (0, dom_1.html)('tbody', format(rows))])])));
5569
- const row = (parser, optional) => (0, combinator_1.fallback)((0, combinator_1.fmap)((0, combinator_1.line)((0, combinator_1.surround)(/^(?=\|)/, (0, combinator_1.some)((0, combinator_1.union)([parser])), /^[|\\]?\s*$/, optional)), es => [(0, dom_1.html)('tr', es)]), (0, combinator_1.rewrite)(source_1.contentline, ({
5574
+ exports.table = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/\|[^\n]*(?:\n\|[^\n]*){2}/y, (0, combinator_1.sequence)([row((0, combinator_1.some)(head), true), row((0, combinator_1.some)(align), false), (0, combinator_1.some)(row((0, combinator_1.some)(data), true))])), rows => [(0, dom_1.html)('table', [(0, dom_1.html)('thead', [rows.shift()]), (0, dom_1.html)('tbody', format(rows))])])));
5575
+ const row = (parser, optional) => (0, combinator_1.fallback)((0, combinator_1.fmap)((0, combinator_1.line)((0, combinator_1.surround)(/(?=\|)/y, (0, combinator_1.some)((0, combinator_1.union)([parser])), /[|\\]?\s*$/y, optional)), es => [(0, dom_1.html)('tr', es)]), (0, combinator_1.rewrite)(source_1.contentline, ({
5570
5576
  context: {
5571
5577
  source
5572
5578
  }
@@ -5574,16 +5580,16 @@ const row = (parser, optional) => (0, combinator_1.fallback)((0, combinator_1.fm
5574
5580
  class: 'invalid',
5575
5581
  ...(0, util_1.invalid)('table-row', 'syntax', 'Missing the start symbol of the table row')
5576
5582
  }, [(0, dom_1.html)('td', source.replace('\n', ''))])]]));
5577
- const align = (0, combinator_1.fmap)((0, combinator_1.open)('|', (0, combinator_1.union)([(0, combinator_1.focus)(/^:-+:?/, ({
5583
+ const align = (0, combinator_1.fmap)((0, combinator_1.open)('|', (0, combinator_1.union)([(0, combinator_1.focus)(/:-+:?/y, ({
5578
5584
  context: {
5579
5585
  source
5580
5586
  }
5581
- }) => [[source.at(-1) === ':' ? 'center' : 'start']], false), (0, combinator_1.focus)(/^-+:?/, ({
5587
+ }) => [[source.at(-1) === ':' ? 'center' : 'start']], false), (0, combinator_1.focus)(/-+:?/y, ({
5582
5588
  context: {
5583
5589
  source
5584
5590
  }
5585
5591
  }) => [[source.at(-1) === ':' ? 'end' : '']], false)])), ns => [(0, dom_1.html)('td', (0, dom_1.defrag)(ns))]);
5586
- const cell = (0, combinator_1.surround)(/^\|\s*(?=\S)/, (0, combinator_1.trimStart)((0, combinator_1.union)([(0, combinator_1.close)(inline_1.medialink, /^\s*(?=\||$)/), (0, combinator_1.close)(inline_1.media, /^\s*(?=\||$)/), (0, combinator_1.close)(inline_1.shortmedia, /^\s*(?=\||$)/), (0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline, /^\|/, [[/^[|\\]?\s*$/, 9]]))])), /^[^|]*/, true);
5592
+ const cell = (0, combinator_1.surround)(/\|\s*(?=\S)/y, (0, combinator_1.union)([(0, combinator_1.close)(inline_1.medialink, /\s*(?=\||$)/y), (0, combinator_1.close)(inline_1.media, /\s*(?=\||$)/y), (0, combinator_1.close)(inline_1.shortmedia, /\s*(?=\||$)/y), (0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline, /\|/y, [[/[|\\]?\s*$/y, 9]]))]), /[^|]*/y, true);
5587
5593
  const head = (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('th', (0, dom_1.defrag)(ns))]);
5588
5594
  const data = (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('td', (0, dom_1.defrag)(ns))]);
5589
5595
  function format(rows) {
@@ -5616,15 +5622,14 @@ const combinator_1 = __webpack_require__(3484);
5616
5622
  const olist_1 = __webpack_require__(7697);
5617
5623
  const ilist_1 = __webpack_require__(4223);
5618
5624
  const inline_1 = __webpack_require__(7973);
5619
- const util_1 = __webpack_require__(4992);
5620
5625
  const visibility_1 = __webpack_require__(6364);
5621
5626
  const array_1 = __webpack_require__(6876);
5622
5627
  const dom_1 = __webpack_require__(394);
5623
- exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^-(?=[^\S\n]|\n[^\S\n]*\S)/, exports.ulist_)));
5624
- exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^-(?=$|\s)/, (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)(/^-(?:$|\s)/, (0, combinator_1.subsequence)([exports.checkbox, (0, combinator_1.trim)((0, visibility_1.visualize)((0, util_1.lineable)((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 => [(0, dom_1.html)('li', {
5628
+ exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/- /y, exports.ulist_)));
5629
+ 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 => [(0, dom_1.html)('li', {
5625
5630
  'data-index': (0, inline_1.dataindex)(ns)
5626
5631
  }, (0, dom_1.defrag)(fillFirstLine(ns)))]))])))), es => [format((0, dom_1.html)('ul', es))])));
5627
- exports.checkbox = (0, combinator_1.focus)(/^\[[xX ]\](?=$|\s)/, ({
5632
+ exports.checkbox = (0, combinator_1.focus)(/\[[xX ]\](?=$|[ \n])/y, ({
5628
5633
  context: {
5629
5634
  source
5630
5635
  }
@@ -5660,7 +5665,7 @@ const source_1 = __webpack_require__(8745);
5660
5665
  const util_1 = __webpack_require__(4992);
5661
5666
  const normalize_1 = __webpack_require__(4490);
5662
5667
  const dom_1 = __webpack_require__(394);
5663
- exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/^---+[^\S\v\f\r\n]*\r?\n[^\S\n]*(?=\S)/, (0, combinator_1.inits)([(0, combinator_1.rewrite)(({
5668
+ exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+[^\S\v\f\r\n]*\r?\n[^\S\n]*(?=\S)/y, (0, combinator_1.inits)([(0, combinator_1.rewrite)(({
5664
5669
  context
5665
5670
  }) => {
5666
5671
  const {
@@ -5674,7 +5679,7 @@ exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/^---+[
5674
5679
  return [[]];
5675
5680
  }, (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(({
5676
5681
  context
5677
- }) => context.header ?? true, (0, combinator_1.focus)(/^---[^\S\v\f\r\n]*\r?\n(?:[A-Za-z][0-9A-Za-z]*(?:-[A-Za-z][0-9A-Za-z]*)*:[ \t]+\S[^\v\f\r\n]*\r?\n){1,100}---[^\S\v\f\r\n]*(?:$|\r?\n)/, (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])), es => [(0, dom_1.html)('aside', {
5682
+ }) => context.header ?? true, (0, combinator_1.focus)(/---[^\S\v\f\r\n]*\r?\n(?:[A-Za-z][0-9A-Za-z]*(?:-[A-Za-z][0-9A-Za-z]*)*:[ \t]+\S[^\v\f\r\n]*\r?\n){1,100}---[^\S\v\f\r\n]*(?:$|\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])), es => [(0, dom_1.html)('aside', {
5678
5683
  class: 'header'
5679
5684
  }, [(0, dom_1.html)('details', {
5680
5685
  open: ''
@@ -5691,7 +5696,7 @@ exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/^---+[
5691
5696
  translate: 'no',
5692
5697
  ...(0, util_1.invalid)('header', 'syntax', 'Invalid syntax')
5693
5698
  }, (0, normalize_1.normalize)(source.slice(position)))]];
5694
- }]))), (0, combinator_1.clear)((0, source_1.str)(/^[^\S\v\f\r\n]*\r?\n/))])));
5699
+ }]))), (0, combinator_1.clear)((0, source_1.str)(/[^\S\v\f\r\n]*\r?\n/y))])));
5695
5700
  const field = (0, combinator_1.line)(({
5696
5701
  context: {
5697
5702
  source,
@@ -5722,7 +5727,7 @@ const field = (0, combinator_1.line)(({
5722
5727
  Object.defineProperty(exports, "__esModule", ({
5723
5728
  value: true
5724
5729
  }));
5725
- exports.shortmedia = exports.media = exports.medialink = exports.dataindex = exports.indexer = exports.indexee = exports.inline = void 0;
5730
+ exports.lineshortmedia = exports.shortmedia = exports.media = exports.medialink = exports.dataindex = exports.indexer = exports.indexee = exports.inline = void 0;
5726
5731
  const combinator_1 = __webpack_require__(3484);
5727
5732
  const annotation_1 = __webpack_require__(4045);
5728
5733
  const reference_1 = __webpack_require__(9047);
@@ -5756,19 +5761,19 @@ exports.inline = (0, combinator_1.lazy)(() => (0, combinator_1.union)([input =>
5756
5761
  if (position === source.length) return;
5757
5762
  switch (source.slice(position, position + 2)) {
5758
5763
  case '((':
5759
- return (0, annotation_1.annotation)(input);
5764
+ return (0, annotation_1.annotation)(input) || (0, bracket_1.bracket)(input);
5760
5765
  case '[[':
5761
- return (0, reference_1.reference)(input) || (0, link_1.textlink)(input);
5766
+ return (0, reference_1.reference)(input) || (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
5762
5767
  case '{{':
5763
- return (0, template_1.template)(input);
5768
+ return (0, template_1.template)(input) || (0, bracket_1.bracket)(input);
5764
5769
  case '[%':
5765
- return (0, remark_1.remark)(input) || (0, link_1.textlink)(input);
5770
+ return (0, remark_1.remark)(input) || (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
5766
5771
  case '[#':
5767
5772
  case '[$':
5768
5773
  case '[:':
5769
5774
  case '[^':
5770
5775
  case '[|':
5771
- return (0, extension_1.extension)(input) || (0, link_1.textlink)(input);
5776
+ return (0, extension_1.extension)(input) || (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
5772
5777
  case '${':
5773
5778
  return (0, math_1.math)(input);
5774
5779
  case '++':
@@ -5784,9 +5789,9 @@ exports.inline = (0, combinator_1.lazy)(() => (0, combinator_1.union)([input =>
5784
5789
  }
5785
5790
  switch (source[position]) {
5786
5791
  case '[':
5787
- return (0, link_1.textlink)(input) || (0, ruby_1.ruby)(input);
5792
+ return (0, link_1.textlink)(input) || (0, ruby_1.ruby)(input) || (0, bracket_1.bracket)(input);
5788
5793
  case '{':
5789
- return (0, link_1.textlink)(input);
5794
+ return (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
5790
5795
  case '<':
5791
5796
  return (0, html_1.html)(input);
5792
5797
  case '$':
@@ -5797,8 +5802,14 @@ exports.inline = (0, combinator_1.lazy)(() => (0, combinator_1.union)([input =>
5797
5802
  return (0, emphasis_1.emphasis)(input) || stars(input);
5798
5803
  case '&':
5799
5804
  return (0, htmlentity_1.htmlentity)(input);
5800
- }
5801
- }, bracket_1.bracket, autolink_1.autolink, source_1.text]));
5805
+ case '(':
5806
+ case '(':
5807
+ case '[':
5808
+ case '{':
5809
+ case '"':
5810
+ return (0, bracket_1.bracket)(input);
5811
+ }
5812
+ }, autolink_1.autolink, source_1.text]));
5802
5813
  var indexee_1 = __webpack_require__(7610);
5803
5814
  Object.defineProperty(exports, "indexee", ({
5804
5815
  enumerable: true,
@@ -5841,6 +5852,12 @@ Object.defineProperty(exports, "shortmedia", ({
5841
5852
  return shortmedia_1.shortmedia;
5842
5853
  }
5843
5854
  }));
5855
+ Object.defineProperty(exports, "lineshortmedia", ({
5856
+ enumerable: true,
5857
+ get: function () {
5858
+ return shortmedia_1.lineshortmedia;
5859
+ }
5860
+ }));
5844
5861
 
5845
5862
  /***/ },
5846
5863
 
@@ -5860,7 +5877,7 @@ const visibility_1 = __webpack_require__(6364);
5860
5877
  const dom_1 = __webpack_require__(394);
5861
5878
  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 ? [[(0, dom_1.html)('sup', {
5862
5879
  class: 'annotation'
5863
- }, [(0, dom_1.html)('span', (0, dom_1.defrag)((0, visibility_1.trimBlankNodeEnd)(ns)))])]] : undefined, undefined, [3 | 16 /* Backtrack.doublebracket */, 1 | 8 /* Backtrack.bracket */])));
5880
+ }, [(0, dom_1.html)('span', (0, dom_1.defrag)((0, visibility_1.trimBlankNodeEnd)(ns)))])]] : undefined, undefined, [1 | 64 /* Backtrack.bracket */, 3 | 32 /* Backtrack.doublebracket */])));
5864
5881
 
5865
5882
  /***/ },
5866
5883
 
@@ -5883,18 +5900,13 @@ const hashtag_1 = __webpack_require__(5764);
5883
5900
  const hashnum_1 = __webpack_require__(8684);
5884
5901
  const anchor_1 = __webpack_require__(8535);
5885
5902
  const source_1 = __webpack_require__(8745);
5886
- const util_1 = __webpack_require__(4992);
5887
- exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/^(?:[@#>0-9a-z]|\S#|[0-9a-z]>|[\r\n]!?https?:\/\/)/iu, (0, combinator_1.state)(~1 /* State.autolink */, (0, combinator_1.union)([(0, combinator_1.some)((0, combinator_1.union)([url_1.lineurl])), (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([url_1.url, email_1.email,
5903
+ exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(new RegExp([/(?<![0-9a-z])@/yi.source, /(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yiu.source, /(?<![0-9a-z])>>/yi.source, /(?<![0-9a-z][.+-]?)!?[0-9a-z]/yi.source].join('|').replace(/emoji/g, hashtag_1.emoji), 'yiu'), (0, combinator_1.state)(~1 /* State.autolink */, (0, combinator_1.union)([url_1.lineurl, url_1.url, email_1.email,
5888
5904
  // Escape unmatched email-like strings.
5889
- (0, source_1.str)(/^[0-9a-z]+(?:[_.+-][0-9a-z]+|@(?=@))*/i), channel_1.channel, account_1.account,
5905
+ (0, source_1.str)(/[0-9a-z]+(?:[_.+-][0-9a-z]+[:@]?|:|@(?=@))*/yi), channel_1.channel, account_1.account,
5890
5906
  // Escape unmatched account-like strings.
5891
- (0, source_1.str)(/^@+(?:[0-9a-z]+(?:[_.+-][0-9a-z]+)*)?/i),
5892
- // Escape invalid leading characters.
5893
- (0, source_1.str)(new RegExp(/^(?:[^\p{C}\p{S}\p{P}\s]|emoji)(?=#)/u.source.replace('emoji', hashtag_1.emoji), 'u')), hashtag_1.hashtag, hashnum_1.hashnum,
5907
+ (0, source_1.str)(/@+(?:[0-9a-z]+(?:[_.+-][0-9a-z]+)*)?/yi), hashtag_1.hashtag, hashnum_1.hashnum,
5894
5908
  // Escape unmatched hashtag-like strings.
5895
- (0, source_1.str)(new RegExp(/^#+(?:(?:[^\p{C}\p{S}\p{P}\s]|emoji)+(?:['_.+-](?:[^\p{C}\p{S}\p{P}\s]|emoji)+)*)?/u.source.replace(/emoji/g, hashtag_1.emoji), 'u')),
5896
- // Escape invalid leading characters.
5897
- (0, source_1.str)(/^[0-9a-z](?=>)/iu), anchor_1.anchor])), ns => ns.length === 1 ? ns : [(0, util_1.stringify)(ns)])]))));
5909
+ (0, source_1.str)(new RegExp(/#+(?:(?:[^\p{C}\p{S}\p{P}\s]|emoji)+(?:['_.+-](?:[^\p{C}\p{S}\p{P}\s]|emoji)+)*)?/yu.source.replace(/emoji/g, hashtag_1.emoji), 'yu')), anchor_1.anchor]))));
5898
5910
 
5899
5911
  /***/ },
5900
5912
 
@@ -5913,7 +5925,7 @@ const link_1 = __webpack_require__(3628);
5913
5925
  const source_1 = __webpack_require__(8745);
5914
5926
  const dom_1 = __webpack_require__(394);
5915
5927
  // https://example/@user must be a user page or a redirect page going there.
5916
- exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)('@', (0, combinator_1.tails)([(0, source_1.str)(/^[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])?)*\//i), (0, source_1.str)(/^[a-z][0-9a-z]*(?:[-.][0-9a-z]+)*/i)])), (0, combinator_1.union)([(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}`} }`, link_1.unsafelink, false), ([el]) => [(0, dom_1.define)(el, {
5928
+ exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9a-z])@/yi, (0, combinator_1.tails)([(0, source_1.str)(/[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), (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.union)([(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}`} }`, link_1.unsafelink, false), ([el]) => [(0, dom_1.define)(el, {
5917
5929
  class: 'account'
5918
5930
  })]))), ({
5919
5931
  context: {
@@ -5935,6 +5947,7 @@ Object.defineProperty(exports, "__esModule", ({
5935
5947
  exports.anchor = void 0;
5936
5948
  const combinator_1 = __webpack_require__(3484);
5937
5949
  const link_1 = __webpack_require__(3628);
5950
+ const source_1 = __webpack_require__(8745);
5938
5951
  const dom_1 = __webpack_require__(394);
5939
5952
  // Timeline(pseudonym): user/tid
5940
5953
  // Thread(anonymous): cid
@@ -5943,13 +5956,13 @@ const dom_1 = __webpack_require__(394);
5943
5956
  // cid: YYYY-MMDD-HHMM-SSmmm
5944
5957
  // 内部表現はUnixTimeに統一する(時系列順)
5945
5958
  // 外部表現は投稿ごとに投稿者の投稿時のタイムゾーンに統一する(非時系列順)
5946
- exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('>>', (0, combinator_1.focus)(/^>>(?:[a-z][0-9a-z]*(?:-[0-9a-z]+)*\/)?[0-9a-z]+(?:-[0-9a-z]+)*(?![0-9a-z@#:])/i, (0, combinator_1.union)([(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)}`} }`, link_1.unsafelink, false), ([el]) => [(0, dom_1.define)(el, {
5959
+ exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9a-z])>>/yi, (0, source_1.str)(/(?:[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.union)([(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)}`} }`, link_1.unsafelink, false), ([el]) => [(0, dom_1.define)(el, {
5947
5960
  class: 'anchor'
5948
5961
  })]))), ({
5949
5962
  context: {
5950
5963
  source
5951
5964
  }
5952
- }) => [[source]]]))));
5965
+ }) => [[source]]])));
5953
5966
 
5954
5967
  /***/ },
5955
5968
 
@@ -5964,20 +5977,27 @@ Object.defineProperty(exports, "__esModule", ({
5964
5977
  }));
5965
5978
  exports.channel = void 0;
5966
5979
  const combinator_1 = __webpack_require__(3484);
5967
- const account_1 = __webpack_require__(4107);
5980
+ const link_1 = __webpack_require__(3628);
5968
5981
  const hashtag_1 = __webpack_require__(5764);
5969
- const util_1 = __webpack_require__(4992);
5982
+ const source_1 = __webpack_require__(8745);
5970
5983
  const dom_1 = __webpack_require__(394);
5971
5984
  // https://example/@user?ch=a+b must be a user channel page or a redirect page going there.
5972
- exports.channel = (0, combinator_1.validate)('@', (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.bind)((0, combinator_1.sequence)([account_1.account, (0, combinator_1.some)(hashtag_1.hashtag)]), es => {
5973
- const source = (0, util_1.stringify)(es);
5974
- const el = es[0];
5975
- const url = `${el.getAttribute('href')}?ch=${source.slice(source.indexOf('#') + 1).replace(/#/g, '+')}`;
5976
- return [[(0, dom_1.define)(el, {
5985
+ exports.channel = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.sequence)([(0, combinator_1.open)(/(?<![0-9a-z])@/yi, (0, combinator_1.tails)([(0, source_1.str)(/[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), (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.open)('#', (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))+(?![0-9a-z@]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('').replace(/emoji/g, hashtag_1.emoji), 'yu')), ([source]) => !/^[0-9]{1,4}$|^[0-9]{5}/.test(source)), 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.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1, source.indexOf('#')).replace('/', '/@')}` : `/${source.slice(0, source.indexOf('#'))}`} }`, link_1.unsafelink, false), ([el], {
5986
+ source,
5987
+ position,
5988
+ range = 0
5989
+ }) => {
5990
+ const src = source.slice(position - range, position);
5991
+ const url = `${el.getAttribute('href')}?ch=${src.slice(src.indexOf('#') + 1).replace(/#/g, '+')}`;
5992
+ return [(0, dom_1.define)(el, {
5977
5993
  class: 'channel',
5978
5994
  href: url
5979
- }, source)]];
5980
- })));
5995
+ }, src)];
5996
+ }))), ({
5997
+ context: {
5998
+ source
5999
+ }
6000
+ }) => [[source]]])));
5981
6001
 
5982
6002
  /***/ },
5983
6003
 
@@ -5995,7 +6015,7 @@ const combinator_1 = __webpack_require__(3484);
5995
6015
  const source_1 = __webpack_require__(8745);
5996
6016
  const dom_1 = __webpack_require__(394);
5997
6017
  // https://html.spec.whatwg.org/multipage/input.html
5998
- exports.email = (0, combinator_1.rewrite)((0, combinator_1.surround)((0, source_1.str)(/^[0-9a-z]/i), (0, combinator_1.verify)((0, source_1.str)(/^(?:[_.+-](?=[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])/i), ([source]) => source.length <= 255 - 1), '', false, undefined, undefined, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, ({
6018
+ 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), ([source]) => source.length <= 255), false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, ({
5999
6019
  context: {
6000
6020
  source
6001
6021
  }
@@ -6025,7 +6045,7 @@ const link_1 = __webpack_require__(3628);
6025
6045
  const hashtag_1 = __webpack_require__(5764);
6026
6046
  const source_1 = __webpack_require__(8745);
6027
6047
  const dom_1 = __webpack_require__(394);
6028
- exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, source_1.str)(new RegExp([/^[0-9]{1,9}(?![^\p{C}\p{S}\p{P}\s]|emoji)/u.source].join('').replace(/emoji/, hashtag_1.emoji), 'u'))), (0, combinator_1.union)([(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)} }`, link_1.unsafelink, false), ([el]) => [(0, dom_1.define)(el, {
6048
+ exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(new RegExp([/(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yiu.source].join('').replace(/emoji/g, hashtag_1.emoji), '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), 'yu')), false, [1 | 0 /* Backtrack.autolink */]), (0, combinator_1.union)([(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)} }`, link_1.unsafelink, false), ([el]) => [(0, dom_1.define)(el, {
6029
6049
  class: 'hashnum',
6030
6050
  href: null
6031
6051
  })]))), ({
@@ -6053,7 +6073,7 @@ const dom_1 = __webpack_require__(394);
6053
6073
  // https://example/hashtags/a must be a hashtag page or a redirect page going there.
6054
6074
  // https://github.com/tc39/proposal-regexp-unicode-property-escapes#matching-emoji
6055
6075
  exports.emoji = String.raw`\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F`;
6056
- exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, source_1.str)(new RegExp([/^(?!['_])(?=(?:[0-9]{1,9})?(?:[^\d\p{C}\p{S}\p{P}\s]|emoji|'(?=[0-9A-Za-z])|_(?=[^'\p{C}\p{S}\p{P}\s]|emoji)))/u.source, /(?:[^\p{C}\p{S}\p{P}\s]|emoji|'(?=[0-9A-Za-z])|_(?=[^'\p{C}\p{S}\p{P}\s]|emoji))+/u.source].join('').replace(/emoji/g, exports.emoji), 'u')), 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.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${`/hashtags/${source.slice(1)}`} }`, link_1.unsafelink, false), ([el]) => [(0, dom_1.define)(el, {
6076
+ exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(new RegExp([/(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yiu.source].join('').replace(/emoji/g, exports.emoji), '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))+(?![0-9a-z@#]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('').replace(/emoji/g, exports.emoji), 'yu')), ([source]) => !/^[0-9]{1,4}$|^[0-9]{5}/.test(source)), 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.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${`/hashtags/${source.slice(1)}`} }`, link_1.unsafelink, false), ([el]) => [(0, dom_1.define)(el, {
6057
6077
  class: 'hashtag'
6058
6078
  })]))), ({
6059
6079
  context: {
@@ -6076,18 +6096,16 @@ exports.lineurl = exports.url = void 0;
6076
6096
  const combinator_1 = __webpack_require__(3484);
6077
6097
  const link_1 = __webpack_require__(3628);
6078
6098
  const source_1 = __webpack_require__(8745);
6079
- exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['http://', 'https://'], (0, combinator_1.rewrite)((0, combinator_1.open)(/^https?:\/\/(?=[\x21-\x7E])/, (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.verify)(bracket, ns => ns.length > 0),
6080
- // 再帰に注意
6081
- (0, combinator_1.some)(source_1.unescsource, /^[-+*=~^_/,.;:!?]{2}|^[-+*=~^_,.;:!?]?(?=[\\"`|\[\](){}<>]|[^\x21-\x7E]|$)/)]), undefined, [[/^[^\x21-\x7E]|^\$/, 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))), ({
6099
+ exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9a-z][.+-]?)https?:\/\/(?=[\x21-\x7E])/y, (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.verify)(bracket, ns => ns.length > 0), (0, combinator_1.some)(source_1.unescsource, /([-+*=~^_/])\1|[,.;:!?]{2}|[-+*=~^_,.;:!?]?(?=[\\"`\[\](){}<>()[]{}|]|[^\x21-\x7E]|$)/y)]), 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))), ({
6082
6100
  context: {
6083
6101
  source
6084
6102
  }
6085
- }) => [[source]]]))));
6086
- exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.open)(source_1.linebreak, (0, combinator_1.focus)(/^!?https?:\/\/\S+(?=[^\S\n]*(?:$|\n))/, (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))), ({
6103
+ }) => [[source]]])));
6104
+ 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))), ({
6087
6105
  context: {
6088
6106
  source
6089
6107
  }
6090
- }) => [[source]]])])), false, [3 | 0 /* Backtrack.autolink */]));
6108
+ }) => [[source]]])])));
6091
6109
  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, () => [[]], [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, () => [[]], [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, () => [[]], [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, () => [[]], [3 | 0 /* Backtrack.autolink */])]));
6092
6110
 
6093
6111
  /***/ },
@@ -6110,7 +6128,7 @@ const array_1 = __webpack_require__(6876);
6110
6128
  const dom_1 = __webpack_require__(394);
6111
6129
  const indexA = /^[0-9A-Za-z]+(?:(?:[.-]|, )[0-9A-Za-z]+)*$/;
6112
6130
  const indexF = new RegExp(indexA.source.replace(', ', '[,、]').replace(/[09AZaz.]|\-(?!\w)/g, c => String.fromCodePoint(c.codePointAt(0) + 0xFEE0)));
6113
- exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(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], {
6131
+ exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/[([{([{"]/y, (0, combinator_1.union)([(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], {
6114
6132
  source,
6115
6133
  position,
6116
6134
  range = 0
@@ -6119,7 +6137,7 @@ exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, comb
6119
6137
  return indexA.test(str) ? [[as[0], str, cs[0]]] : [[(0, dom_1.html)('span', {
6120
6138
  class: 'paren'
6121
6139
  }, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))]];
6122
- }, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 | 8 /* Backtrack.bracket */]), (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], {
6140
+ }, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 | 64 /* Backtrack.bracket */]), (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], {
6123
6141
  source,
6124
6142
  position,
6125
6143
  range = 0
@@ -6137,24 +6155,24 @@ exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, comb
6137
6155
  } = context;
6138
6156
  const head = position - range;
6139
6157
  if (context.linebreak !== 0 || source[position] !== '{') {
6140
- (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head);
6158
+ (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
6141
6159
  } else {
6142
6160
  context.state ^= 8 /* State.link */;
6143
- const result = !(0, combinator_1.isBacktrack)(context, [1 | 64 /* Backtrack.link */]) ? (0, link_1.textlink)({
6161
+ const result = !(0, combinator_1.isBacktrack)(context, [1 | 16 /* Backtrack.link */]) ? (0, link_1.textlink)({
6144
6162
  context
6145
6163
  }) : undefined;
6146
6164
  context.position = position;
6147
6165
  if (!result) {
6148
- (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head);
6166
+ (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
6149
6167
  }
6150
6168
  context.state ^= 8 /* State.link */;
6151
6169
  context.range = range;
6152
6170
  }
6153
6171
  }
6154
6172
  return [(0, array_1.push)((0, array_1.unshift)(as, bs), cs)];
6155
- }, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 | 8 /* Backtrack.bracket */]), (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 = []]) => [(0, array_1.unshift)(as, bs)]), (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 = []]) => [(0, array_1.unshift)(as, bs)], [2 | 8 /* Backtrack.bracket */]), (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 = []]) => [(0, array_1.unshift)(as, bs)]),
6173
+ }, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 | 64 /* Backtrack.bracket */]), (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 = []]) => [(0, array_1.unshift)(as, bs)]), (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 = []]) => [(0, array_1.unshift)(as, bs)], [2 | 64 /* Backtrack.bracket */]), (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 = []]) => [(0, array_1.unshift)(as, bs)]),
6156
6174
  // 同一行内でしか閉じない以外括弧と同じ挙動
6157
- (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '"', [['"', 2, false]]))), (0, source_1.str)('"'), true, ([as, bs = [], cs], context) => context.linebreak === 0 ? [(0, array_1.push)((0, array_1.unshift)(as, bs), cs)] : (context.position -= 1, [(0, array_1.unshift)(as, bs)]), ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 | 8 /* Backtrack.bracket */])]));
6175
+ (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '"', [['"', 2, false]]))), (0, source_1.str)('"'), true, ([as, bs = [], cs], context) => context.linebreak === 0 ? [(0, array_1.push)((0, array_1.unshift)(as, bs), cs)] : (context.position -= 1, [(0, array_1.unshift)(as, bs)]), ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 | 64 /* Backtrack.bracket */])])));
6158
6176
 
6159
6177
  /***/ },
6160
6178
 
@@ -6171,12 +6189,12 @@ exports.code = void 0;
6171
6189
  const combinator_1 = __webpack_require__(3484);
6172
6190
  const util_1 = __webpack_require__(4992);
6173
6191
  const dom_1 = __webpack_require__(394);
6174
- exports.code = (0, combinator_1.open)(/^(?=`)/, (0, combinator_1.match)(/^(`+)(?!`)([^\n]*?)(?:((?<!`)\1(?!`))|(?=$|\n))/, ([whole, opener, body, closer]) => () => closer ? [[(0, dom_1.html)('code', {
6192
+ exports.code = (0, combinator_1.open)(/(?=`)/y, (0, combinator_1.match)(/(`+)(?!`)([^\n]*?)(?:((?<!`)\1(?!`))|(?=$|\n))/y, ([whole, opener, body, closer]) => () => closer ? [[(0, dom_1.html)('code', {
6175
6193
  'data-src': whole
6176
6194
  }, format(body))]] : body ? [[(0, dom_1.html)('code', {
6177
6195
  class: 'invalid',
6178
6196
  ...(0, util_1.invalid)('code', 'syntax', `Missing the closing symbol "${opener}"`)
6179
- }, whole)]] : [[opener]], true), false, [3 | 8 /* Backtrack.bracket */]);
6197
+ }, whole)]] : [[opener]], true), false, [3 | 64 /* Backtrack.bracket */]);
6180
6198
  function format(text) {
6181
6199
  return text.length > 2 && text[0] === ' ' && text[1] === '`' && text.at(-1) === ' ' ? text.slice(1, -1) : text;
6182
6200
  }
@@ -6199,7 +6217,7 @@ const visibility_1 = __webpack_require__(6364);
6199
6217
  const util_1 = __webpack_require__(4992);
6200
6218
  const array_1 = __webpack_require__(6876);
6201
6219
  const dom_1 = __webpack_require__(394);
6202
- exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('~~', (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)(exports.deletion, '~'), true)]))), '~~', false, ([, bs], {
6220
+ exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('~~', (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], {
6203
6221
  buffer
6204
6222
  }) => [(0, array_1.push)(buffer, bs)], ([, bs], {
6205
6223
  buffer
@@ -6219,13 +6237,12 @@ Object.defineProperty(exports, "__esModule", ({
6219
6237
  exports.emphasis = void 0;
6220
6238
  const combinator_1 = __webpack_require__(3484);
6221
6239
  const inline_1 = __webpack_require__(7973);
6222
- const emstrong_1 = __webpack_require__(365);
6223
6240
  const strong_1 = __webpack_require__(6591);
6224
6241
  const source_1 = __webpack_require__(8745);
6225
6242
  const visibility_1 = __webpack_require__(6364);
6226
6243
  const array_1 = __webpack_require__(6876);
6227
6244
  const dom_1 = __webpack_require__(394);
6228
- exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('*', '*'), (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, '*'), (0, combinator_1.union)([emstrong_1.emstrong, strong_1.strong, exports.emphasis]))]))))), (0, source_1.str)('*'), false, ([, bs]) => [[(0, dom_1.html)('em', (0, dom_1.defrag)(bs))]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)]));
6245
+ 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]) => [[(0, dom_1.html)('em', (0, dom_1.defrag)(bs))]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)]));
6229
6246
 
6230
6247
  /***/ },
6231
6248
 
@@ -6248,12 +6265,12 @@ const visibility_1 = __webpack_require__(6364);
6248
6265
  const util_1 = __webpack_require__(4992);
6249
6266
  const array_1 = __webpack_require__(6876);
6250
6267
  const dom_1 = __webpack_require__(394);
6251
- const substrong = (0, combinator_1.lazy)(() => (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, '*'), (0, combinator_1.union)([exports.emstrong, strong_1.strong, emphasis_1.emphasis]))])));
6252
- const subemphasis = (0, combinator_1.lazy)(() => (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, '*'), (0, combinator_1.union)([exports.emstrong, strong_1.strong, emphasis_1.emphasis]))])));
6268
+ const substrong = (0, combinator_1.lazy)(() => (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)])));
6269
+ const subemphasis = (0, combinator_1.lazy)(() => (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)])));
6253
6270
  // 開閉が明示的でない構文は開閉の不明確な記号による再帰的適用を行わず
6254
6271
  // 可能な限り早く閉じるよう解析しなければならない。
6255
6272
  // このため終端記号の後ろを見て終端を中止し同じ構文を再帰的に適用してはならない。
6256
- exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('***', (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, '*'), (0, combinator_1.union)([exports.emstrong, strong_1.strong, emphasis_1.emphasis]))])))), (0, source_1.str)(/^\*{1,3}/), false, ([, bs, cs], context) => {
6273
+ exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('***', (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) => {
6257
6274
  const {
6258
6275
  buffer
6259
6276
  } = context;
@@ -6400,7 +6417,7 @@ const array_1 = __webpack_require__(6876);
6400
6417
  const dom_1 = __webpack_require__(394);
6401
6418
  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 ? [[(0, dom_1.html)('a', {
6402
6419
  'data-index': dataindex(bs)
6403
- }, (0, dom_1.defrag)(bs))]] : undefined, undefined, [3 | 8 /* Backtrack.bracket */])), ns => {
6420
+ }, (0, dom_1.defrag)(bs))]] : undefined, undefined, [3 | 64 /* Backtrack.bracket */])), ns => {
6404
6421
  if (ns.length === 1) {
6405
6422
  const el = ns[0];
6406
6423
  return [(0, dom_1.define)(el, {
@@ -6413,13 +6430,13 @@ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(32 /*
6413
6430
  return ns;
6414
6431
  }
6415
6432
  })));
6416
- exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|', (0, combinator_1.surround)((0, source_1.str)(/^\|(?!\\?\s)/), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, (0, combinator_1.focus)(/^(?:[^\\[\](){}<>"$`\n]|\\[^\n]?)/, source_1.txt, false)]), ']'), /^(?=])/, false, ([, ns]) => {
6433
+ 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) => {
6417
6434
  const index = (0, indexee_1.identity)('index', undefined, ns.join(''))?.slice(7);
6418
- return index ? [[(0, dom_1.html)('span', {
6435
+ return index && context.linebreak === 0 ? [[(0, dom_1.html)('span', {
6419
6436
  class: 'indexer',
6420
6437
  'data-index': index
6421
6438
  })]] : undefined;
6422
- }, ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)])));
6439
+ }, ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)], [3 | 64 /* Backtrack.bracket */])));
6423
6440
  function dataindex(ns) {
6424
6441
  if (ns.length === 0) return;
6425
6442
  for (let i = ns.length; i--;) {
@@ -6589,10 +6606,10 @@ const dom_1 = __webpack_require__(394);
6589
6606
  // 複合生成インデクスを手動で同期させるより最初から重複のない
6590
6607
  // テキストまたはインデクスを付けて同期が必要な機会を減らすのが
6591
6608
  // 継続的編集において最も簡便となる。
6592
- exports.indexer = (0, combinator_1.surround)(/^\s+\[(?=\|\S)/, (0, combinator_1.union)([index_1.signature, (0, combinator_1.focus)(/^\|(?=\])/, () => [[(0, dom_1.html)('span', {
6609
+ exports.indexer = (0, combinator_1.surround)(/\s\[(?=\|\S)/y, (0, combinator_1.union)([index_1.signature, (0, combinator_1.focus)(/\|(?=\])/y, () => [[(0, dom_1.html)('span', {
6593
6610
  class: 'indexer',
6594
6611
  'data-index': ''
6595
- })]])]), /^\]\s*$/);
6612
+ })]])]), /\]\s*$/y);
6596
6613
 
6597
6614
  /***/ },
6598
6615
 
@@ -6609,9 +6626,9 @@ exports.isFixed = exports.number = exports.label = exports.segment = void 0;
6609
6626
  const combinator_1 = __webpack_require__(3484);
6610
6627
  const source_1 = __webpack_require__(8745);
6611
6628
  const dom_1 = __webpack_require__(394);
6612
- 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]))/);
6629
+ 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);
6613
6630
  exports.segment = (0, combinator_1.clear)((0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body]));
6614
- 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 | 8 /* Backtrack.bracket */, 1]), body]), ([text]) => [(0, dom_1.html)('a', {
6631
+ 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]), ([text]) => [(0, dom_1.html)('a', {
6615
6632
  class: 'label',
6616
6633
  'data-label': text.slice(text[1] === '-' ? 0 : 1).toLowerCase()
6617
6634
  }, text)]));
@@ -6656,10 +6673,10 @@ const dom_1 = __webpack_require__(394);
6656
6673
  // All syntax surrounded by square brackets shouldn't contain line breaks.
6657
6674
  exports.placeholder = (0, combinator_1.lazy)(() => (0, combinator_1.surround)(
6658
6675
  // ^はabbrで使用済みだが^:などのようにして分離使用可能
6659
- (0, source_1.str)(/^\[[:^|]/), (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) => [[(0, dom_1.html)('span', {
6676
+ (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) => [[(0, dom_1.html)('span', {
6660
6677
  class: 'invalid',
6661
6678
  ...(0, util_1.invalid)('extension', 'syntax', `Invalid start symbol or linebreak`)
6662
- }, context.source.slice(context.position - context.range, context.position))]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)], [3 | 8 /* Backtrack.bracket */]));
6679
+ }, context.source.slice(context.position - context.range, context.position))]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)], [3 | 64 /* Backtrack.bracket */]));
6663
6680
 
6664
6681
  /***/ },
6665
6682
 
@@ -6681,7 +6698,7 @@ const util_1 = __webpack_require__(4992);
6681
6698
  const memoize_1 = __webpack_require__(6925);
6682
6699
  const array_1 = __webpack_require__(6876);
6683
6700
  const dom_1 = __webpack_require__(394);
6684
- const tags = Object.freeze(['wbr', 'bdo', 'bdi']);
6701
+ const tags = ['wbr', 'bdo', 'bdi'];
6685
6702
  const attrspecs = {
6686
6703
  wbr: {},
6687
6704
  bdo: {
@@ -6690,12 +6707,12 @@ const attrspecs = {
6690
6707
  };
6691
6708
  Object.setPrototypeOf(attrspecs, null);
6692
6709
  Object.values(attrspecs).forEach(o => Object.setPrototypeOf(o, null));
6693
- exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/^<[a-z]+(?=[^\S\n]|>)/i, (0, combinator_1.union)([(0, combinator_1.surround)(
6710
+ exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/<[a-z]+(?=[^\S\n]|>)/yi, (0, combinator_1.union)([(0, combinator_1.surround)(
6694
6711
  // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
6695
- (0, source_1.str)(/^<(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)(?=[^\S\n]|>)/i), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, combinator_1.open)((0, source_1.str)(/^[^\S\n]*/), (0, source_1.str)('>'), true), true, ([as, bs = [], cs], context) => [[elem(as[0].slice(1), false, (0, array_1.push)((0, array_1.unshift)(as, bs), cs), [], [], context)]], ([as, bs = []], context) => [[elem(as[0].slice(1), false, (0, array_1.unshift)(as, bs), [], [], context)]]), (0, combinator_1.match)(new RegExp(String.raw`^<(${TAGS.join('|')})(?=[^\S\n]|>)`), (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)(/^[^\S\n]*/), (0, source_1.str)('>'), true), true, ([as, bs = [], cs]) => [(0, array_1.push)((0, array_1.unshift)(as, bs), cs)], ([as, bs = []]) => [(0, array_1.unshift)(as, bs)]), (0, combinator_1.precedence)(3, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.subsequence)([(0, combinator_1.focus)(/^[^\S\n]*\n/, (0, combinator_1.some)(inline_1.inline)), (0, combinator_1.some)((0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', `</${tag}>`), [[(0, visibility_1.blankWith)('\n', `</${tag}>`), 3]]), true))]))), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], context) => [[elem(tag, true, as, bs, cs, context)]], ([as, bs = []], context) => [[elem(tag, true, as, bs, [], context)]]), ([, tag]) => tag, new Map())), (0, combinator_1.surround)(
6712
+ (0, source_1.str)(/<(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)(?=[^\S\n]|>)/yi), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, combinator_1.open)((0, source_1.str)(/[^\S\n]*/y), (0, source_1.str)('>'), true), true, ([as, bs = [], cs], context) => [[elem(as[0].slice(1), false, (0, array_1.push)((0, array_1.unshift)(as, bs), cs), [], [], context)]], ([as, bs = []], context) => [[elem(as[0].slice(1), false, (0, array_1.unshift)(as, bs), [], [], context)]]), (0, combinator_1.match)(new RegExp(String.raw`<(${TAGS.join('|')})(?=[^\S\n]|>)`, '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)(/[^\S\n]*/y), (0, source_1.str)('>'), true), true, ([as, bs = [], cs]) => [(0, array_1.push)((0, array_1.unshift)(as, bs), cs)], ([as, bs = []]) => [(0, array_1.unshift)(as, bs)]), (0, combinator_1.precedence)(3, (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, visibility_1.blankWith)('\n', `</${tag}>`), 3]]), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, `</${tag}>`, [[`</${tag}>`, 3]]), true)])))), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], context) => [[elem(tag, true, as, bs, cs, context)]], ([as, bs = []], context) => [[elem(tag, true, as, bs, [], context)]]), ([, tag]) => tag, new Map())), (0, combinator_1.surround)(
6696
6713
  // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
6697
- (0, source_1.str)(/^<[a-z]{1,16}(?=[^\S\n]|>)/i), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, combinator_1.open)((0, source_1.str)(/^[^\S\n]*/), (0, source_1.str)('>'), true), true, ([as, bs = [], cs], context) => [[elem(as[0].slice(1), false, (0, array_1.push)((0, array_1.unshift)(as, bs), cs), [], [], context)]], ([as, bs = []], context) => [[elem(as[0].slice(1), false, (0, array_1.unshift)(as, bs), [], [], context)]])])));
6698
- exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|>)/i), (0, source_1.str)(/^[^\S\n]+[^\s<>]+/)]);
6714
+ (0, source_1.str)(/<[a-z]+(?=[^\S\n]|>)/yi), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, combinator_1.open)((0, source_1.str)(/[^\S\n]*/y), (0, source_1.str)('>'), true), true, ([as, bs = [], cs], context) => [[elem(as[0].slice(1), false, (0, array_1.push)((0, array_1.unshift)(as, bs), cs), [], [], context)]], ([as, bs = []], context) => [[elem(as[0].slice(1), false, (0, array_1.unshift)(as, bs), [], [], context)]])])));
6715
+ exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|>)/yi), (0, source_1.str)(/[^\S\n]+[^\s<>]+/y)]);
6699
6716
  function elem(tag, content, as, bs, cs, context) {
6700
6717
  if (!tags.includes(tag)) return ielem('tag', `Invalid HTML tag name "${tag}"`, context);
6701
6718
  if (content) {
@@ -6703,7 +6720,7 @@ function elem(tag, content, as, bs, cs, context) {
6703
6720
  if (bs.length === 0) return ielem('content', `Missing the content`, context);
6704
6721
  if (!(0, visibility_1.isLooseNodeStart)(bs)) return ielem('content', `Missing the visible content in the same line`, context);
6705
6722
  }
6706
- const attrs = attributes('html', attrspecs[tag], as.slice(1, as.at(-1) === '>' ? -2 : as.length));
6723
+ const attrs = attributes('html', attrspecs[tag], as.slice(1, as.at(-1) === '>' ? -1 : as.length));
6707
6724
  if (/(?<!\S)invalid(?!\S)/.test(attrs['class'] ?? '')) return ielem('attribute', 'Invalid HTML attribute', context);
6708
6725
  if (as.at(-1) !== '>') return ielem('tag', `Missing the closing symbol ">"`, context);
6709
6726
  return (0, dom_1.html)(tag, attrs, (0, dom_1.defrag)(bs));
@@ -6720,10 +6737,11 @@ function attributes(syntax, spec, params) {
6720
6737
  const attrs = {};
6721
6738
  for (let i = 0; i < params.length; ++i) {
6722
6739
  const param = params[i].trimStart();
6740
+ if (param === '') continue;
6723
6741
  const name = param.split('=', 1)[0];
6724
6742
  const value = param !== name ? param.slice(name.length + 2, -1).replace(/\\(.?)/g, '$1') : undefined;
6725
- invalidation ||= !spec || name in attrs;
6726
- if (spec && name in spec && !spec[name]) continue;
6743
+ invalidation ||= name === '' || !spec || name in attrs;
6744
+ if (name === '' || spec && name in spec && !spec[name]) continue;
6727
6745
  spec?.[name]?.includes(value) || spec?.[name]?.length === 0 && value !== undefined ? attrs[name] = value ?? '' : invalidation ||= !!spec;
6728
6746
  (0, array_1.splice)(params, i--, 1);
6729
6747
  }
@@ -6737,7 +6755,7 @@ function attributes(syntax, spec, params) {
6737
6755
  exports.attributes = attributes;
6738
6756
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
6739
6757
  // [...document.querySelectorAll('tbody > tr > td:first-child')].map(el => el.textContent.slice(1, -1))
6740
- const TAGS = Object.freeze(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "h1", "h2", "h3", "h4", "h5", "h6", "hgroup", "main", "nav", "section", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "menu", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "summary", "slot", "template", "acronym", "applet", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "param", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp"]);
6758
+ const TAGS = ["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "h1", "h2", "h3", "h4", "h5", "h6", "hgroup", "main", "nav", "section", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "menu", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "summary", "slot", "template", "acronym", "applet", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "param", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp"];
6741
6759
 
6742
6760
  /***/ },
6743
6761
 
@@ -6754,7 +6772,7 @@ exports.htmlentity = exports.unsafehtmlentity = void 0;
6754
6772
  const combinator_1 = __webpack_require__(3484);
6755
6773
  const util_1 = __webpack_require__(4992);
6756
6774
  const dom_1 = __webpack_require__(394);
6757
- exports.unsafehtmlentity = (0, combinator_1.validate)('&', (0, combinator_1.focus)(/^&(?:[0-9A-Za-z]+;?)?/,
6775
+ exports.unsafehtmlentity = (0, combinator_1.focus)(/&(?:[0-9A-Za-z]+;?)?/y,
6758
6776
  //({ source }) => [[parser(source) ?? `${Command.Error}${source}`], '']));
6759
6777
  ({
6760
6778
  context
@@ -6764,7 +6782,7 @@ exports.unsafehtmlentity = (0, combinator_1.validate)('&', (0, combinator_1.focu
6764
6782
  } = context;
6765
6783
  context.position += source.length;
6766
6784
  return source.length > 1 && source.at(-1) === ';' ? [[parser(source) ?? source]] : [[source]];
6767
- }));
6785
+ });
6768
6786
  exports.htmlentity = (0, combinator_1.fmap)((0, combinator_1.union)([exports.unsafehtmlentity]), ([text]) => [length === 1 || text.at(-1) !== ';' ? text : (0, dom_1.html)('span', {
6769
6787
  class: 'invalid',
6770
6788
  ...(0, util_1.invalid)('htmlentity', 'syntax', 'Invalid HTML entity')
@@ -6794,7 +6812,7 @@ const visibility_1 = __webpack_require__(6364);
6794
6812
  const util_1 = __webpack_require__(4992);
6795
6813
  const array_1 = __webpack_require__(6876);
6796
6814
  const dom_1 = __webpack_require__(394);
6797
- exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('++', (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)(exports.insertion, '+'), true)]))), '++', false, ([, bs], {
6815
+ exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('++', (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], {
6798
6816
  buffer
6799
6817
  }) => [(0, array_1.push)(buffer, bs)], ([, bs], {
6800
6818
  buffer
@@ -6821,7 +6839,7 @@ const dom_1 = __webpack_require__(394);
6821
6839
  // 可読性のため実際にはオブリーク体を指定する。
6822
6840
  // 斜体は単語に使うとかえって見づらく読み飛ばしやすくなるため使わないべきであり
6823
6841
  // ある程度の長さのある文に使うのが望ましい。
6824
- exports.italic = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('///', (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, '/'), exports.italic)])))), '///', false, ([, bs], {
6842
+ exports.italic = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('///', (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], {
6825
6843
  buffer
6826
6844
  }) => [(0, array_1.push)(buffer, bs)], ([, bs], {
6827
6845
  buffer
@@ -6838,7 +6856,7 @@ exports.italic = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('///',
6838
6856
  Object.defineProperty(exports, "__esModule", ({
6839
6857
  value: true
6840
6858
  }));
6841
- exports.decode = exports.resolve = exports.option = exports.uri = exports.unsafelink = exports.linemedialink = exports.medialink = exports.textlink = void 0;
6859
+ exports.decode = exports.resolve = exports.option = exports.uri = exports.unsafelink = exports.medialink = exports.textlink = void 0;
6842
6860
  const combinator_1 = __webpack_require__(3484);
6843
6861
  const inline_1 = __webpack_require__(7973);
6844
6862
  const html_1 = __webpack_require__(5013);
@@ -6852,20 +6870,20 @@ const optspec = {
6852
6870
  rel: ['nofollow']
6853
6871
  };
6854
6872
  Object.setPrototypeOf(optspec, null);
6855
- 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 = []], context) => context.linebreak === 0 ? [(0, array_1.push)(ns, ["\u001F" /* Command.Separator */])] : undefined, undefined, [3 | 64 /* Backtrack.link */, 2 | 32 /* Backtrack.ruby */, 3 | 8 /* Backtrack.bracket */])),
6873
+ 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 = []], context) => context.linebreak === 0 ? [(0, array_1.push)(ns, ["\u001F" /* Command.Separator */])] : undefined, undefined, [3 | 64 /* Backtrack.bracket */, 3 | 16 /* Backtrack.link */, 2 | 8 /* Backtrack.ruby */])),
6856
6874
  // `{ `と`{`で個別にバックトラックが発生し+1nされる。
6857
6875
  // 自己再帰的にパースしてもオプションの不要なパースによる計算量の増加により相殺される。
6858
- (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/, false, undefined, ([as, bs], context) => {
6876
+ (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /[^\S\n]*}/y, false, undefined, ([as, bs], context) => {
6859
6877
  if (!bs) return;
6860
6878
  const head = context.position - context.range;
6861
- (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head);
6879
+ (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
6862
6880
  return [(0, array_1.push)((0, array_1.unshift)(as, bs), ["\u0018" /* Command.Cancel */])];
6863
- }, [3 | 64 /* Backtrack.link */]))]), ([content, params], context) => {
6881
+ }, [3 | 16 /* Backtrack.link */]))]), ([content, params], context) => {
6864
6882
  if (content.at(-1) === "\u001F" /* Command.Separator */) {
6865
6883
  content.pop();
6866
6884
  if (params === undefined) {
6867
6885
  const head = context.position - context.range;
6868
- return void (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head);
6886
+ return void (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
6869
6887
  }
6870
6888
  } else {
6871
6889
  params = content;
@@ -6881,11 +6899,10 @@ exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /
6881
6899
  if (content.length !== 0 && (0, visibility_1.trimBlankNodeEnd)(content).length === 0) return;
6882
6900
  return [[parse((0, dom_1.defrag)(content), params, context)]];
6883
6901
  }))))));
6884
- exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */ | 4 /* State.media */, (0, combinator_1.validate)(['[', '{'], (0, combinator_1.creation)(10, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.reverse)((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)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))])), ([params, content = []], context) => [[parse((0, dom_1.defrag)(content), params, context)]]))))));
6885
- exports.linemedialink = (0, combinator_1.surround)(source_1.linebreak, (0, combinator_1.union)([exports.medialink]), /^(?=[^\S\n]*(?:$|\n))/);
6886
- 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)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))])), ([params, content = []], context) => [[parse((0, dom_1.defrag)(content), params, context)]])));
6887
- exports.uri = (0, combinator_1.union)([(0, combinator_1.open)(/^[^\S\n]+/, (0, source_1.str)(/^\S+/)), (0, source_1.str)(/^[^\s{}]+/)]);
6888
- exports.option = (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+nofollow(?=[^\S\n]|})/), () => [` rel="nofollow"`]), (0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|})/i), (0, source_1.str)(/^[^\S\n]+[^\s{}]+/)]);
6902
+ exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */ | 4 /* State.media */, (0, combinator_1.validate)(/[[{]/y, (0, combinator_1.creation)(10, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.reverse)((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)]), /[^\S\n]*}/y))])), ([params, content = []], context) => [[parse((0, dom_1.defrag)(content), params, context)]]))))));
6903
+ 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)]), /[^\S\n]*}/y))])), ([params, content = []], context) => [[parse((0, dom_1.defrag)(content), params, context)]])));
6904
+ exports.uri = (0, combinator_1.union)([(0, combinator_1.open)(/[^\S\n]+/y, (0, source_1.str)(/\S+/y)), (0, source_1.str)(/[^\s{}]+/y)]);
6905
+ exports.option = (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/[^\S\n]+nofollow(?=[^\S\n]|})/y), () => [` rel="nofollow"`]), (0, source_1.str)(/[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|})/yi), (0, source_1.str)(/[^\S\n]+[^\s{}]+/y)]);
6889
6906
  function parse(content, params, context) {
6890
6907
  const INSECURE_URI = params.shift();
6891
6908
  let uri;
@@ -6962,10 +6979,10 @@ function resolve(uri, host, source) {
6962
6979
  }
6963
6980
  exports.resolve = resolve;
6964
6981
  function decode(uri) {
6965
- const origin = uri.match(/^[a-z](?:[-.](?=[0-9a-z])|[0-9a-z])*:(?:\/{0,2}[^/?#\s]+|\/\/(?=[/]))/i)?.[0] ?? '';
6982
+ const origin = uri.match(/[a-z](?:[-.](?=[0-9a-z])|[0-9a-z])*:(?:\/{0,2}[^/?#\s]+|\/\/(?=[/]))/yi)?.[0] ?? '';
6966
6983
  try {
6967
6984
  let path = decodeURI(uri.slice(origin.length));
6968
- if (!origin && /^[a-z](?:[-.](?=[0-9a-z])|[0-9a-z])*:\/{0,2}\S/i.test(path)) {
6985
+ if (!origin && /[a-z](?:[-.](?=[0-9a-z])|[0-9a-z])*:\/{0,2}\S/yi.test(path)) {
6969
6986
  path = uri.slice(origin.length);
6970
6987
  }
6971
6988
  uri = origin + path;
@@ -6994,7 +7011,7 @@ const visibility_1 = __webpack_require__(6364);
6994
7011
  const util_1 = __webpack_require__(4992);
6995
7012
  const array_1 = __webpack_require__(6876);
6996
7013
  const dom_1 = __webpack_require__(394);
6997
- exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(251 /* State.linkers */ & ~2 /* State.mark */, (0, combinator_1.validate)('==', (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, '='), exports.mark)])))), '==', false, ([, bs], {
7014
+ exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(251 /* State.linkers */ & ~2 /* State.mark */, (0, combinator_1.validate)('==', (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], {
6998
7015
  buffer
6999
7016
  }) => [(0, array_1.push)(buffer, bs)], ([, bs], {
7000
7017
  buffer
@@ -7026,8 +7043,8 @@ const combinator_1 = __webpack_require__(3484);
7026
7043
  const source_1 = __webpack_require__(8745);
7027
7044
  const util_1 = __webpack_require__(4992);
7028
7045
  const dom_1 = __webpack_require__(394);
7029
- const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![a-z])/i;
7030
- exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('$', (0, combinator_1.rewrite)((0, combinator_1.union)([(0, combinator_1.surround)(/^\$(?={)/, (0, combinator_1.precedence)(5, bracket), '$', false, undefined, undefined, [3 | 8 /* Backtrack.bracket */]), (0, combinator_1.surround)(/^\$(?![\s{}])/, (0, combinator_1.precedence)(2, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.precedence)(5, bracket), (0, combinator_1.some)((0, combinator_1.focus)(/^(?:[ ([](?!\$)|\\[\\{}$#]?|[!%&')\x2A-\x5A\]^_\x61-\x7A|~])/, source_1.escsource, false), '://')]))), /^\$(?![0-9A-Za-z])/, false, undefined, undefined, [3 | 8 /* Backtrack.bracket */])]), ({
7046
+ const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![a-z])|:\/\//i;
7047
+ exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.union)([(0, combinator_1.surround)(/\$(?={)/y, (0, combinator_1.precedence)(5, 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)(5, bracket)]))), /\$(?![-0-9A-Za-z])/y, false, undefined, undefined, [3 | 64 /* Backtrack.bracket */])]), ({
7031
7048
  context: {
7032
7049
  source,
7033
7050
  caches: {
@@ -7042,8 +7059,8 @@ exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('$', (0,
7042
7059
  class: 'invalid',
7043
7060
  translate: 'no',
7044
7061
  ...(0, util_1.invalid)('math', 'content', `"${source.match(forbiddenCommand)[0]}" command is forbidden`)
7045
- }, source)]])));
7046
- const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.escsource, /^[{}$#\n]/)]))), (0, source_1.str)('}'), true));
7062
+ }, source)]]));
7063
+ const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.escsource, /[{}$\n]/y)]))), (0, source_1.str)('}'), true));
7047
7064
 
7048
7065
  /***/ },
7049
7066
 
@@ -7056,7 +7073,7 @@ const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, sour
7056
7073
  Object.defineProperty(exports, "__esModule", ({
7057
7074
  value: true
7058
7075
  }));
7059
- exports.linemedia = exports.media = void 0;
7076
+ exports.media = void 0;
7060
7077
  const parser_1 = __webpack_require__(605);
7061
7078
  const combinator_1 = __webpack_require__(3484);
7062
7079
  const link_1 = __webpack_require__(3628);
@@ -7074,12 +7091,12 @@ const optspec = {
7074
7091
  rel: undefined
7075
7092
  };
7076
7093
  Object.setPrototypeOf(optspec, null);
7077
- exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.creation)(10, (0, combinator_1.open)('!', (0, combinator_1.bind)((0, combinator_1.verify)((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 = []], context) => context.linebreak === 0 ? [ns] : undefined, undefined, [3 | 4 /* Backtrack.escbracket */])), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), /^[^\S\n]*}/, false, undefined, ([as, bs], context) => {
7094
+ 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.verify)((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 = []], 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)]), /[^\S\n]*}/y, false, undefined, ([as, bs], context) => {
7078
7095
  if (!bs) return;
7079
7096
  const head = context.position - context.range;
7080
- (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head);
7097
+ (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
7081
7098
  return [(0, array_1.push)((0, array_1.unshift)(as, bs), ["\u0018" /* Command.Cancel */])];
7082
- }, [3 | 64 /* Backtrack.link */]))]), ([as, bs]) => bs ? [[as.join('').trim() || as.join('')], bs] : [[''], as]), ([[text]]) => text === '' || text.trim() !== ''), ([[text], params], context) => {
7099
+ }, [3 | 16 /* Backtrack.link */]))]), ([as, bs]) => bs ? [[as.join('').trim() || as.join('')], bs] : [[''], as]), ([[text]]) => text === '' || text.trim() !== ''), ([[text], params], context) => {
7083
7100
  if (params.at(-1) === "\u0018" /* Command.Cancel */) {
7084
7101
  params.pop();
7085
7102
  return [[(0, dom_1.html)('span', {
@@ -7120,10 +7137,9 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* S
7120
7137
  target: '_blank'
7121
7138
  }, [el])];
7122
7139
  })((0, parser_1.subinput)(`{ ${INSECURE_URI}${params.join('')} }`, context));
7123
- }))))));
7124
- exports.linemedia = (0, combinator_1.surround)(source_1.linebreak, (0, combinator_1.union)([exports.media]), /^(?=[^\S\n]*(?:$|\n))/);
7140
+ })))));
7125
7141
  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, () => [[]], [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, () => [[]], [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, () => [[]], [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, () => [[]], [3 | 4 /* Backtrack.escbracket */])])));
7126
- const option = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, combinator_1.open)(/^[^\S\n]+/, (0, source_1.str)(/^[1-9][0-9]*/)), (0, source_1.str)(/^[x:]/), (0, source_1.str)(/^[1-9][0-9]*(?=[^\S\n]|})/), false, ([[a], [b], [c]]) => [b === 'x' ? [`width="${a}"`, `height="${c}"`] : [`aspect-ratio="${a}/${c}"`]]), link_1.option]));
7142
+ const option = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, combinator_1.open)(/[^\S\n]+/y, (0, source_1.str)(/[1-9][0-9]*/y)), (0, source_1.str)(/[x:]/y), (0, source_1.str)(/[1-9][0-9]*(?=[^\S\n]|})/y), false, ([[a], [b], [c]]) => [b === 'x' ? [`width="${a}"`, `height="${c}"`] : [`aspect-ratio="${a}/${c}"`]]), link_1.option]));
7127
7143
  function sanitize(target, uri) {
7128
7144
  let type;
7129
7145
  let message;
@@ -7186,7 +7202,7 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
7186
7202
  return [[(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, dom_1.defrag)((0, visibility_1.trimBlankNodeEnd)(ns)))])]];
7187
7203
  } else {
7188
7204
  const head = position - range;
7189
- (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head, 2);
7205
+ (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head, 2);
7190
7206
  }
7191
7207
  }, ([as, bs], context) => {
7192
7208
  if (!bs) return;
@@ -7199,9 +7215,9 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
7199
7215
  } = context;
7200
7216
  const head = position - range;
7201
7217
  if (source[position] !== ']') {
7202
- (0, combinator_1.setBacktrack)(context, [2 | 8 /* Backtrack.bracket */], head, 2);
7218
+ (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.bracket */], head, 2);
7203
7219
  } else if (linebreak !== 0) {
7204
- (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head, 2);
7220
+ (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head, 2);
7205
7221
  } else {
7206
7222
  if (state & 128 /* State.annotation */) {
7207
7223
  (0, array_1.push)(bs, [source[position]]);
@@ -7209,23 +7225,23 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
7209
7225
  context.position += 1;
7210
7226
  let result;
7211
7227
  if (source[context.position] !== '{') {
7212
- (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head + 1);
7228
+ (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head + 1);
7213
7229
  result = [[]];
7214
7230
  } else {
7215
- result = !(0, combinator_1.isBacktrack)(context, [1 | 64 /* Backtrack.link */]) ? (0, link_1.textlink)({
7231
+ result = !(0, combinator_1.isBacktrack)(context, [1 | 16 /* Backtrack.link */]) ? (0, link_1.textlink)({
7216
7232
  context
7217
7233
  }) : undefined;
7218
7234
  context.range = range;
7219
7235
  if (!result) {
7220
- (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head + 1);
7236
+ (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head + 1);
7221
7237
  result = [[]];
7222
7238
  }
7223
7239
  }
7224
7240
  if (context.position === source.length) {
7225
- (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head);
7241
+ (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
7226
7242
  } else {
7227
7243
  const next = (0, combinator_1.surround)('', (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]), (0, source_1.str)(']'), true, ([, cs = [], ds]) => [(0, array_1.push)(cs, ds)], ([, cs = []]) => {
7228
- (0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.link */], head);
7244
+ (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
7229
7245
  return [cs];
7230
7246
  })({
7231
7247
  context
@@ -7237,16 +7253,16 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
7237
7253
  context.position = position;
7238
7254
  }
7239
7255
  return state & 128 /* State.annotation */ ? [(0, array_1.unshift)(as, bs)] : undefined;
7240
- }, [3 | 16 /* Backtrack.doublebracket */, 1 | 8 /* Backtrack.bracket */])));
7256
+ }, [1 | 64 /* Backtrack.bracket */, 3 | 32 /* Backtrack.doublebracket */])));
7241
7257
  // Chicago-Style
7242
- const abbr = (0, combinator_1.surround)((0, source_1.str)('^'), (0, combinator_1.union)([(0, source_1.str)(/^(?=[A-Z])(?:[0-9A-Za-z]'?|(?:[-.:]|\.?\??,? ?)(?!['\-.:?, ]))+/)]), /^\|?(?=]])|^\|/, true, ([, ns], context) => {
7258
+ 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) => {
7243
7259
  const {
7244
7260
  source,
7245
7261
  position,
7246
7262
  range = 0
7247
7263
  } = context;
7248
7264
  if (!ns) return [['', source.slice(position - range, source[position - 1] === '|' ? position - 1 : position)]];
7249
- context.position += source.slice(position).match(visibility_1.blank.start)?.[0].length ?? 0;
7265
+ context.position += source[position] === ' ' ? 1 : 0;
7250
7266
  return [["\u001F" /* Command.Separator */, ns[0].trimEnd()]];
7251
7267
  }, (_, context) => {
7252
7268
  context.position -= context.range;
@@ -7288,14 +7304,21 @@ exports.remark = void 0;
7288
7304
  const combinator_1 = __webpack_require__(3484);
7289
7305
  const inline_1 = __webpack_require__(7973);
7290
7306
  const source_1 = __webpack_require__(8745);
7291
- const memoize_1 = __webpack_require__(6925);
7307
+ const util_1 = __webpack_require__(4992);
7292
7308
  const array_1 = __webpack_require__(6876);
7293
7309
  const dom_1 = __webpack_require__(394);
7294
- exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.match)(/^\[(%+)\s/, (0, memoize_1.memoize)(([, fence]) => (0, combinator_1.surround)((0, source_1.str)(`[${fence}`), (0, combinator_1.precedence)(4, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), new RegExp(String.raw`^\s+${fence}\]`), [[new RegExp(String.raw`^\s+${fence}\]`), 4]]))), (0, combinator_1.close)((0, combinator_1.some)(source_1.text, '%'), (0, source_1.str)(`${fence}]`)), true, ([as, bs = [], cs]) => [[(0, dom_1.html)('span', {
7310
+ exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.fallback)((0, combinator_1.surround)((0, source_1.str)(/\[%(?=\s)/y), (0, combinator_1.precedence)(4, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /\s%\]/y, [[/\s%\]/y, 4]]))), (0, combinator_1.close)(source_1.text, (0, source_1.str)(`%]`)), true, ([as, bs = [], cs]) => [[(0, dom_1.html)('span', {
7295
7311
  class: 'remark'
7296
7312
  }, [(0, dom_1.html)('input', {
7297
7313
  type: 'checkbox'
7298
- }), (0, dom_1.html)('span', (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))])]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)]), ([, fence]) => fence.length, {})));
7314
+ }), (0, dom_1.html)('span', (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))])]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)]), (0, combinator_1.focus)(/\[%+(?=\s)/y, ({
7315
+ context: {
7316
+ source
7317
+ }
7318
+ }) => [[(0, dom_1.html)('span', {
7319
+ class: 'invalid',
7320
+ ...(0, util_1.invalid)('remark', 'syntax', 'Invalid start symbol')
7321
+ }, source)]])));
7299
7322
 
7300
7323
  /***/ },
7301
7324
 
@@ -7319,10 +7342,10 @@ const dom_1 = __webpack_require__(394);
7319
7342
  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]) => {
7320
7343
  ns && ns.at(-1) === '' && ns.pop();
7321
7344
  return (0, visibility_1.isTightNodeStart)(ns) ? [ns] : undefined;
7322
- }, undefined, [3 | 32 /* Backtrack.ruby */, 1 | 8 /* Backtrack.bracket */])), (0, combinator_1.dup)((0, combinator_1.surround)('(', text, ')', false, undefined, undefined, [3 | 32 /* Backtrack.ruby */, 1 | 8 /* Backtrack.bracket */]))]), ([texts, rubies], context) => {
7345
+ }, 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 */]))]), ([texts, rubies], context) => {
7323
7346
  if (rubies === undefined) {
7324
7347
  const head = context.position - context.range;
7325
- return void (0, combinator_1.setBacktrack)(context, [2 | 32 /* Backtrack.ruby */], head);
7348
+ return void (0, combinator_1.setBacktrack)(context, [2 | 8 /* Backtrack.ruby */], head);
7326
7349
  }
7327
7350
  switch (true) {
7328
7351
  case rubies.length <= texts.length:
@@ -7342,10 +7365,11 @@ const text = input => {
7342
7365
  } = context;
7343
7366
  const acc = [''];
7344
7367
  let state = false;
7368
+ context.sequential = true;
7345
7369
  for (let {
7346
7370
  position
7347
7371
  } = context; position < source.length; position = context.position) {
7348
- if (!/^(?:\\[^\n]|[^\\[\](){}<>"`$#:^|\n])/.test(source.slice(position, position + 2))) break;
7372
+ if (/[$"`\[\](){}<>()[]{}]|\\?\n/yi.test(source.slice(position, position + 2))) break;
7349
7373
  switch (source[position]) {
7350
7374
  case '&':
7351
7375
  {
@@ -7367,6 +7391,7 @@ const text = input => {
7367
7391
  }
7368
7392
  }
7369
7393
  }
7394
+ context.sequential = false;
7370
7395
  state ||= acc.at(-1).trimStart() !== '';
7371
7396
  return state ? [acc] : undefined;
7372
7397
  };
@@ -7400,9 +7425,8 @@ exports.lineshortmedia = exports.shortmedia = void 0;
7400
7425
  const combinator_1 = __webpack_require__(3484);
7401
7426
  const url_1 = __webpack_require__(2129);
7402
7427
  const media_1 = __webpack_require__(7478);
7403
- const source_1 = __webpack_require__(8745);
7404
7428
  exports.shortmedia = (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.rewrite)((0, combinator_1.open)('!', url_1.url), (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media]), false)));
7405
- exports.lineshortmedia = (0, combinator_1.open)(source_1.linebreak, (0, combinator_1.focus)(/^!https?:\/\/\S+(?=[^\S\n]*(?:$|\n))/, (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media]), false)));
7429
+ exports.lineshortmedia = (0, combinator_1.focus)(/(?<=^|[\r\n])!https?:\/\/\S+(?=[^\S\n]*(?:$|\n))/y, (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media]), false));
7406
7430
 
7407
7431
  /***/ },
7408
7432
 
@@ -7418,13 +7442,12 @@ Object.defineProperty(exports, "__esModule", ({
7418
7442
  exports.strong = void 0;
7419
7443
  const combinator_1 = __webpack_require__(3484);
7420
7444
  const inline_1 = __webpack_require__(7973);
7421
- const emstrong_1 = __webpack_require__(365);
7422
7445
  const emphasis_1 = __webpack_require__(1354);
7423
7446
  const source_1 = __webpack_require__(8745);
7424
7447
  const visibility_1 = __webpack_require__(6364);
7425
7448
  const array_1 = __webpack_require__(6876);
7426
7449
  const dom_1 = __webpack_require__(394);
7427
- exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('**', '*'), (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, '*'), (0, combinator_1.union)([emstrong_1.emstrong, exports.strong, emphasis_1.emphasis]))]))))), (0, source_1.str)('**'), false, ([, bs]) => [[(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)]));
7450
+ 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]) => [[(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)]));
7428
7451
 
7429
7452
  /***/ },
7430
7453
 
@@ -7448,7 +7471,7 @@ exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, s
7448
7471
  }, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))]], ([, bs], context) => bs && [[(0, dom_1.html)('span', {
7449
7472
  class: 'invalid',
7450
7473
  ...(0, util_1.invalid)('template', 'syntax', `Missing the closing symbol "}}"`)
7451
- }, context.source.slice(context.position - context.range, context.position))]], [3 | 16 /* Backtrack.doublebracket */, 3 | 4 /* Backtrack.escbracket */]));
7474
+ }, context.source.slice(context.position - context.range, context.position))]], [3 | 32 /* Backtrack.doublebracket */, 3 | 4 /* Backtrack.escbracket */]));
7452
7475
  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, () => [[]], [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, () => [[]], [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, () => [[]], [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, '"', [['"', 2, false]]))), (0, source_1.str)('"'), true, ([as, bs = [], cs], context) => context.linebreak === 0 ? [(0, array_1.push)((0, array_1.unshift)(as, bs), cs)] : (context.position -= 1, [(0, array_1.unshift)(as, bs)]), ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)], [3 | 4 /* Backtrack.escbracket */])]));
7453
7476
 
7454
7477
  /***/ },
@@ -7779,7 +7802,33 @@ const extension_1 = __webpack_require__(6193);
7779
7802
  const source_1 = __webpack_require__(8745);
7780
7803
  exports.MAX_SEGMENT_SIZE = 100_000; // 100,000 bytes (Max value size of FDB)
7781
7804
  exports.MAX_INPUT_SIZE = exports.MAX_SEGMENT_SIZE * 10;
7782
- const parser = (0, combinator_1.union)([heading_1.segment, codeblock_1.segment, mathblock_1.segment, extension_1.segment, (0, combinator_1.some)(source_1.contentline, exports.MAX_SEGMENT_SIZE + 1), (0, combinator_1.some)(source_1.emptyline, exports.MAX_SEGMENT_SIZE + 1)]);
7805
+ const parser = (0, combinator_1.union)([input => {
7806
+ const {
7807
+ context: {
7808
+ source,
7809
+ position
7810
+ }
7811
+ } = input;
7812
+ if (position === source.length) return;
7813
+ switch (source.slice(position, position + 3)) {
7814
+ case '~~~':
7815
+ return (0, extension_1.segment)(input);
7816
+ case '```':
7817
+ return (0, codeblock_1.segment)(input);
7818
+ }
7819
+ switch (source.slice(position, position + 2)) {
7820
+ case '$$':
7821
+ return (0, mathblock_1.segment)(input);
7822
+ case '[$':
7823
+ return (0, extension_1.segment)(input);
7824
+ }
7825
+ switch (source[position]) {
7826
+ case '#':
7827
+ return (0, heading_1.segment)(input);
7828
+ case '$':
7829
+ return (0, extension_1.segment)(input);
7830
+ }
7831
+ }, (0, combinator_1.some)(source_1.contentline, exports.MAX_SEGMENT_SIZE + 1), (0, combinator_1.some)(source_1.emptyline, exports.MAX_SEGMENT_SIZE + 1)]);
7783
7832
  function* segment(source) {
7784
7833
  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)}`;
7785
7834
  const context = {
@@ -7899,6 +7948,8 @@ Object.defineProperty(exports, "__esModule", ({
7899
7948
  }));
7900
7949
  exports.escsource = void 0;
7901
7950
  const combinator_1 = __webpack_require__(3484);
7951
+ const text_1 = __webpack_require__(5655);
7952
+ const unescapable_1 = __webpack_require__(8407);
7902
7953
  const dom_1 = __webpack_require__(394);
7903
7954
  const escsource = ({
7904
7955
  context
@@ -7908,9 +7959,10 @@ const escsource = ({
7908
7959
  position
7909
7960
  } = context;
7910
7961
  if (position === source.length) return;
7962
+ const char = source[position];
7911
7963
  (0, combinator_1.consume)(1, context);
7912
7964
  context.position += 1;
7913
- switch (source[position]) {
7965
+ switch (char) {
7914
7966
  case '\r':
7915
7967
  (0, combinator_1.consume)(-1, context);
7916
7968
  return [[]];
@@ -7921,9 +7973,9 @@ const escsource = ({
7921
7973
  case '\\':
7922
7974
  switch (source[position + 1]) {
7923
7975
  case undefined:
7924
- return [[source[position]]];
7976
+ return [[char]];
7925
7977
  case '\n':
7926
- return [[source[position]]];
7978
+ return [[char]];
7927
7979
  default:
7928
7980
  (0, combinator_1.consume)(1, context);
7929
7981
  context.position += 1;
@@ -7933,7 +7985,14 @@ const escsource = ({
7933
7985
  context.linebreak ||= source.length - position;
7934
7986
  return [[(0, dom_1.html)('br')]];
7935
7987
  default:
7936
- return [[source[position]]];
7988
+ if (context.sequential) return [[char]];
7989
+ text_1.nonWhitespace.lastIndex = position + 1;
7990
+ const b = (0, text_1.isBlank)(source, position);
7991
+ let i = b ? text_1.nonWhitespace.test(source) ? text_1.nonWhitespace.lastIndex - 1 : source.length : (0, text_1.next)(source, position, unescapable_1.delimiter);
7992
+ i -= position;
7993
+ (0, combinator_1.consume)(i - 1, context);
7994
+ context.position += i - 1;
7995
+ return [[source.slice(position, context.position)]];
7937
7996
  }
7938
7997
  };
7939
7998
  exports.escsource = escsource;
@@ -7941,7 +8000,7 @@ exports.escsource = escsource;
7941
8000
  /***/ },
7942
8001
 
7943
8002
  /***/ 702
7944
- (__unused_webpack_module, exports, __webpack_require__) {
8003
+ (__unused_webpack_module, exports) {
7945
8004
 
7946
8005
  "use strict";
7947
8006
 
@@ -7950,18 +8009,52 @@ Object.defineProperty(exports, "__esModule", ({
7950
8009
  value: true
7951
8010
  }));
7952
8011
  exports.contentline = exports.emptyline = exports.anyline = void 0;
7953
- const combinator_1 = __webpack_require__(3484);
7954
- exports.anyline = (0, combinator_1.line)(() => [[]]);
7955
- exports.emptyline = (0, combinator_1.line)(({
7956
- context: {
7957
- source
7958
- }
7959
- }) => (0, combinator_1.isBlank)(source) ? [[]] : undefined);
7960
- exports.contentline = (0, combinator_1.line)(({
7961
- context: {
7962
- source
7963
- }
7964
- }) => !(0, combinator_1.isBlank)(source) ? [[]] : undefined);
8012
+ const anyline = input => {
8013
+ const {
8014
+ context
8015
+ } = input;
8016
+ const {
8017
+ source,
8018
+ position
8019
+ } = context;
8020
+ context.position = source.indexOf('\n', position) + 1 || source.length;
8021
+ return [[]];
8022
+ };
8023
+ exports.anyline = anyline;
8024
+ const regEmptyline = /[^\S\n]*(?:$|\n)/y;
8025
+ const emptyline = input => {
8026
+ const {
8027
+ context
8028
+ } = input;
8029
+ const {
8030
+ source,
8031
+ position
8032
+ } = context;
8033
+ regEmptyline.lastIndex = position;
8034
+ regEmptyline.test(source);
8035
+ const i = regEmptyline.lastIndex;
8036
+ if (i === 0) return;
8037
+ context.position = i;
8038
+ return [[]];
8039
+ };
8040
+ exports.emptyline = emptyline;
8041
+ const regContentline = /[^\S\n]*\S[^\n]*(?:$|\n)/y;
8042
+ const contentline = input => {
8043
+ const {
8044
+ context
8045
+ } = input;
8046
+ const {
8047
+ source,
8048
+ position
8049
+ } = context;
8050
+ regContentline.lastIndex = position;
8051
+ regContentline.test(source);
8052
+ const i = regContentline.lastIndex;
8053
+ if (i === 0) return;
8054
+ context.position = i;
8055
+ return [[]];
8056
+ };
8057
+ exports.contentline = contentline;
7965
8058
 
7966
8059
  /***/ },
7967
8060
 
@@ -7976,35 +8069,8 @@ Object.defineProperty(exports, "__esModule", ({
7976
8069
  }));
7977
8070
  exports.strs = exports.str = void 0;
7978
8071
  const combinator_1 = __webpack_require__(3484);
7979
- function str(pattern, not) {
7980
- const count = typeof pattern === 'object' ? /[^^\\*+][*+]/.test(pattern.source) : false;
7981
- return typeof pattern === 'string' ? ({
7982
- context
7983
- }) => {
7984
- const {
7985
- source,
7986
- position
7987
- } = context;
7988
- if (position === source.length) return;
7989
- if (!source.startsWith(pattern, position)) return;
7990
- if (not && source.startsWith(not, position + pattern.length)) return;
7991
- context.position += pattern.length;
7992
- return [[pattern]];
7993
- } : ({
7994
- context
7995
- }) => {
7996
- const {
7997
- source,
7998
- position
7999
- } = context;
8000
- if (position === source.length) return;
8001
- const m = source.slice(position).match(pattern);
8002
- if (m === null) return;
8003
- count && (0, combinator_1.consume)(m[0].length, context);
8004
- if (not && source.slice(position + m[0].length, position + m[0].length + not.length) === not) return;
8005
- context.position += m[0].length;
8006
- return [[m[0]]];
8007
- };
8072
+ function str(pattern) {
8073
+ return (0, combinator_1.matcher)(pattern, true);
8008
8074
  }
8009
8075
  exports.str = str;
8010
8076
  function strs(pattern) {
@@ -8035,9 +8101,11 @@ exports.strs = strs;
8035
8101
  Object.defineProperty(exports, "__esModule", ({
8036
8102
  value: true
8037
8103
  }));
8038
- exports.isAlphanumeric = exports.linebreak = exports.txt = exports.text = void 0;
8104
+ exports.isAlphanumeric = exports.isBlank = exports.backToEmailHead = exports.backToUrlHead = exports.next = exports.linebreak = exports.txt = exports.text = exports.nonWhitespace = exports.delimiter = void 0;
8039
8105
  const combinator_1 = __webpack_require__(3484);
8040
8106
  const dom_1 = __webpack_require__(394);
8107
+ exports.delimiter = /(?=[\\!@#$&"`\[\](){}<>()[]{}*%|+~=/]|\s(?:\\?(?:$|\s)|[$*%|]|([+~=])\1)|\/{3}|:\/\/|\n)/g;
8108
+ exports.nonWhitespace = /[\S\r\n]/g;
8041
8109
  const text = input => {
8042
8110
  const {
8043
8111
  context
@@ -8047,9 +8115,10 @@ const text = input => {
8047
8115
  position
8048
8116
  } = context;
8049
8117
  if (position === source.length) return;
8118
+ const char = source[position];
8050
8119
  (0, combinator_1.consume)(1, context);
8051
8120
  context.position += 1;
8052
- switch (source[position]) {
8121
+ switch (char) {
8053
8122
  case '\r':
8054
8123
  (0, combinator_1.consume)(-1, context);
8055
8124
  return [[]];
@@ -8063,18 +8132,120 @@ const text = input => {
8063
8132
  default:
8064
8133
  (0, combinator_1.consume)(1, context);
8065
8134
  context.position += 1;
8066
- return [[source.slice(position + 1, position + 2)]];
8135
+ return [[source.slice(position + 1, context.position)]];
8067
8136
  }
8068
8137
  case '\n':
8069
8138
  context.linebreak ||= source.length - position;
8070
8139
  return [[(0, dom_1.html)('br')]];
8071
8140
  default:
8072
- return [[source[position]]];
8141
+ if (context.sequential) return [[char]];
8142
+ exports.nonWhitespace.lastIndex = position + 1;
8143
+ const b = isBlank(source, position);
8144
+ let i = b ? exports.nonWhitespace.test(source) ? exports.nonWhitespace.lastIndex - 1 : source.length : next(source, position, exports.delimiter);
8145
+ const lineend = false || b && i === source.length || b && source[i] === '\n' || b && source[i] === '\\' && source[i + 1] === '\n';
8146
+ i -= position;
8147
+ i = lineend ? i : i - +b || 1;
8148
+ (0, combinator_1.consume)(i - 1, context);
8149
+ context.position += i - 1;
8150
+ const linestart = position === 0 || source[position - 1] === '\n';
8151
+ i = linestart && b && i >= 3 ? i - 3 : 0;
8152
+ i += position;
8153
+ return i === context.position || b && !linestart || lineend ? [[]] : [[source.slice(i, context.position)]];
8073
8154
  }
8074
8155
  };
8075
8156
  exports.text = text;
8076
8157
  exports.txt = (0, combinator_1.union)([exports.text]);
8077
- exports.linebreak = (0, combinator_1.focus)(/^[\r\n]/, (0, combinator_1.union)([exports.text]));
8158
+ exports.linebreak = (0, combinator_1.focus)(/[\r\n]/y, (0, combinator_1.union)([exports.text]));
8159
+ function next(source, position, delimiter) {
8160
+ delimiter.lastIndex = position + 1;
8161
+ delimiter.test(source);
8162
+ let index = delimiter.lastIndex;
8163
+ if (index === 0) return source.length;
8164
+ const char = source[index];
8165
+ switch (char) {
8166
+ case ':':
8167
+ index = backToUrlHead(source, position, index);
8168
+ break;
8169
+ case '@':
8170
+ index = backToEmailHead(source, position, index);
8171
+ break;
8172
+ }
8173
+ if (index > position + 1) switch (char) {
8174
+ case '*':
8175
+ case '+':
8176
+ case '~':
8177
+ case '=':
8178
+ case '/':
8179
+ case '%':
8180
+ case '|':
8181
+ index -= /\s/.test(source[index - 1]) ? 1 : 0;
8182
+ }
8183
+ return index;
8184
+ }
8185
+ exports.next = next;
8186
+ function backToUrlHead(source, position, index) {
8187
+ const delim = index;
8188
+ let state = false;
8189
+ let offset = 0;
8190
+ for (let i = index; --i > position;) {
8191
+ index = i;
8192
+ const char = source[i];
8193
+ if (state) switch (char) {
8194
+ case '.':
8195
+ case '+':
8196
+ case '-':
8197
+ state = false;
8198
+ offset = 1;
8199
+ continue;
8200
+ }
8201
+ if (isAlphanumeric(char)) {
8202
+ state = true;
8203
+ offset = 0;
8204
+ continue;
8205
+ }
8206
+ break;
8207
+ }
8208
+ if (index === position + 1 && offset === 0 && isAlphanumeric(source[index - 1])) {
8209
+ return delim;
8210
+ }
8211
+ return index + offset;
8212
+ }
8213
+ exports.backToUrlHead = backToUrlHead;
8214
+ function backToEmailHead(source, position, index) {
8215
+ const delim = index;
8216
+ let state = false;
8217
+ let offset = 0;
8218
+ for (let i = index; --i > position;) {
8219
+ index = i;
8220
+ const char = source[i];
8221
+ if (state) switch (char) {
8222
+ case '_':
8223
+ case '.':
8224
+ case '+':
8225
+ case '-':
8226
+ state = false;
8227
+ offset = 1;
8228
+ continue;
8229
+ }
8230
+ if (isAlphanumeric(char)) {
8231
+ state = true;
8232
+ offset = 0;
8233
+ continue;
8234
+ }
8235
+ break;
8236
+ }
8237
+ if (index === position + 1 && offset === 0 && isAlphanumeric(source[index - 1])) {
8238
+ return delim;
8239
+ }
8240
+ return index + offset;
8241
+ }
8242
+ exports.backToEmailHead = backToEmailHead;
8243
+ const blank = /\s(?:$|\s|\\\n)/y;
8244
+ function isBlank(source, position) {
8245
+ blank.lastIndex = position;
8246
+ return blank.test(source);
8247
+ }
8248
+ exports.isBlank = isBlank;
8078
8249
  function isAlphanumeric(char) {
8079
8250
  if (char < '0' || '\x7F' < char) return false;
8080
8251
  return '0' <= char && char <= '9' || 'a' <= char && char <= 'z' || 'A' <= char && char <= 'Z';
@@ -8092,9 +8263,11 @@ exports.isAlphanumeric = isAlphanumeric;
8092
8263
  Object.defineProperty(exports, "__esModule", ({
8093
8264
  value: true
8094
8265
  }));
8095
- exports.unescsource = void 0;
8266
+ exports.unescsource = exports.delimiter = void 0;
8096
8267
  const combinator_1 = __webpack_require__(3484);
8268
+ const text_1 = __webpack_require__(5655);
8097
8269
  const dom_1 = __webpack_require__(394);
8270
+ exports.delimiter = /(?=(?=[\x00-\x7F])[^0-9A-Za-z]|(?<=[\x00-\x7F])[^\x00-\x7F])/g;
8098
8271
  const unescsource = ({
8099
8272
  context
8100
8273
  }) => {
@@ -8103,9 +8276,10 @@ const unescsource = ({
8103
8276
  position
8104
8277
  } = context;
8105
8278
  if (position === source.length) return;
8279
+ const char = source[position];
8106
8280
  (0, combinator_1.consume)(1, context);
8107
8281
  context.position += 1;
8108
- switch (source[position]) {
8282
+ switch (char) {
8109
8283
  case '\r':
8110
8284
  (0, combinator_1.consume)(-1, context);
8111
8285
  return [[]];
@@ -8117,7 +8291,14 @@ const unescsource = ({
8117
8291
  context.linebreak ||= source.length - position;
8118
8292
  return [[(0, dom_1.html)('br')]];
8119
8293
  default:
8120
- return [[source[position]]];
8294
+ if (context.sequential) return [[char]];
8295
+ text_1.nonWhitespace.lastIndex = position + 1;
8296
+ const b = (0, text_1.isBlank)(source, position);
8297
+ let i = b ? text_1.nonWhitespace.test(source) ? text_1.nonWhitespace.lastIndex - 1 : source.length : (0, text_1.next)(source, position, exports.delimiter);
8298
+ i -= position;
8299
+ (0, combinator_1.consume)(i - 1, context);
8300
+ context.position += i - 1;
8301
+ return [[source.slice(position, context.position)]];
8121
8302
  }
8122
8303
  };
8123
8304
  exports.unescsource = unescsource;
@@ -8133,15 +8314,15 @@ exports.unescsource = unescsource;
8133
8314
  Object.defineProperty(exports, "__esModule", ({
8134
8315
  value: true
8135
8316
  }));
8136
- exports.stringify = exports.unmarkInvalid = exports.markInvalid = exports.invalid = exports.repeat = exports.lineable = void 0;
8317
+ exports.stringify = exports.unmarkInvalid = exports.markInvalid = exports.invalid = exports.repeat = exports.linearize = void 0;
8137
8318
  const alias_1 = __webpack_require__(5413);
8138
8319
  const parser_1 = __webpack_require__(605);
8139
8320
  const combinator_1 = __webpack_require__(3484);
8140
8321
  const dom_1 = __webpack_require__(394);
8141
- function lineable(parser, trim = -1) {
8142
- return (0, combinator_1.convert)(source => `\r${trim === 0 ? source : trim > 0 ? source.at(-1) === '\n' ? source : source + '\n' : source.at(-1) === '\n' ? source.slice(0, -1) : source}`, parser, trim === 0);
8322
+ function linearize(parser, trim = 0) {
8323
+ return (0, combinator_1.convert)(source => `${trim === 0 ? source : trim > 0 ? source.at(-1) === '\n' ? source : source + '\n' : source.at(-1) === '\n' ? source.slice(0, -1) : source}`, parser, trim === 0);
8143
8324
  }
8144
- exports.lineable = lineable;
8325
+ exports.linearize = linearize;
8145
8326
  function repeat(symbol, parser, cons, termination = (nodes, context, prefix, postfix) => {
8146
8327
  const acc = [];
8147
8328
  if (prefix > 0) {
@@ -8267,47 +8448,32 @@ exports.trimBlankNodeEnd = exports.trimBlankEnd = exports.trimBlankStart = expor
8267
8448
  const parser_1 = __webpack_require__(605);
8268
8449
  const combinator_1 = __webpack_require__(3484);
8269
8450
  const htmlentity_1 = __webpack_require__(470);
8270
- const source_1 = __webpack_require__(8745);
8271
8451
  const normalize_1 = __webpack_require__(4490);
8272
8452
  const array_1 = __webpack_require__(6876);
8273
8453
  var blank;
8274
8454
  (function (blank) {
8275
- blank.line = new RegExp(/^(?:\\?[^\S\r\n]|&IHN;|<wbr[^\S\n]*>|\\$)+$/.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'gm');
8276
- blank.start = new RegExp(/^(?:\\?[^\S\r\n]|&IHN;|<wbr[^\S\n]*>)+/.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`));
8455
+ blank.line = new RegExp(
8456
+ // TODO: 行全体をエスケープ
8457
+ /^(?:[^\S\r\n])*(?!\s)(\\?[^\S\r\n]|&IHN;|<wbr[^\S\n]*>|\\$)+$/mg.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'gm');
8458
+ blank.start = new RegExp(/(?:\\?[^\S\r\n]|&IHN;|<wbr[^\S\n]*>)+/y.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'y');
8277
8459
  })(blank || (exports.blank = blank = {}));
8278
8460
  function visualize(parser) {
8279
- return (0, combinator_1.union)([(0, combinator_1.convert)(source => source.replace(blank.line, line => line.replace(/[\\&<]/g, `${"\u001B" /* Command.Escape */}$&`)), (0, combinator_1.verify)(parser, (ns, {
8280
- source,
8281
- position
8282
- }) => position === source.length && hasVisible(ns)), false), (0, combinator_1.some)((0, combinator_1.union)([source_1.linebreak, source_1.unescsource]))]);
8461
+ return (0, combinator_1.convert)(source => source.replace(blank.line, `${"\u001B" /* Command.Escape */}$1`), parser, false);
8283
8462
  }
8284
8463
  exports.visualize = visualize;
8285
- function hasVisible(nodes) {
8286
- for (let i = 0; i < nodes.length; ++i) {
8287
- const node = nodes[i];
8288
- if (typeof node === 'string') {
8289
- if (node && node.trimStart()) return true;
8290
- } else {
8291
- if (node.innerText.trimStart()) return true;
8292
- if (node.classList.contains('reference')) return true;
8293
- //if (state & State.media ^ State.media &&
8294
- // (node.classList.contains('media') || node.getElementsByClassName('media')[0])) return true;
8295
- }
8296
- }
8297
- return false;
8298
- }
8299
8464
  function blankWith(starts, delimiter) {
8300
8465
  if (delimiter === undefined) return blankWith('', starts);
8301
- return new RegExp(String.raw`^(?:(?=${starts})(?:\\?\s|&(?:${normalize_1.invisibleHTMLEntityNames.join('|')});|<wbr[^\S\n]*>)${
8466
+ return new RegExp(String.raw`(?:(?=${starts})(?:\\?\s|&(?:${normalize_1.invisibleHTMLEntityNames.join('|')});|<wbr[^\S\n]*>)${
8302
8467
  // 空行除去
8303
8468
  // 完全な空行はエスケープ済みなので再帰的バックトラックにはならない。
8304
- starts && '+'})?${typeof delimiter === 'string' ? delimiter.replace(/[*+()\[\]]/g, '\\$&') : delimiter.source}`);
8469
+ starts && '+'})?${typeof delimiter === 'string' ? delimiter.replace(/[*+()\[\]]/g, '\\$&') : delimiter.source}`, 'y');
8305
8470
  }
8306
8471
  exports.blankWith = blankWith;
8307
8472
  function tightStart(parser, except) {
8308
8473
  return input => isTightStart(input, except) ? parser(input) : undefined;
8309
8474
  }
8310
8475
  exports.tightStart = tightStart;
8476
+ const wbr = /<wbr[^\S\n]*>/y;
8311
8477
  function isTightStart(input, except) {
8312
8478
  const {
8313
8479
  context
@@ -8335,8 +8501,9 @@ function isTightStart(input, except) {
8335
8501
  context.position = position;
8336
8502
  return true;
8337
8503
  case '<':
8504
+ wbr.lastIndex = position;
8338
8505
  switch (true) {
8339
- case source.length - position >= 5 && source.startsWith('<wbr', position) && (source[position + 5] === '>' || /^<wbr[^\S\n]*>/.test(source.slice(position))):
8506
+ case source.length - position >= 5 && source.startsWith('<wbr', position) && (source[position + 5] === '>' || wbr.test(source)):
8340
8507
  return false;
8341
8508
  }
8342
8509
  return true;
@@ -8391,7 +8558,21 @@ function trimBlank(parser) {
8391
8558
  }
8392
8559
  exports.trimBlank = trimBlank;
8393
8560
  function trimBlankStart(parser) {
8394
- return (0, combinator_1.convert)(source => source.replace(blank.start, ''), parser, true);
8561
+ return (0, parser_1.failsafe)(input => {
8562
+ const {
8563
+ context
8564
+ } = input;
8565
+ const {
8566
+ source,
8567
+ position
8568
+ } = context;
8569
+ if (position === source.length) return;
8570
+ const reg = blank.start;
8571
+ reg.lastIndex = position;
8572
+ reg.test(source);
8573
+ context.position = reg.lastIndex || position;
8574
+ return context.position === source.length ? [[]] : parser(input);
8575
+ });
8395
8576
  }
8396
8577
  exports.trimBlankStart = trimBlankStart;
8397
8578
  function trimBlankEnd(parser) {