securemark 0.294.3 → 0.294.5

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 (63) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/index.js +164 -144
  3. package/markdown.d.ts +3 -12
  4. package/package.json +3 -3
  5. package/src/combinator/control/manipulation/fence.ts +2 -0
  6. package/src/combinator/control/manipulation/indent.ts +1 -1
  7. package/src/combinator/control/manipulation/match.ts +11 -8
  8. package/src/parser/api/parse.test.ts +3 -3
  9. package/src/parser/block/blockquote.test.ts +3 -9
  10. package/src/parser/block/blockquote.ts +4 -4
  11. package/src/parser/block/dlist.ts +4 -4
  12. package/src/parser/block/extension/example.ts +1 -3
  13. package/src/parser/block/extension/fig.test.ts +0 -1
  14. package/src/parser/block/extension/fig.ts +6 -6
  15. package/src/parser/block/extension/figbase.ts +1 -1
  16. package/src/parser/block/extension/figure.test.ts +1 -1
  17. package/src/parser/block/extension/figure.ts +6 -6
  18. package/src/parser/block/extension/message.ts +1 -1
  19. package/src/parser/block/extension/table.ts +4 -4
  20. package/src/parser/block/heading.ts +4 -4
  21. package/src/parser/block/reply/cite.ts +2 -2
  22. package/src/parser/block/reply/quote.ts +2 -2
  23. package/src/parser/block/sidefence.test.ts +1 -3
  24. package/src/parser/block/sidefence.ts +4 -4
  25. package/src/parser/block/table.ts +2 -2
  26. package/src/parser/block.ts +1 -1
  27. package/src/parser/header.ts +3 -3
  28. package/src/parser/inline/autolink/account.test.ts +18 -17
  29. package/src/parser/inline/autolink/account.ts +14 -20
  30. package/src/parser/inline/autolink/anchor.test.ts +2 -1
  31. package/src/parser/inline/autolink/anchor.ts +10 -13
  32. package/src/parser/inline/autolink/channel.test.ts +6 -6
  33. package/src/parser/inline/autolink/channel.ts +28 -32
  34. package/src/parser/inline/autolink/email.test.ts +19 -19
  35. package/src/parser/inline/autolink/email.ts +7 -7
  36. package/src/parser/inline/autolink/hashnum.test.ts +20 -20
  37. package/src/parser/inline/autolink/hashnum.ts +6 -8
  38. package/src/parser/inline/autolink/hashtag.test.ts +27 -27
  39. package/src/parser/inline/autolink/hashtag.ts +15 -16
  40. package/src/parser/inline/autolink/url.test.ts +6 -6
  41. package/src/parser/inline/autolink/url.ts +5 -4
  42. package/src/parser/inline/autolink.ts +4 -5
  43. package/src/parser/inline/code.ts +12 -18
  44. package/src/parser/inline/deletion.test.ts +1 -1
  45. package/src/parser/inline/deletion.ts +3 -3
  46. package/src/parser/inline/emstrong.ts +3 -3
  47. package/src/parser/inline/extension/indexer.ts +1 -1
  48. package/src/parser/inline/html.test.ts +1 -0
  49. package/src/parser/inline/html.ts +1 -1
  50. package/src/parser/inline/insertion.test.ts +1 -1
  51. package/src/parser/inline/insertion.ts +3 -3
  52. package/src/parser/inline/italic.test.ts +2 -2
  53. package/src/parser/inline/italic.ts +3 -3
  54. package/src/parser/inline/link.test.ts +0 -1
  55. package/src/parser/inline/link.ts +3 -3
  56. package/src/parser/inline/mark.test.ts +1 -1
  57. package/src/parser/inline/mark.ts +3 -3
  58. package/src/parser/inline/remark.ts +3 -3
  59. package/src/parser/inline.test.ts +11 -11
  60. package/src/parser/inline.ts +2 -0
  61. package/src/parser/source/text.ts +8 -4
  62. package/src/parser/util.ts +1 -1
  63. package/src/parser/visibility.ts +4 -6
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! securemark v0.294.3 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
1
+ /*! securemark v0.294.5 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"));
@@ -844,7 +844,7 @@ class List {
844
844
  if (list.length === 0) return this;
845
845
  if (this.length === 0) {
846
846
  this.head = list.head;
847
- this.length += list.length;
847
+ this.length = list.length;
848
848
  list.head = undefined;
849
849
  list.length = 0;
850
850
  return this;
@@ -993,20 +993,19 @@ class List {
993
993
  if (list.length === 0) return this;
994
994
  if (this.length === 0) {
995
995
  this.head = list.head;
996
- this.length += list.length;
997
- list.head = undefined;
998
- list.length = 0;
996
+ this.last = list.last;
997
+ this.length = list.length;
998
+ list.clear();
999
999
  return this;
1000
1000
  }
1001
1001
  const head = list.head;
1002
1002
  const last = list.last;
1003
- const next = last.next = before ?? this.head;
1004
- const prev = head.prev = next.prev;
1005
- next.prev = last;
1003
+ const next = last.next = before;
1004
+ const prev = head.prev = before?.prev ?? this.last;
1005
+ next === undefined ? this.last = last : next.prev = last;
1006
1006
  prev.next = head;
1007
1007
  this.length += list.length;
1008
- list.length = 0;
1009
- list.head = undefined;
1008
+ list.clear();
1010
1009
  return this;
1011
1010
  }
1012
1011
  clear() {
@@ -1038,7 +1037,7 @@ class List {
1038
1037
  return acc;
1039
1038
  }
1040
1039
  foldr(f, acc) {
1041
- for (let node = this.head?.prev; node && this.head;) {
1040
+ for (let node = this.last; node && this.head;) {
1042
1041
  const prev = node.prev;
1043
1042
  acc = f(node, acc);
1044
1043
  node = prev;
@@ -1078,17 +1077,18 @@ Object.defineProperty(exports, "__esModule", ({
1078
1077
  exports.reduce = exports.memoize = void 0;
1079
1078
  const alias_1 = __webpack_require__(5413);
1080
1079
  const compare_1 = __webpack_require__(1934);
1081
- function memoize(f, identify, memory) {
1080
+ function memoize(f, identify, memory, mask) {
1082
1081
  if (typeof identify === 'object') {
1082
+ mask = memory;
1083
1083
  memory = identify;
1084
1084
  identify = undefined;
1085
1085
  }
1086
1086
  identify ??= (...as) => as[0];
1087
1087
  switch (true) {
1088
1088
  case (0, alias_1.isArray)(memory):
1089
- return memoizeArray(f, identify, memory);
1089
+ return mask === undefined ? memoizeArray(f, identify, memory) : cacheArray(f, identify, memory, mask);
1090
1090
  case memory?.constructor === Object:
1091
- return memoizeObject(f, identify, memory);
1091
+ return mask === undefined ? memoizeObject(f, identify, memory) : cacheObject(f, identify, memory, mask);
1092
1092
  default:
1093
1093
  return memoizeDict(f, identify, memory ?? new Map());
1094
1094
  }
@@ -1097,7 +1097,6 @@ exports.memoize = memoize;
1097
1097
  function memoizeArray(f, identify, memory) {
1098
1098
  return (...as) => {
1099
1099
  const b = identify(...as);
1100
- if (!(b >= 0)) return f(...as);
1101
1100
  let z = memory[b];
1102
1101
  if (z !== undefined) return z;
1103
1102
  z = f(...as);
@@ -1105,11 +1104,33 @@ function memoizeArray(f, identify, memory) {
1105
1104
  return z;
1106
1105
  };
1107
1106
  }
1107
+ function cacheArray(f, identify, memory, mask) {
1108
+ const mask1 = mask >>>= 1;
1109
+ const mask2 = mask;
1110
+ const mem1 = memory;
1111
+ const mem2 = [];
1112
+ return (...as) => {
1113
+ const b = identify(...as);
1114
+ if (b <= mask1) {
1115
+ let z = mem1[b];
1116
+ if (z !== undefined) return z;
1117
+ z = f(...as);
1118
+ mem1[b] = z;
1119
+ return z;
1120
+ } else {
1121
+ const i = b & mask2;
1122
+ const t = mem2[i];
1123
+ if (t && t[0] === b) return t[1];
1124
+ const z = f(...as);
1125
+ mem2[i] = [b, z];
1126
+ return z;
1127
+ }
1128
+ };
1129
+ }
1108
1130
  function memoizeObject(f, identify, memory) {
1109
1131
  let nullable = false;
1110
1132
  return (...as) => {
1111
1133
  const b = identify(...as);
1112
- if (!(b >= 0)) return f(...as);
1113
1134
  let z = memory[b];
1114
1135
  if (z !== undefined || nullable && b in memory) return z;
1115
1136
  z = f(...as);
@@ -1118,6 +1139,31 @@ function memoizeObject(f, identify, memory) {
1118
1139
  return z;
1119
1140
  };
1120
1141
  }
1142
+ function cacheObject(f, identify, memory, mask) {
1143
+ const mask1 = mask >>>= 1;
1144
+ const mask2 = mask;
1145
+ const mem1 = memory;
1146
+ const mem2 = {};
1147
+ let nullable = false;
1148
+ return (...as) => {
1149
+ const b = identify(...as);
1150
+ if (b <= mask1) {
1151
+ let z = mem1[b];
1152
+ if (z !== undefined || nullable && b in mem1) return z;
1153
+ z = f(...as);
1154
+ nullable ||= z === undefined;
1155
+ mem1[b] = z;
1156
+ return z;
1157
+ } else {
1158
+ const i = b & mask2;
1159
+ const t = mem2[i];
1160
+ if (t && t[0] === b) return t[1];
1161
+ const z = f(...as);
1162
+ mem2[i] = [b, z];
1163
+ return z;
1164
+ }
1165
+ };
1166
+ }
1121
1167
  function memoizeDict(f, identify, memory) {
1122
1168
  let nullable = false;
1123
1169
  return (...as) => {
@@ -2758,6 +2804,7 @@ Object.defineProperty(exports, "__esModule", ({
2758
2804
  }));
2759
2805
  exports.fence = void 0;
2760
2806
  const parser_1 = __webpack_require__(605);
2807
+ const combinator_1 = __webpack_require__(3484);
2761
2808
  const line_1 = __webpack_require__(8287);
2762
2809
  const array_1 = __webpack_require__(6876);
2763
2810
  function fence(opener, limit, separation = true) {
@@ -2773,6 +2820,7 @@ function fence(opener, limit, separation = true) {
2773
2820
  opener.lastIndex = position;
2774
2821
  const matches = opener.exec(source);
2775
2822
  if (!matches) return;
2823
+ (0, combinator_1.consume)(matches[0].length, context);
2776
2824
  const delim = matches[1];
2777
2825
  if (matches[0].includes(delim, delim.length)) return;
2778
2826
  context.position += matches[0].length;
@@ -2846,7 +2894,7 @@ function indent(opener, parser = false, separation = false) {
2846
2894
  } = context;
2847
2895
  context.position = source.length;
2848
2896
  return new parser_1.List([new parser_1.Data(source.slice(position))]);
2849
- }))), ([indent]) => indent.length <= 16 ? indent.length * 2 + +(indent[0] === ' ') : -1, [])), separation), (lines, context) => {
2897
+ }))), ([indent]) => indent.length * 2 + -(indent[0] === ' '), [], 2 ** 4 - 1)), separation), (lines, context) => {
2850
2898
  return parser((0, parser_1.subinput)(trimBlockEnd(lines.foldl((acc, node) => acc + node.value, '')), context));
2851
2899
  }));
2852
2900
  }
@@ -2887,7 +2935,8 @@ Object.defineProperty(exports, "__esModule", ({
2887
2935
  exports.match = void 0;
2888
2936
  const parser_1 = __webpack_require__(605);
2889
2937
  const combinator_1 = __webpack_require__(3484);
2890
- function match(pattern, f, cost = false) {
2938
+ function match(pattern, f) {
2939
+ const count = typeof pattern === 'object' ? /[^^\\*+][*+]/.test(pattern.source) : false;
2891
2940
  return (0, parser_1.failsafe)(input => {
2892
2941
  const {
2893
2942
  context
@@ -2898,11 +2947,11 @@ function match(pattern, f, cost = false) {
2898
2947
  } = context;
2899
2948
  if (position === source.length) return;
2900
2949
  pattern.lastIndex = position;
2901
- const param = pattern.exec(source);
2902
- if (!param) return;
2903
- cost && (0, combinator_1.consume)(param[0].length, context);
2904
- const result = f(param)(input);
2905
- context.position += result && context.position === position ? param[0].length : 0;
2950
+ const params = pattern.exec(source);
2951
+ if (!params) return;
2952
+ count && (0, combinator_1.consume)(params[0].length, context);
2953
+ const result = f(params)(input);
2954
+ context.position += result && context.position === position ? params[0].length : 0;
2906
2955
  return context.position > position ? result : undefined;
2907
2956
  });
2908
2957
  }
@@ -4559,7 +4608,7 @@ exports.block = (0, combinator_1.reset)({
4559
4608
  }
4560
4609
  }, paragraph_1.paragraph])));
4561
4610
  function error(parser) {
4562
- const reg = new RegExp(String.raw`^${"\u0007" /* Command.Error */}.*\n`);
4611
+ const reg = new RegExp(String.raw`^${"\u0007" /* Command.Error */}[^\n]*\n`);
4563
4612
  return (0, combinator_1.recover)((0, combinator_1.fallback)((0, combinator_1.open)("\u0007" /* Command.Error */, ({
4564
4613
  context: {
4565
4614
  source,
@@ -4601,11 +4650,11 @@ const source_1 = __webpack_require__(8745);
4601
4650
  const util_1 = __webpack_require__(4992);
4602
4651
  const parse_1 = __webpack_require__(3662);
4603
4652
  const dom_1 = __webpack_require__(394);
4604
- 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))]));
4653
+ exports.segment = (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(/!?>+ /y, (0, combinator_1.some)(source_1.contentline))]));
4605
4654
  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)]))));
4606
- const opener = /(?=>>+(?:$|\s))/y;
4607
- const indent = (0, combinator_1.block)((0, combinator_1.open)(opener, (0, combinator_1.some)(source_1.contentline, />(?:$|\s)/y)), false);
4608
- const unindent = source => source.replace(/(?<=^|\n)>(?:[^\S\n]|(?=>*(?:$|\s)))|\n$/g, '');
4655
+ const opener = /(?=>>+(?:$|[ \n]))/y;
4656
+ const indent = (0, combinator_1.block)((0, combinator_1.open)(opener, (0, combinator_1.some)(source_1.contentline, />(?:$|[ \n])/y)), false);
4657
+ const unindent = source => source.replace(/(?<=^|\n)>(?: |(?=>*(?:$|[ \n])))|\n$/g, '');
4609
4658
  const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(2 /* Recursion.blockquote */, (0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, source, false, true)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)(autolink_1.autolink, ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('pre', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false, true))]))), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('blockquote', (0, util_1.unwrap)(ns)))])));
4610
4659
  const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(2 /* Recursion.blockquote */, (0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, markdown, false, true)), (0, combinator_1.creation)(10, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, ({
4611
4660
  context
@@ -4705,11 +4754,11 @@ const source_1 = __webpack_require__(8745);
4705
4754
  const visibility_1 = __webpack_require__(6364);
4706
4755
  const util_1 = __webpack_require__(4992);
4707
4756
  const dom_1 = __webpack_require__(394);
4708
- 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)]))), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('dl', (0, util_1.unwrap)(fillTrailingDescription(ns))))]))));
4709
- 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 => new parser_1.List([new parser_1.Data((0, dom_1.html)('dt', {
4757
+ exports.dlist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/~ +(?=\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)]))), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('dl', (0, util_1.unwrap)(fillTrailingDescription(ns))))]))));
4758
+ const term = (0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.open)(/~ +(?=\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 => new parser_1.List([new parser_1.Data((0, dom_1.html)('dt', {
4710
4759
  'data-index': (0, inline_1.dataindex)(ns)
4711
4760
  }, (0, dom_1.defrag)((0, util_1.unwrap)(ns))))]))));
4712
- 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 => new parser_1.List([new parser_1.Data((0, dom_1.html)('dd', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false);
4761
+ const desc = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)(/: +(?=\S)|/y, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, /[~:] +(?=\S)/y), (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('dd', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false);
4713
4762
  function fillTrailingDescription(nodes) {
4714
4763
  return nodes.last?.value.tagName === 'DT' ? nodes.push(new parser_1.Data((0, dom_1.html)('dd'))) && nodes : nodes;
4715
4764
  }
@@ -4804,8 +4853,7 @@ const mathblock_1 = __webpack_require__(4903);
4804
4853
  const util_1 = __webpack_require__(4992);
4805
4854
  const parse_1 = __webpack_require__(3662);
4806
4855
  const dom_1 = __webpack_require__(394);
4807
- const opener = /(~{3,})(?:example\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/y;
4808
- exports.example = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
4856
+ exports.example = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})(?:example\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/y, 300),
4809
4857
  // Bug: Type mismatch between outer and inner.
4810
4858
  (nodes, context) => {
4811
4859
  const [body, overflow, closer, opener, delim, type = 'markdown', param] = (0, util_1.unwrap)(nodes);
@@ -4871,17 +4919,17 @@ const table_1 = __webpack_require__(3646);
4871
4919
  const blockquote_1 = __webpack_require__(5885);
4872
4920
  const placeholder_1 = __webpack_require__(4091);
4873
4921
  const inline_1 = __webpack_require__(7973);
4874
- 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)])])));
4922
+ exports.segment = (0, combinator_1.block)((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)])]));
4875
4923
  exports.fig = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.verify)((0, combinator_1.convert)((source, context) => {
4876
4924
  // Bug: TypeScript
4877
- const fence = (/^[^\n]*\n!?>+\s/.test(source) && source.match(/^~{3,}(?=[^\S\n]*$)/mg) || []).reduce((max, fence) => fence > max ? fence : max, '~~') + '~';
4925
+ const fence = (/^[^\n]*\n!?>+ /.test(source) && source.match(/^~{3,}(?=[^\S\n]*$)/mg) || []).reduce((max, fence) => fence > max ? fence : max, '~~') + '~';
4878
4926
  return parser({
4879
4927
  context
4880
4928
  }) ? `${fence}figure ${source.replace(/^(.+\n.+\n)([\S\s]+?)\n?$/, '$1\n$2')}\n${fence}` : `${fence}figure ${source}\n\n${fence}`;
4881
4929
  }, (0, combinator_1.union)([figure_1.figure]), false), ([{
4882
4930
  value: el
4883
4931
  }]) => el.tagName === 'FIGURE')));
4884
- 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)]);
4932
+ 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)]);
4885
4933
 
4886
4934
  /***/ },
4887
4935
 
@@ -4899,7 +4947,7 @@ const parser_1 = __webpack_require__(605);
4899
4947
  const combinator_1 = __webpack_require__(3484);
4900
4948
  const label_1 = __webpack_require__(2178);
4901
4949
  const dom_1 = __webpack_require__(394);
4902
- 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]))), ([{
4950
+ exports.figbase = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/\[?\$-(?:[0-9]+\.)*0\]?(?:$|[ \n])/y, (0, combinator_1.line)((0, combinator_1.union)([label_1.label]))), ([{
4903
4951
  value: el
4904
4952
  }]) => {
4905
4953
  const label = el.getAttribute('data-label');
@@ -4941,19 +4989,19 @@ const visibility_1 = __webpack_require__(6364);
4941
4989
  const util_1 = __webpack_require__(4992);
4942
4990
  const memoize_1 = __webpack_require__(6925);
4943
4991
  const dom_1 = __webpack_require__(394);
4944
- 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)([
4992
+ exports.segment = (0, combinator_1.block)((0, combinator_1.match)(/(~{3,})(?:figure )?(?=\[?\$)/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)([
4945
4993
  // All parsers which can include closing terms.
4946
- (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 <= 16 ? fence.length : -1, [])));
4947
- 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), nodes => {
4994
+ (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 - 1, [], 2 ** 4 - 1)));
4995
+ 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), nodes => {
4948
4996
  const [label, param, content, ...caption] = (0, util_1.unwrap)(nodes);
4949
4997
  return new parser_1.List([new parser_1.Data((0, dom_1.html)('figure', attributes(label.getAttribute('data-label'), param, content, caption), [(0, dom_1.html)('figcaption', [(0, dom_1.html)('span', {
4950
4998
  class: 'figindex'
4951
4999
  }), (0, dom_1.html)('span', {
4952
5000
  class: 'figtext'
4953
5001
  }, (0, dom_1.defrag)(caption))]), (0, dom_1.html)('div', [content])]))]);
4954
- })), (0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})(?:figure|\[?\$\S*)(?!\S)[^\n]*(?:$|\n)/y, 300), (nodes, context) => {
5002
+ })), (0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})(?:figure(?=$|[ \n])|\[?\$)[^\n]*(?:$|\n)/y, 300), (nodes, context) => {
4955
5003
  const [body, overflow, closer, opener, delim] = (0, util_1.unwrap)(nodes);
4956
- 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.subinput)(opener.match(/^~+(?:figure[^\S\n]+)?(\[?\$\S+)/)?.[1] ?? '', context)) && ['label', 'Invalid label'] || /^~+(?:figure[^\S\n]+)?(\[?\$\S+)[^\S\n]+\S/.test(opener) && ['argument', 'Invalid argument'] || ['content', 'Invalid content'];
5004
+ 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.subinput)(opener.match(/^~+(?:figure )?(\[?\$\S+)/)?.[1] ?? '', context)) && ['label', 'Invalid label'] || /^~+(?:figure )?(\[?\$\S+)[^\S\n]+\S/.test(opener) && ['argument', 'Invalid argument'] || ['content', 'Invalid content'];
4957
5005
  return new parser_1.List([new parser_1.Data((0, dom_1.html)('pre', {
4958
5006
  class: 'invalid',
4959
5007
  translate: 'no',
@@ -5027,7 +5075,7 @@ const paragraph_1 = __webpack_require__(4330);
5027
5075
  const util_1 = __webpack_require__(4992);
5028
5076
  const array_1 = __webpack_require__(6876);
5029
5077
  const dom_1 = __webpack_require__(394);
5030
- exports.message = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})message\/(\S+)([^\n]*)(?:$|\n)/y, 300),
5078
+ exports.message = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})message\/(\S+)(?!\S)([^\n]*)(?:$|\n)/y, 300),
5031
5079
  // Bug: Type mismatch between outer and inner.
5032
5080
  (nodes, context) => {
5033
5081
  const [body, overflow, closer, opener, delim, type, param] = (0, util_1.unwrap)(nodes);
@@ -5149,10 +5197,10 @@ const alignment = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)/y;
5149
5197
  const align = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.union)([(0, source_1.str)(alignment)]), ([{
5150
5198
  value
5151
5199
  }]) => new parser_1.List([new parser_1.Data(value.split('/').map(s => s.split('')))])));
5152
- const delimiter = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|[#:](?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/y;
5153
- 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\n]*(?:$|\n)/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 => new parser_1.List([new parser_1.Data((0, dom_1.html)('th', attributes(ns.shift().value), (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false);
5154
- 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\n]*(?:$|\n)/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 => new parser_1.List([new parser_1.Data((0, dom_1.html)('td', attributes(ns.shift().value), (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false);
5155
- 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)])));
5200
+ const delimiter = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|[#:](?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=[ \n])/y;
5201
+ const head = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=[ \n])/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\n]*(?:$|\n)/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 => new parser_1.List([new parser_1.Data((0, dom_1.html)('th', attributes(ns.shift().value), (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false);
5202
+ const data = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=[ \n])/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\n]*(?:$|\n)/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 => new parser_1.List([new parser_1.Data((0, dom_1.html)('td', attributes(ns.shift().value), (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false);
5203
+ const dataline = (0, combinator_1.line)((0, combinator_1.rewrite)(source_1.contentline, (0, combinator_1.union)([(0, combinator_1.validate)(/!+ /y, (0, combinator_1.convert)(source => `:${source}`, data, false)), (0, combinator_1.convert)(source => `: ${source}`, data, false)])));
5156
5204
  function attributes(source) {
5157
5205
  let [, rowspan = undefined, colspan = undefined, highlight = undefined, extension = undefined] = source.match(/^[#:](?:(\d+)?:(\d+)?)?(?:(!+)([+]?))?$/) ?? [];
5158
5206
  rowspan === '1' ? rowspan = undefined : undefined;
@@ -5372,11 +5420,11 @@ const source_1 = __webpack_require__(8745);
5372
5420
  const visibility_1 = __webpack_require__(6364);
5373
5421
  const util_1 = __webpack_require__(4992);
5374
5422
  const dom_1 = __webpack_require__(394);
5375
- 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)(({
5423
+ exports.segment = (0, combinator_1.block)((0, combinator_1.focus)(/#+ +\S[^\n]*(?:\n#+(?=$|[ \n])[^\n]*)*(?:$|\n)/y, (0, combinator_1.some)((0, combinator_1.line)(({
5376
5424
  context: {
5377
5425
  source
5378
5426
  }
5379
- }) => new parser_1.List([new parser_1.Data(source)]))))));
5427
+ }) => new parser_1.List([new parser_1.Data(source)])))));
5380
5428
  exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment,
5381
5429
  // その他の表示制御は各所のCSSで行う。
5382
5430
  (0, combinator_1.state)(128 /* State.annotation */ | 64 /* State.reference */ | 32 /* State.index */ | 16 /* State.label */ | 8 /* State.link */, (0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.open)((0, source_1.str)(/##+/y), (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), (0, combinator_1.open)((0, source_1.str)('#'), (0, combinator_1.state)(251 /* State.linkers */, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline]))))), true)]), (nodes, context) => {
@@ -5705,7 +5753,7 @@ const source_1 = __webpack_require__(8745);
5705
5753
  const util_1 = __webpack_require__(4992);
5706
5754
  const dom_1 = __webpack_require__(394);
5707
5755
  exports.syntax = />*(?=>>[^>\s]\S*[^\S\n]*(?:$|\n))/y;
5708
- 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,
5756
+ exports.cite = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(exports.syntax), (0, combinator_1.union)([(0, combinator_1.line)(anchor_1.anchor),
5709
5757
  // Subject page representation.
5710
5758
  // リンクの実装は後で検討
5711
5759
  (0, combinator_1.focus)(/>>#\S*(?=\s*$)/y, ({
@@ -5722,7 +5770,7 @@ exports.cite = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.op
5722
5770
  class: 'anchor',
5723
5771
  href: source.slice(2).trimEnd(),
5724
5772
  target: '_blank'
5725
- }, source))])), (0, combinator_1.focus)(/>>.+(?=\s*$)/y, ({
5773
+ }, source))])), (0, combinator_1.focus)(/>>\S+(?=\s*$)/y, ({
5726
5774
  context: {
5727
5775
  source
5728
5776
  }
@@ -5758,10 +5806,10 @@ const autolink_1 = __webpack_require__(8072);
5758
5806
  const source_1 = __webpack_require__(8745);
5759
5807
  const util_1 = __webpack_require__(4992);
5760
5808
  const dom_1 = __webpack_require__(394);
5761
- exports.syntax = />+[^\S\n]/y;
5809
+ exports.syntax = />+ /y;
5762
5810
  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, combinator_1.convert)(
5763
5811
  // TODO: インデント数を渡してインデント数前の行頭確認を行う実装に置き換える
5764
- source => source.replace(/(?<=^>+[^\S\n])/mg, '\r'), (0, combinator_1.some)((0, combinator_1.union)([
5812
+ source => source.replace(/(?<=^>+ )/mg, '\r'), (0, combinator_1.some)((0, combinator_1.union)([
5765
5813
  // quote補助関数が残した数式をパースする。
5766
5814
  math_1.math, autolink_1.autolink, source_1.linebreak, source_1.unescsource])), false)), (ns, {
5767
5815
  source,
@@ -5788,15 +5836,15 @@ const autolink_1 = __webpack_require__(1671);
5788
5836
  const source_1 = __webpack_require__(8745);
5789
5837
  const util_1 = __webpack_require__(4992);
5790
5838
  const dom_1 = __webpack_require__(394);
5791
- 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])), ([{
5839
+ exports.sidefence = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.focus)(/\|+ [^\n]*(?:\n\|+(?=$|[ \n])[^\n]*)*(?:$|\n)/y, (0, combinator_1.union)([source])), ([{
5792
5840
  value
5793
5841
  }]) => new parser_1.List([new parser_1.Data((0, dom_1.define)(value, {
5794
5842
  class: 'invalid',
5795
5843
  ...(0, util_1.invalid)('sidefence', 'syntax', 'Reserved syntax')
5796
5844
  }))]))));
5797
- const opener = /(?=\|\|+(?:$|\s))/y;
5798
- const unindent = source => source.replace(/(?<=^|\n)\|(?:[^\S\n]|(?=\|*(?:$|\s)))|\n$/g, '');
5799
- 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)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)(autolink_1.autolink, ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('pre', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false, true))]))), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('blockquote', (0, util_1.unwrap)(ns)))])));
5845
+ const opener = /(?=\|\|+(?:$|[ \n]))/y;
5846
+ const unindent = source => source.replace(/(?<=^|\n)\|(?: |(?=\|*(?:$|[ \n])))|\n$/g, '');
5847
+ 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)(/(?:\|\|+(?=$|[ \n])[^\n]*(?:$|\n))+/y, (0, combinator_1.convert)(unindent, source, false, true)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)(autolink_1.autolink, ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('pre', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false, true))]))), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('blockquote', (0, util_1.unwrap)(ns)))])));
5800
5848
 
5801
5849
  /***/ },
5802
5850
 
@@ -5820,7 +5868,7 @@ const duff_1 = __webpack_require__(9202);
5820
5868
  const array_1 = __webpack_require__(6876);
5821
5869
  const dom_1 = __webpack_require__(394);
5822
5870
  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 => new parser_1.List([new parser_1.Data((0, dom_1.html)('table', [(0, dom_1.html)('thead', [rows.shift().value]), (0, dom_1.html)('tbody', (0, util_1.unwrap)(format(rows)))]))]))));
5823
- 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)), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('tr', (0, util_1.unwrap)(ns)))])), (0, combinator_1.rewrite)(source_1.contentline, ({
5871
+ 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)), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('tr', (0, util_1.unwrap)(ns)))])), (0, combinator_1.rewrite)(source_1.contentline, ({
5824
5872
  context: {
5825
5873
  source
5826
5874
  }
@@ -5837,7 +5885,7 @@ const align = (0, combinator_1.fmap)((0, combinator_1.open)('|', (0, combinator_
5837
5885
  source
5838
5886
  }
5839
5887
  }) => new parser_1.List([new parser_1.Data(source.at(-1) === ':' ? 'end' : '')]))])), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('td', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))]));
5840
- 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);
5888
+ 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);
5841
5889
  const head = (0, combinator_1.fmap)(cell, ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('th', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))]));
5842
5890
  const data = (0, combinator_1.fmap)(cell, ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('td', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))]));
5843
5891
  function format(rows) {
@@ -5924,7 +5972,7 @@ const source_1 = __webpack_require__(8745);
5924
5972
  const util_1 = __webpack_require__(4992);
5925
5973
  const normalize_1 = __webpack_require__(4490);
5926
5974
  const dom_1 = __webpack_require__(394);
5927
- exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+[^\S\v\f\r\n]*\r?\n(?=\S)/y, (0, combinator_1.inits)([(0, combinator_1.rewrite)(({
5975
+ exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+ *\r?\n(?=\S)/y, (0, combinator_1.inits)([(0, combinator_1.rewrite)(({
5928
5976
  context
5929
5977
  }) => {
5930
5978
  const {
@@ -5938,7 +5986,7 @@ exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+[^
5938
5986
  return new parser_1.List();
5939
5987
  }, (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(({
5940
5988
  context
5941
- }) => 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}\1[^\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])), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('aside', {
5989
+ }) => context.header ?? true, (0, combinator_1.focus)(/(---+) *\r?\n(?:[A-Za-z][0-9A-Za-z]*(?:-[0-9A-Za-z]+)*:[ \t]+\S[^\r\n]*\r?\n){1,100}\1 *(?:$|\r?\n)/y, (0, combinator_1.convert)(source => (0, normalize_1.normalize)(source.slice(source.indexOf('\n') + 1, source.trimEnd().lastIndexOf('\n'))).replace(/(\S)\s+$/mg, '$1'), (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([field])), ns => new parser_1.List([new parser_1.Data((0, dom_1.html)('aside', {
5942
5990
  class: 'header'
5943
5991
  }, [(0, dom_1.html)('details', {
5944
5992
  open: ''
@@ -5955,7 +6003,7 @@ exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+[^
5955
6003
  translate: 'no',
5956
6004
  ...(0, util_1.invalid)('header', 'syntax', 'Invalid syntax')
5957
6005
  }, (0, normalize_1.normalize)(source.slice(position))))]);
5958
- }]))), (0, combinator_1.clear)((0, source_1.str)(/[^\S\v\f\r\n]*\r?\n/y))])));
6006
+ }]))), (0, combinator_1.clear)((0, source_1.str)(/ *\r?\n/y))])));
5959
6007
  const field = (0, combinator_1.line)(({
5960
6008
  context: {
5961
6009
  source,
@@ -6027,13 +6075,13 @@ exports.inline = (0, combinator_1.lazy)(() => (0, combinator_1.union)([input =>
6027
6075
  case '[':
6028
6076
  return (0, reference_1.reference)(input) || (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
6029
6077
  case '%':
6030
- return (0, remark_1.remark)(input) || (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
6078
+ return (0, remark_1.remark)(input) || (0, link_1.textlink)(input) || (0, ruby_1.ruby)(input) || (0, bracket_1.bracket)(input);
6031
6079
  case '#':
6032
6080
  case '$':
6033
6081
  case ':':
6034
6082
  case '^':
6035
6083
  case '|':
6036
- return (0, extension_1.extension)(input) || (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
6084
+ return (0, extension_1.extension)(input) || (0, link_1.textlink)(input) || (0, ruby_1.ruby)(input) || (0, bracket_1.bracket)(input);
6037
6085
  }
6038
6086
  return (0, link_1.textlink)(input) || (0, ruby_1.ruby)(input) || (0, bracket_1.bracket)(input);
6039
6087
  case '{':
@@ -6160,14 +6208,16 @@ const account_1 = __webpack_require__(4107);
6160
6208
  const hashtag_1 = __webpack_require__(5764);
6161
6209
  const hashnum_1 = __webpack_require__(8684);
6162
6210
  const anchor_1 = __webpack_require__(8535);
6163
- const source_1 = __webpack_require__(8745);
6164
- 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,
6211
+ 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,
6165
6212
  // Escape unmatched email-like strings.
6166
- (0, source_1.str)(/[0-9a-z]+(?:[_.+-][0-9a-z]+[:@]?|:|@(?=@))*/yi), channel_1.channel, account_1.account,
6213
+ //str(/[0-9a-z]+(?:[_.+-][0-9a-z]+[:@]?|:|@(?=@))*/yi),
6214
+ channel_1.channel, account_1.account,
6167
6215
  // Escape unmatched account-like strings.
6168
- (0, source_1.str)(/@+(?:[0-9a-z]+(?:[_.+-][0-9a-z]+)*)?/yi), hashtag_1.hashtag, hashnum_1.hashnum,
6216
+ //str(/@+(?:[0-9a-z]+(?:[_.+-][0-9a-z]+)*)?/yi),
6217
+ hashtag_1.hashtag, hashnum_1.hashnum,
6169
6218
  // Escape unmatched hashtag-like strings.
6170
- (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]))));
6219
+ //str(new RegExp(/#+(?:(?:[^\p{C}\p{S}\p{P}\s]|emoji)+(?:['_.+-](?:[^\p{C}\p{S}\p{P}\s]|emoji)+)*)?/yu.source.replace(/emoji/g, emoji), 'yu')),
6220
+ anchor_1.anchor]))));
6171
6221
 
6172
6222
  /***/ },
6173
6223
 
@@ -6187,15 +6237,11 @@ const link_1 = __webpack_require__(3628);
6187
6237
  const source_1 = __webpack_require__(8745);
6188
6238
  const dom_1 = __webpack_require__(394);
6189
6239
  // https://example/@user must be a user page or a redirect page going there.
6190
- 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), ([{
6240
+ exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.surround)(/(?<![0-9a-z])@/yi, (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), true, undefined, undefined, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1).replace('/', '/@')}` : `/${source}`} }`, (0, combinator_1.union)([link_1.unsafelink]), false), ([{
6191
6241
  value
6192
6242
  }]) => new parser_1.List([new parser_1.Data((0, dom_1.define)(value, {
6193
6243
  class: 'account'
6194
- }))])))), ({
6195
- context: {
6196
- source
6197
- }
6198
- }) => new parser_1.List([new parser_1.Data(source)])])));
6244
+ }))]))))));
6199
6245
 
6200
6246
  /***/ },
6201
6247
 
@@ -6221,15 +6267,11 @@ const dom_1 = __webpack_require__(394);
6221
6267
  // cid: YYYY-MMDD-HHMM-SSmmm
6222
6268
  // 内部表現はUnixTimeに統一する(時系列順)
6223
6269
  // 外部表現は投稿ごとに投稿者の投稿時のタイムゾーンに統一する(非時系列順)
6224
- 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), ([{
6270
+ 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.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `/@${source.slice(2).replace('/', '/timeline?at=')}` : `?at=${source.slice(2)}`} }`, (0, combinator_1.union)([link_1.unsafelink]), false), ([{
6225
6271
  value
6226
6272
  }]) => new parser_1.List([new parser_1.Data((0, dom_1.define)(value, {
6227
6273
  class: 'anchor'
6228
- }))])))), ({
6229
- context: {
6230
- source
6231
- }
6232
- }) => new parser_1.List([new parser_1.Data(source)])])));
6274
+ }))]))))));
6233
6275
 
6234
6276
  /***/ },
6235
6277
 
@@ -6250,9 +6292,9 @@ const hashtag_1 = __webpack_require__(5764);
6250
6292
  const source_1 = __webpack_require__(8745);
6251
6293
  const dom_1 = __webpack_require__(394);
6252
6294
  // https://example/@user?ch=a+b must be a user channel page or a redirect page going there.
6253
- 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')), ([{
6295
+ exports.channel = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.sequence)([(0, combinator_1.surround)(/(?<![0-9a-z])@/yi, (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), true, undefined, undefined, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.some)((0, combinator_1.verify)((0, combinator_1.surround)('#', (0, source_1.str)(new RegExp([/(?!['_])(?:[^\p{C}\p{S}\p{P}\s]|emoji|'(?=[0-9A-Za-z])|_(?=[^\p{C}\p{S}\p{P}\s]|emoji))+/yu.source].join('').replace(/emoji/g, hashtag_1.emoji), 'yu')), (0, source_1.str)(new RegExp([/(?![0-9a-z@]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('').replace(/emoji/g, hashtag_1.emoji), 'yu')), false, undefined, undefined, [3 | 0 /* Backtrack.autolink */]), ([{
6254
6296
  value
6255
- }]) => !/^[0-9]{1,4}$|^[0-9]{5}/.test(value)), 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), ([{
6297
+ }]) => !/^[0-9]{1,4}$|^[0-9]{5}/.test(value)))]), (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1, source.indexOf('#')).replace('/', '/@')}` : `/${source.slice(0, source.indexOf('#'))}`} }`, (0, combinator_1.union)([link_1.unsafelink]), false), ([{
6256
6298
  value: el
6257
6299
  }], {
6258
6300
  source,
@@ -6265,11 +6307,7 @@ exports.channel = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, com
6265
6307
  class: 'channel',
6266
6308
  href: url
6267
6309
  }, src))]);
6268
- }))), ({
6269
- context: {
6270
- source
6271
- }
6272
- }) => new parser_1.List([new parser_1.Data(source)])])));
6310
+ })))));
6273
6311
 
6274
6312
  /***/ },
6275
6313
 
@@ -6288,20 +6326,16 @@ const combinator_1 = __webpack_require__(3484);
6288
6326
  const source_1 = __webpack_require__(8745);
6289
6327
  const dom_1 = __webpack_require__(394);
6290
6328
  // https://html.spec.whatwg.org/multipage/input.html
6291
- 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), ([{
6329
+ 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), ([{
6292
6330
  value
6293
- }]) => value.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 */, ({
6331
+ }]) => value.length <= 255), false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.union)([({
6294
6332
  context: {
6295
6333
  source
6296
6334
  }
6297
6335
  }) => new parser_1.List([new parser_1.Data((0, dom_1.html)('a', {
6298
6336
  class: 'email',
6299
6337
  href: `mailto:${source}`
6300
- }, source))]))), ({
6301
- context: {
6302
- source
6303
- }
6304
- }) => new parser_1.List([new parser_1.Data(source)])]));
6338
+ }, source))])]))));
6305
6339
 
6306
6340
  /***/ },
6307
6341
 
@@ -6321,16 +6355,12 @@ const link_1 = __webpack_require__(3628);
6321
6355
  const hashtag_1 = __webpack_require__(5764);
6322
6356
  const source_1 = __webpack_require__(8745);
6323
6357
  const dom_1 = __webpack_require__(394);
6324
- 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), ([{
6358
+ 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.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.slice(1)} }`, (0, combinator_1.union)([link_1.unsafelink]), false), ([{
6325
6359
  value
6326
6360
  }]) => new parser_1.List([new parser_1.Data((0, dom_1.define)(value, {
6327
6361
  class: 'hashnum',
6328
6362
  href: null
6329
- }))])))), ({
6330
- context: {
6331
- source
6332
- }
6333
- }) => new parser_1.List([new parser_1.Data(source)])])));
6363
+ }))]))))));
6334
6364
 
6335
6365
  /***/ },
6336
6366
 
@@ -6352,17 +6382,13 @@ const dom_1 = __webpack_require__(394);
6352
6382
  // https://example/hashtags/a must be a hashtag page or a redirect page going there.
6353
6383
  // https://github.com/tc39/proposal-regexp-unicode-property-escapes#matching-emoji
6354
6384
  exports.emoji = String.raw`\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F`;
6355
- 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')), ([{
6385
+ exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.verify)((0, combinator_1.surround)(new RegExp([/(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yiu.source].join('').replace(/emoji/g, exports.emoji), 'yu'), (0, source_1.str)(new RegExp([/(?!['_])(?:[^\p{C}\p{S}\p{P}\s]|emoji|'(?=[0-9A-Za-z])|_(?=[^\p{C}\p{S}\p{P}\s]|emoji))+/yu.source].join('').replace(/emoji/g, exports.emoji), 'yu')), (0, source_1.str)(new RegExp([/(?![0-9a-z@#]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('').replace(/emoji/g, exports.emoji), 'yu')), false, undefined, undefined, [3 | 0 /* Backtrack.autolink */]), ([{
6356
6386
  value
6357
- }]) => !/^[0-9]{1,4}$|^[0-9]{5}/.test(value)), 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), ([{
6387
+ }]) => !/^[0-9]{1,4}$|^[0-9]{5}/.test(value)), (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${`/hashtags/${source.slice(1)}`} }`, (0, combinator_1.union)([link_1.unsafelink]), false), ([{
6358
6388
  value
6359
6389
  }]) => new parser_1.List([new parser_1.Data((0, dom_1.define)(value, {
6360
6390
  class: 'hashtag'
6361
- }))])))), ({
6362
- context: {
6363
- source
6364
- }
6365
- }) => new parser_1.List([new parser_1.Data(source)])])));
6391
+ }))]))))));
6366
6392
 
6367
6393
  /***/ },
6368
6394
 
@@ -6378,18 +6404,11 @@ Object.defineProperty(exports, "__esModule", ({
6378
6404
  exports.lineurl = exports.url = void 0;
6379
6405
  const parser_1 = __webpack_require__(605);
6380
6406
  const combinator_1 = __webpack_require__(3484);
6407
+ const inline_1 = __webpack_require__(7973);
6381
6408
  const link_1 = __webpack_require__(3628);
6382
6409
  const source_1 = __webpack_require__(8745);
6383
- exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9A-Za-z][.+-]?)https?:\/\/(?=[\x21-\x7E])/y, (0, combinator_1.precedence)(0, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(source_1.unescsource, /(?<![-+*=~^_,.;:!?]|\/{3})(?:[-+*=~^_,.;:!?]|\/{3,}(?!\/))*(?=[\\$"`\[\](){}<>()[]{}|]|[^\x21-\x7E]|$)/y), (0, combinator_1.precedence)(1, (0, combinator_1.verify)(bracket, ns => ns.length > 0))]), undefined, [[/[^\x21-\x7E]|\$/y, 9]])), false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.convert)(url => `{ ${url} }`, link_1.unsafelink, false))), ({
6384
- context: {
6385
- source
6386
- }
6387
- }) => new parser_1.List([new parser_1.Data(source)])])));
6388
- 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))), ({
6389
- context: {
6390
- source
6391
- }
6392
- }) => new parser_1.List([new parser_1.Data(source)])])])));
6410
+ exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9A-Za-z][.+-]?|[@#])https?:\/\/(?=[\x21-\x7E])/y, (0, combinator_1.precedence)(0, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(source_1.unescsource, /(?<![-+*=~^_,.;:!?]|\/{3})(?:[-+*=~^_,.;:!?]|\/{3,}(?!\/))*(?=[\\$"`\[\](){}<>()[]{}|]|[^\x21-\x7E]|$)/y), (0, combinator_1.precedence)(1, (0, combinator_1.verify)(bracket, ns => ns.length > 0))]), undefined, [[/[^\x21-\x7E]|\$/y, 9]])), false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.convert)(url => `{ ${url} }`, link_1.unsafelink, false))), (0, combinator_1.open)((0, source_1.str)(/[^:]+/y), (0, combinator_1.some)(inline_1.inline))])));
6411
+ exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.focus)(/(?<=^|[\r\n])!?https?:\/\/\S+(?=[^\S\n]*(?=$|\n))/y, (0, combinator_1.tails)([(0, source_1.str)('!'), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.convert)(url => `{ ${url} }`, link_1.unsafelink, false))), (0, combinator_1.open)((0, source_1.str)(/[^:]+/y), (0, combinator_1.some)(inline_1.inline))])])));
6393
6412
  const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')')), (0, source_1.str)(')'), true, undefined, () => new parser_1.List(), [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']')), (0, source_1.str)(']'), true, undefined, () => new parser_1.List(), [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}')), (0, source_1.str)('}'), true, undefined, () => new parser_1.List(), [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)(source_1.unescsource, '"'))), (0, source_1.str)('"'), true, undefined, () => new parser_1.List(), [3 | 0 /* Backtrack.autolink */])]));
6394
6413
 
6395
6414
  /***/ },
@@ -6505,12 +6524,12 @@ const parser_1 = __webpack_require__(605);
6505
6524
  const combinator_1 = __webpack_require__(3484);
6506
6525
  const util_1 = __webpack_require__(4992);
6507
6526
  const dom_1 = __webpack_require__(394);
6508
- exports.code = (0, combinator_1.open)(/(?=`)/y, (0, combinator_1.match)(/(`+)(?!`)([^\n]*?)(?:((?<!`)\1(?!`))|(?=$|\n))/y, ([whole, opener, body, closer]) => () => closer ? new parser_1.List([new parser_1.Data((0, dom_1.html)('code', {
6527
+ exports.code = (0, combinator_1.match)(/(`+)(?!`)([^\n]*?)(?:((?<!`)\1(?!`))|(?=$|\n))/y, ([whole, opener, body, closer]) => () => closer ? new parser_1.List([new parser_1.Data((0, dom_1.html)('code', {
6509
6528
  'data-src': whole
6510
6529
  }, format(body)))]) : body ? new parser_1.List([new parser_1.Data((0, dom_1.html)('code', {
6511
6530
  class: 'invalid',
6512
6531
  ...(0, util_1.invalid)('code', 'syntax', `Missing the closing symbol "${opener}"`)
6513
- }, whole))]) : new parser_1.List([new parser_1.Data(opener)]), true), false, [3 | 64 /* Backtrack.bracket */]);
6532
+ }, whole))]) : new parser_1.List([new parser_1.Data(opener)]));
6514
6533
  function format(text) {
6515
6534
  return text.length > 2 && text[0] === ' ' && text[1] === '`' && text.at(-1) === ' ' ? text.slice(1, -1) : text;
6516
6535
  }
@@ -6533,11 +6552,11 @@ const inline_1 = __webpack_require__(7973);
6533
6552
  const visibility_1 = __webpack_require__(6364);
6534
6553
  const util_1 = __webpack_require__(4992);
6535
6554
  const dom_1 = __webpack_require__(394);
6536
- 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], {
6555
+ exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('~~', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '~~')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '~'), true)]))), '~~', false, ([, bs], {
6537
6556
  buffer
6538
6557
  }) => buffer.import(bs), ([, bs], {
6539
6558
  buffer
6540
- }) => bs && buffer.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && buffer), nodes => new parser_1.List([new parser_1.Data((0, dom_1.html)('del', (0, dom_1.defrag)((0, util_1.unwrap)(nodes))))])))));
6559
+ }) => bs && buffer.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && buffer), nodes => new parser_1.List([new parser_1.Data((0, dom_1.html)('del', (0, dom_1.defrag)((0, util_1.unwrap)(nodes))))]))));
6541
6560
 
6542
6561
  /***/ },
6543
6562
 
@@ -6587,7 +6606,7 @@ const subemphasis = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, comb
6587
6606
  // 開閉が明示的でない構文は開閉の不明確な記号による再帰的適用を行わず
6588
6607
  // 可能な限り早く閉じるよう解析しなければならない。
6589
6608
  // このため終端記号の後ろを見て終端を中止し同じ構文を再帰的に適用してはならない。
6590
- 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) => {
6609
+ exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('***', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)])))), (0, source_1.str)(/\*{1,3}/y), false, ([, bs, cs], context) => {
6591
6610
  const {
6592
6611
  buffer = new parser_1.List()
6593
6612
  } = context;
@@ -6694,7 +6713,7 @@ nodes => new parser_1.List([new parser_1.Data((0, dom_1.html)('em', [(0, dom_1.h
6694
6713
  nodes = prepend('*'.repeat(prefix - postfix), nodes);
6695
6714
  }
6696
6715
  return nodes;
6697
- }))));
6716
+ })));
6698
6717
  function prepend(prefix, nodes) {
6699
6718
  if (typeof nodes.head?.value === 'string') {
6700
6719
  nodes.head.value = prefix + nodes.head.value;
@@ -6940,7 +6959,7 @@ const dom_1 = __webpack_require__(394);
6940
6959
  // 複合生成インデクスを手動で同期させるより最初から重複のない
6941
6960
  // テキストまたはインデクスを付けて同期が必要な機会を減らすのが
6942
6961
  // 継続的編集において最も簡便となる。
6943
- exports.indexer = (0, combinator_1.surround)(/\s\[(?=\|\S)/y, (0, combinator_1.union)([index_1.signature, (0, combinator_1.focus)(/\|(?=\])/y, () => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
6962
+ exports.indexer = (0, combinator_1.surround)(/ \[(?=\|\S)/y, (0, combinator_1.union)([index_1.signature, (0, combinator_1.focus)(/\|(?=\])/y, () => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
6944
6963
  class: 'indexer',
6945
6964
  'data-index': ''
6946
6965
  }))]))]), /\]\s*$/y);
@@ -7046,7 +7065,7 @@ Object.setPrototypeOf(attrspecs, null);
7046
7065
  Object.values(attrspecs).forEach(o => Object.setPrototypeOf(o, null));
7047
7066
  exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/<[a-z]+(?=[ >])/yi, (0, combinator_1.union)([(0, combinator_1.surround)(
7048
7067
  // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
7049
- (0, source_1.str)(/<(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)(?=[ >])/yi), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, combinator_1.open)((0, source_1.str)(/ ?/y), (0, source_1.str)('>'), true), true, ([as, bs = new parser_1.List(), cs], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs).import(cs))], new parser_1.List(), new parser_1.List(), context))]), ([as, bs = new parser_1.List()], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs))], new parser_1.List(), new parser_1.List(), context))])), (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)(/ ?/y), (0, source_1.str)('>'), true), true, ([as, bs = new parser_1.List(), cs]) => as.import(bs).import(cs), ([as, bs = new parser_1.List()]) => as.import(bs)),
7068
+ (0, source_1.str)(/<(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)(?=[ >])/yi), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, combinator_1.open)((0, source_1.str)(/ ?/y), (0, source_1.str)('>'), true), true, ([as, bs = new parser_1.List(), cs], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs).import(cs))], new parser_1.List(), new parser_1.List(), context))]), ([as, bs = new parser_1.List()], context) => new parser_1.List([new parser_1.Data(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs))], new parser_1.List(), new parser_1.List(), context))])), (0, combinator_1.match)(new RegExp(String.raw`<(${TAGS.join('|')})(?=[ >])`, 'y'), (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${tag}`), (0, combinator_1.some)(exports.attribute), (0, combinator_1.open)((0, source_1.str)(/ ?/y), (0, source_1.str)('>'), true), true, ([as, bs = new parser_1.List(), cs]) => as.import(bs).import(cs), ([as, bs = new parser_1.List()]) => as.import(bs)),
7050
7069
  // 不可視のHTML構造が可視構造を変化させるべきでない。
7051
7070
  // 可視のHTMLは優先度変更を検討する。
7052
7071
  // このため<>は将来的に共通構造を変化させる可能性があり
@@ -7165,11 +7184,11 @@ const inline_1 = __webpack_require__(7973);
7165
7184
  const visibility_1 = __webpack_require__(6364);
7166
7185
  const util_1 = __webpack_require__(4992);
7167
7186
  const dom_1 = __webpack_require__(394);
7168
- 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], {
7187
+ exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('++', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '++')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '+'), true)]))), '++', false, ([, bs], {
7169
7188
  buffer
7170
7189
  }) => buffer.import(bs), ([, bs], {
7171
7190
  buffer
7172
- }) => bs && buffer.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && buffer), nodes => new parser_1.List([new parser_1.Data((0, dom_1.html)('ins', (0, dom_1.defrag)((0, util_1.unwrap)(nodes))))])))));
7191
+ }) => bs && buffer.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && buffer), nodes => new parser_1.List([new parser_1.Data((0, dom_1.html)('ins', (0, dom_1.defrag)((0, util_1.unwrap)(nodes))))]))));
7173
7192
 
7174
7193
  /***/ },
7175
7194
 
@@ -7192,11 +7211,11 @@ const dom_1 = __webpack_require__(394);
7192
7211
  // 可読性のため実際にはオブリーク体を指定する。
7193
7212
  // 斜体は単語に使うとかえって見づらく読み飛ばしやすくなるため使わないべきであり
7194
7213
  // ある程度の長さのある文に使うのが望ましい。
7195
- 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], {
7214
+ exports.italic = (0, combinator_1.lazy)(() => (0, combinator_1.precedence)(0, (0, util_1.repeat)('///', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('///')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '/'), inline_1.inline)])))), '///', false, ([, bs], {
7196
7215
  buffer
7197
7216
  }) => buffer.import(bs), ([, bs], {
7198
7217
  buffer
7199
- }) => bs && buffer.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && buffer), nodes => new parser_1.List([new parser_1.Data((0, dom_1.html)('i', (0, dom_1.defrag)((0, util_1.unwrap)(nodes))))])))));
7218
+ }) => bs && buffer.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && buffer), nodes => new parser_1.List([new parser_1.Data((0, dom_1.html)('i', (0, dom_1.defrag)((0, util_1.unwrap)(nodes))))]))));
7200
7219
 
7201
7220
  /***/ },
7202
7221
 
@@ -7256,11 +7275,11 @@ exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /
7256
7275
  if (content.length !== 0 && (0, visibility_1.trimBlankNodeEnd)(content).length === 0) return;
7257
7276
  return new parser_1.List([new parser_1.Data(parse(content, params, context))]);
7258
7277
  }))))));
7259
- 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.sequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.union)([inline_1.media, inline_1.shortmedia]), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), / ?}/y))]), ([{
7278
+ exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */ | 4 /* State.media */, (0, combinator_1.creation)(10, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.sequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.union)([inline_1.media, inline_1.shortmedia]), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), / ?}/y))]), ([{
7260
7279
  value: content
7261
7280
  }, {
7262
7281
  value: params
7263
- }], context) => new parser_1.List([new parser_1.Data(parse(content, params, context))])))))));
7282
+ }], context) => new parser_1.List([new parser_1.Data(parse(content, params, context))]))))));
7264
7283
  exports.unsafelink = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(10, (0, combinator_1.bind)((0, combinator_1.reverse)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([source_1.unescsource]), ']'), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), / ?}/y))])), ([{
7265
7284
  value: params
7266
7285
  }, {
@@ -7374,7 +7393,7 @@ const indexee_1 = __webpack_require__(7610);
7374
7393
  const visibility_1 = __webpack_require__(6364);
7375
7394
  const util_1 = __webpack_require__(4992);
7376
7395
  const dom_1 = __webpack_require__(394);
7377
- 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], {
7396
+ exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(251 /* State.linkers */ & ~2 /* State.mark */, (0, combinator_1.precedence)(0, (0, combinator_1.state)(2 /* State.mark */, (0, util_1.repeat)('==', (0, combinator_1.surround)('', (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('==')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '='), inline_1.inline)])))), '==', false, ([, bs], {
7378
7397
  buffer
7379
7398
  }) => buffer.import(bs), ([, bs], {
7380
7399
  buffer
@@ -7388,7 +7407,7 @@ exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(251 /*
7388
7407
  return el.id ? new parser_1.List([new parser_1.Data(el), new parser_1.Data((0, dom_1.html)('a', {
7389
7408
  href: `#${el.id}`
7390
7409
  }))]) : new parser_1.List([new parser_1.Data(el)]);
7391
- }))))));
7410
+ })))));
7392
7411
 
7393
7412
  /***/ },
7394
7413
 
@@ -7688,11 +7707,11 @@ const inline_1 = __webpack_require__(7973);
7688
7707
  const source_1 = __webpack_require__(8745);
7689
7708
  const util_1 = __webpack_require__(4992);
7690
7709
  const dom_1 = __webpack_require__(394);
7691
- exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.fallback)((0, combinator_1.surround)((0, source_1.str)(/\[%(?=\s)/y), (0, combinator_1.precedence)(3, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /\s%\]/y, [[/\s%\]/y, 3]]))), (0, combinator_1.close)(source_1.text, (0, source_1.str)(`%]`)), true, ([as, bs = new parser_1.List(), cs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
7710
+ exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.fallback)((0, combinator_1.surround)((0, source_1.str)(/\[%(?=[ \n])/y), (0, combinator_1.precedence)(3, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /[ \n]%\]/y, [[/[ \n]%\]/y, 3]]))), (0, combinator_1.close)(source_1.text, (0, source_1.str)(`%]`)), true, ([as, bs = new parser_1.List(), cs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
7692
7711
  class: 'remark'
7693
7712
  }, [(0, dom_1.html)('input', {
7694
7713
  type: 'checkbox'
7695
- }), (0, dom_1.html)('span', (0, dom_1.defrag)((0, util_1.unwrap)(as.import(bs).import(cs))))]))]), ([as, bs]) => bs && as.import(bs)), (0, combinator_1.focus)(/\[%+(?=\s)/y, ({
7714
+ }), (0, dom_1.html)('span', (0, dom_1.defrag)((0, util_1.unwrap)(as.import(bs).import(cs))))]))]), ([as, bs]) => bs && as.import(bs)), (0, combinator_1.focus)(/\[%+(?=[ \n])/y, ({
7696
7715
  context: {
7697
7716
  source
7698
7717
  }
@@ -8584,7 +8603,6 @@ function next(source, position, delimiter) {
8584
8603
  const char = source[index];
8585
8604
  switch (char) {
8586
8605
  case '$':
8587
- case '%':
8588
8606
  case '*':
8589
8607
  case '+':
8590
8608
  case '~':
@@ -8592,8 +8610,11 @@ function next(source, position, delimiter) {
8592
8610
  case '/':
8593
8611
  index = backToWhitespace(source, position, index);
8594
8612
  break;
8613
+ case '%':
8614
+ index += index - 1 > position && source.startsWith(' %]', index - 1) ? -1 : 0;
8615
+ break;
8595
8616
  case '[':
8596
- index = source[index + 1] === '|' ? backToWhitespace(source, position, index) : index;
8617
+ index += index - 1 > position && source.startsWith(' [|', index - 1) ? -1 : 0;
8597
8618
  break;
8598
8619
  case ':':
8599
8620
  index = source.startsWith('//', index + 1) ? backToUrlHead(source, position, index) : index;
@@ -8866,6 +8887,7 @@ function repeat(symbol, parser, cons, termination = (nodes, context, prefix, pos
8866
8887
  source,
8867
8888
  position
8868
8889
  } = context;
8890
+ if (!source.startsWith(symbol, context.position)) return;
8869
8891
  let nodes = new parser_1.List();
8870
8892
  let i = symbol.length;
8871
8893
  for (; source[context.position + i] === source[context.position];) ++i;
@@ -8971,8 +8993,8 @@ var blank;
8971
8993
  (function (blank) {
8972
8994
  blank.line = new RegExp(
8973
8995
  // TODO: 行全体をエスケープ
8974
- /^(?:[^\S\r\n])*(?!\s)(\\?[^\S\r\n]|&IHN;|<wbr[^\S\n]*>|\\$)+$/mg.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'gm');
8975
- blank.start = new RegExp(/(?:\\?[^\S\r\n]|&IHN;|<wbr[^\S\n]*>)+/y.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'y');
8996
+ /^(\\?[^\S\r\n]|&IHN;|<wbr ?>|\\$)+$/mg.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'gm');
8997
+ blank.start = new RegExp(/(?:\\?[^\S\r\n]|&IHN;|<wbr ?>)+/y.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'y');
8976
8998
  })(blank || (exports.blank = blank = {}));
8977
8999
  function visualize(parser) {
8978
9000
  return (0, combinator_1.convert)(source => source.replace(blank.line, `${"\u001B" /* Command.Escape */}$1`), parser, false);
@@ -8980,7 +9002,7 @@ function visualize(parser) {
8980
9002
  exports.visualize = visualize;
8981
9003
  function blankWith(starts, delimiter) {
8982
9004
  if (delimiter === undefined) return blankWith('', starts);
8983
- return new RegExp(String.raw`(?:(?=${starts})(?:\\?\s|&(?:${normalize_1.invisibleHTMLEntityNames.join('|')});|<wbr[^\S\n]*>)${
9005
+ return new RegExp(String.raw`(?:(?=${starts})(?:\\?\s|&(?:${normalize_1.invisibleHTMLEntityNames.join('|')});|<wbr ?>)${
8984
9006
  // 空行除去
8985
9007
  // 完全な空行はエスケープ済みなので再帰的バックトラックにはならない。
8986
9008
  starts && '+'})?${typeof delimiter === 'string' ? delimiter.replace(/[*+()\[\]]/g, '\\$&') : delimiter.source}`, 'y');
@@ -8990,7 +9012,6 @@ function tightStart(parser, except) {
8990
9012
  return input => isTightStart(input, except) ? parser(input) : undefined;
8991
9013
  }
8992
9014
  exports.tightStart = tightStart;
8993
- const wbr = /<wbr[^\S\n]*>/y;
8994
9015
  function isTightStart(input, except) {
8995
9016
  const {
8996
9017
  context
@@ -9018,9 +9039,8 @@ function isTightStart(input, except) {
9018
9039
  context.position = position;
9019
9040
  return true;
9020
9041
  case '<':
9021
- wbr.lastIndex = position;
9022
9042
  switch (true) {
9023
- case source.length - position >= 5 && source.startsWith('<wbr', position) && (source[position + 5] === '>' || wbr.test(source)):
9043
+ case source.length - position >= 5 && source.startsWith('<wbr', position) && (source[position + 4] === '>' || source.startsWith(' >', position + 4)):
9024
9044
  return false;
9025
9045
  }
9026
9046
  return true;