securemark 0.259.2 → 0.260.2

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 (69) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/design.md +14 -4
  3. package/dist/index.js +253 -207
  4. package/package.json +1 -1
  5. package/src/combinator/control/constraint/block.ts +2 -3
  6. package/src/combinator/control/constraint/contract.ts +5 -7
  7. package/src/combinator/control/constraint/line.ts +1 -2
  8. package/src/combinator/control/manipulation/convert.ts +1 -2
  9. package/src/combinator/control/manipulation/fence.ts +1 -2
  10. package/src/combinator/control/manipulation/match.ts +2 -3
  11. package/src/combinator/control/manipulation/scope.ts +3 -5
  12. package/src/combinator/control/manipulation/surround.ts +2 -2
  13. package/src/combinator/control/monad/bind.ts +2 -3
  14. package/src/combinator/data/parser/context.ts +20 -22
  15. package/src/combinator/data/parser/inits.ts +1 -2
  16. package/src/combinator/data/parser/sequence.ts +1 -2
  17. package/src/combinator/data/parser/some.ts +1 -2
  18. package/src/parser/api/parse.test.ts +19 -19
  19. package/src/parser/autolink.test.ts +6 -6
  20. package/src/parser/block/blockquote.test.ts +8 -8
  21. package/src/parser/block/blockquote.ts +3 -3
  22. package/src/parser/block/codeblock.test.ts +4 -4
  23. package/src/parser/block/dlist.test.ts +1 -1
  24. package/src/parser/block/dlist.ts +2 -2
  25. package/src/parser/block/extension/figure.test.ts +1 -1
  26. package/src/parser/block/extension/table.ts +3 -3
  27. package/src/parser/block/heading.test.ts +5 -5
  28. package/src/parser/block/ilist.ts +1 -1
  29. package/src/parser/block/olist.test.ts +1 -1
  30. package/src/parser/block/olist.ts +1 -1
  31. package/src/parser/block/paragraph.test.ts +14 -14
  32. package/src/parser/block/reply/cite.test.ts +11 -11
  33. package/src/parser/block/reply/cite.ts +1 -1
  34. package/src/parser/block/reply/quote.test.ts +3 -3
  35. package/src/parser/block/reply/quote.ts +1 -1
  36. package/src/parser/block/reply.test.ts +8 -8
  37. package/src/parser/block/sidefence.test.ts +6 -6
  38. package/src/parser/block/sidefence.ts +1 -1
  39. package/src/parser/block/table.ts +4 -4
  40. package/src/parser/block/ulist.test.ts +1 -1
  41. package/src/parser/block/ulist.ts +2 -2
  42. package/src/parser/block.ts +1 -1
  43. package/src/parser/context.ts +8 -7
  44. package/src/parser/inline/annotation.test.ts +3 -3
  45. package/src/parser/inline/autolink/account.test.ts +11 -11
  46. package/src/parser/inline/autolink/account.ts +4 -2
  47. package/src/parser/inline/autolink/anchor.test.ts +9 -9
  48. package/src/parser/inline/autolink/anchor.ts +14 -11
  49. package/src/parser/inline/autolink/channel.test.ts +3 -3
  50. package/src/parser/inline/autolink/hashnum.ts +4 -2
  51. package/src/parser/inline/autolink/hashtag.test.ts +20 -20
  52. package/src/parser/inline/autolink/hashtag.ts +4 -2
  53. package/src/parser/inline/autolink/url.test.ts +55 -55
  54. package/src/parser/inline/html.test.ts +0 -2
  55. package/src/parser/inline/html.ts +1 -1
  56. package/src/parser/inline/link.test.ts +110 -110
  57. package/src/parser/inline/link.ts +30 -28
  58. package/src/parser/inline/media.test.ts +1 -0
  59. package/src/parser/inline/media.ts +1 -1
  60. package/src/parser/inline/reference.test.ts +3 -3
  61. package/src/parser/inline/ruby.ts +1 -1
  62. package/src/parser/inline.test.ts +51 -51
  63. package/src/parser/source/escapable.ts +1 -1
  64. package/src/parser/source/str.ts +4 -4
  65. package/src/parser/source/text.ts +2 -3
  66. package/src/parser/source/unescapable.ts +1 -1
  67. package/src/renderer/render/media/pdf.ts +1 -0
  68. package/src/renderer/render/media/twitter.ts +7 -1
  69. package/src/util/info.ts +2 -4
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! securemark v0.259.2 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
1
+ /*! securemark v0.260.2 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("DOMPurify"), require("Prism"));
@@ -2129,14 +2129,16 @@ const memo_1 = __webpack_require__(1090);
2129
2129
  const line_1 = __webpack_require__(9315);
2130
2130
 
2131
2131
  function block(parser, separation = true) {
2132
- return input => {
2133
- const {
2134
- source,
2135
- context
2136
- } = input;
2132
+ return ({
2133
+ source,
2134
+ context
2135
+ }) => {
2137
2136
  if (source === '') return;
2138
2137
  context.memo ??= new memo_1.Memo();
2139
- const result = parser(input);
2138
+ const result = parser({
2139
+ source,
2140
+ context
2141
+ });
2140
2142
  if (!result) return;
2141
2143
  const rest = (0, parser_1.exec)(result);
2142
2144
  if (separation && !(0, line_1.isEmpty)((0, line_1.firstline)(rest))) return;
@@ -2169,13 +2171,16 @@ function validate(patterns, has, parser) {
2169
2171
  if (typeof has === 'function') return validate(patterns, '', has);
2170
2172
  if (!(0, alias_1.isArray)(patterns)) return validate([patterns], has, parser);
2171
2173
  const match = (0, global_1.Function)(['"use strict";', 'return source =>', '0', ...patterns.map(pattern => typeof pattern === 'string' ? `|| source.slice(0, ${pattern.length}) === '${pattern}'` : `|| /${pattern.source}/${pattern.flags}.test(source)`)].join(''))();
2172
- return input => {
2173
- const {
2174
- source
2175
- } = input;
2174
+ return ({
2175
+ source,
2176
+ context
2177
+ }) => {
2176
2178
  if (source === '') return;
2177
2179
  if (!match(source)) return;
2178
- const result = parser(input);
2180
+ const result = parser({
2181
+ source,
2182
+ context
2183
+ });
2179
2184
  if (!result) return;
2180
2185
  return (0, parser_1.exec)(result).length < source.length ? result : global_1.undefined;
2181
2186
  };
@@ -2184,14 +2189,17 @@ function validate(patterns, has, parser) {
2184
2189
  exports.validate = validate;
2185
2190
 
2186
2191
  function verify(parser, cond) {
2187
- return input => {
2188
- const {
2189
- source
2190
- } = input;
2192
+ return ({
2193
+ source,
2194
+ context
2195
+ }) => {
2191
2196
  if (source === '') return;
2192
- const result = parser(input);
2197
+ const result = parser({
2198
+ source,
2199
+ context
2200
+ });
2193
2201
  if (!result) return;
2194
- if (!cond((0, parser_1.eval)(result), (0, parser_1.exec)(result), input.context)) return;
2202
+ if (!cond((0, parser_1.eval)(result), (0, parser_1.exec)(result), context)) return;
2195
2203
  return (0, parser_1.exec)(result).length < source.length ? result : global_1.undefined;
2196
2204
  };
2197
2205
  }
@@ -2218,11 +2226,10 @@ const parser_1 = __webpack_require__(6728);
2218
2226
  const memo_1 = __webpack_require__(1090);
2219
2227
 
2220
2228
  function line(parser) {
2221
- return input => {
2222
- const {
2223
- source,
2224
- context
2225
- } = input;
2229
+ return ({
2230
+ source,
2231
+ context
2232
+ }) => {
2226
2233
  if (source === '') return;
2227
2234
  context.memo ??= new memo_1.Memo();
2228
2235
  const line = firstline(source);
@@ -2279,11 +2286,10 @@ exports.convert = void 0;
2279
2286
  const parser_1 = __webpack_require__(6728);
2280
2287
 
2281
2288
  function convert(conv, parser) {
2282
- return input => {
2283
- const {
2284
- source,
2285
- context
2286
- } = input;
2289
+ return ({
2290
+ source,
2291
+ context
2292
+ }) => {
2287
2293
  if (source === '') return;
2288
2294
  const src = conv(source);
2289
2295
  if (src === '') return [[], ''];
@@ -2360,10 +2366,9 @@ const line_1 = __webpack_require__(9315);
2360
2366
  const array_1 = __webpack_require__(8112);
2361
2367
 
2362
2368
  function fence(opener, limit, separation = true) {
2363
- return input => {
2364
- const {
2365
- source
2366
- } = input;
2369
+ return ({
2370
+ source
2371
+ }) => {
2367
2372
  if (source === '') return;
2368
2373
  const matches = source.match(opener);
2369
2374
  if (!matches) return;
@@ -2505,14 +2510,17 @@ const global_1 = __webpack_require__(4128);
2505
2510
  const parser_1 = __webpack_require__(6728);
2506
2511
 
2507
2512
  function match(pattern, f) {
2508
- return input => {
2509
- const {
2510
- source
2511
- } = input;
2513
+ return ({
2514
+ source,
2515
+ context
2516
+ }) => {
2512
2517
  if (source === '') return;
2513
2518
  const param = source.match(pattern);
2514
2519
  if (!param) return;
2515
- const result = f(param)(input);
2520
+ const result = f(param)({
2521
+ source,
2522
+ context
2523
+ });
2516
2524
  if (!result) return;
2517
2525
  return (0, parser_1.exec)(result).length < source.length && (0, parser_1.exec)(result).length <= source.length ? result : global_1.undefined;
2518
2526
  };
@@ -2585,11 +2593,10 @@ const parser_1 = __webpack_require__(6728);
2585
2593
 
2586
2594
  function focus(scope, parser) {
2587
2595
  const match = typeof scope === 'string' ? source => source.slice(0, scope.length) === scope ? scope : '' : source => source.match(scope)?.[0] ?? '';
2588
- return input => {
2589
- const {
2590
- source,
2591
- context
2592
- } = input;
2596
+ return ({
2597
+ source,
2598
+ context
2599
+ }) => {
2593
2600
  if (source === '') return;
2594
2601
  const src = match(source);
2595
2602
  if (src === '') return;
@@ -2608,15 +2615,17 @@ function focus(scope, parser) {
2608
2615
  exports.focus = focus;
2609
2616
 
2610
2617
  function rewrite(scope, parser) {
2611
- return input => {
2612
- const {
2613
- source,
2614
- context
2615
- } = input;
2618
+ return ({
2619
+ source,
2620
+ context
2621
+ }) => {
2616
2622
  if (source === '') return;
2617
2623
  const memo = context.memo;
2618
2624
  context.memo = global_1.undefined;
2619
- const res1 = scope(input);
2625
+ const res1 = scope({
2626
+ source,
2627
+ context
2628
+ });
2620
2629
  context.memo = memo;
2621
2630
  if (!res1 || (0, parser_1.exec)(res1).length >= source.length) return;
2622
2631
  const src = source.slice(0, source.length - (0, parser_1.exec)(res1).length);
@@ -2668,11 +2677,11 @@ function surround(opener, parser, closer, optional = false, f, g) {
2668
2677
  return surround(opener, parser, match(closer), optional, f, g);
2669
2678
  }
2670
2679
 
2671
- return input => {
2672
- const {
2673
- source: lmr_,
2674
- context
2675
- } = input;
2680
+ return ({
2681
+ source,
2682
+ context
2683
+ }) => {
2684
+ const lmr_ = source;
2676
2685
  if (lmr_ === '') return;
2677
2686
  const res1 = opener({
2678
2687
  source: lmr_,
@@ -2787,13 +2796,15 @@ const global_1 = __webpack_require__(4128);
2787
2796
  const parser_1 = __webpack_require__(6728);
2788
2797
 
2789
2798
  function bind(parser, f) {
2790
- return input => {
2791
- const {
2799
+ return ({
2800
+ source,
2801
+ context
2802
+ }) => {
2803
+ if (source === '') return;
2804
+ const res1 = parser({
2792
2805
  source,
2793
2806
  context
2794
- } = input;
2795
- if (source === '') return;
2796
- const res1 = parser(input);
2807
+ });
2797
2808
  if (!res1) return;
2798
2809
  const res2 = f((0, parser_1.eval)(res1), (0, parser_1.exec)(res1), context);
2799
2810
  if (!res2) return;
@@ -2936,11 +2947,10 @@ function apply(parser, source, context, changes, values) {
2936
2947
  }
2937
2948
 
2938
2949
  function syntax(syntax, prec, cost, state, parser) {
2939
- return creation(cost, precedence(prec, input => {
2940
- const {
2941
- source,
2942
- context
2943
- } = input;
2950
+ return creation(cost, precedence(prec, ({
2951
+ source,
2952
+ context
2953
+ }) => {
2944
2954
  if (source === '') return;
2945
2955
  const memo = context.memo ??= new memo_1.Memo();
2946
2956
  context.memorable ??= ~0;
@@ -2949,7 +2959,10 @@ function syntax(syntax, prec, cost, state, parser) {
2949
2959
  const st0 = context.state ?? 0;
2950
2960
  const st1 = context.state = st0 | state;
2951
2961
  const cache = syntax && memo.get(position, syntax, st1);
2952
- const result = cache ? cache.length === 0 ? global_1.undefined : [cache[0], source.slice(cache[1])] : parser(input);
2962
+ const result = cache ? cache.length === 0 ? global_1.undefined : [cache[0], source.slice(cache[1])] : parser({
2963
+ source,
2964
+ context
2965
+ });
2953
2966
 
2954
2967
  if (syntax && st0 & context.memorable) {
2955
2968
  cache ?? memo.set(position, syntax, st1, (0, parser_1.eval)(result), source.length - (0, parser_1.exec)(result, '').length);
@@ -2966,18 +2979,25 @@ function syntax(syntax, prec, cost, state, parser) {
2966
2979
 
2967
2980
  exports.syntax = syntax;
2968
2981
 
2969
- function creation(cost, parser) {
2970
- if (typeof cost === 'function') return creation(1, cost);
2971
- return input => {
2972
- const resources = input.context.resources ?? {
2982
+ function creation(cost, recursion, parser) {
2983
+ if (typeof cost === 'function') return creation(1, true, cost);
2984
+ if (typeof recursion === 'function') return creation(cost, true, recursion);
2985
+ return ({
2986
+ source,
2987
+ context
2988
+ }) => {
2989
+ const resources = context.resources ?? {
2973
2990
  clock: 1,
2974
2991
  recursion: 1
2975
2992
  };
2976
2993
  if (resources.clock <= 0) throw new Error('Too many creations');
2977
2994
  if (resources.recursion <= 0) throw new Error('Too much recursion');
2978
- --resources.recursion;
2979
- const result = parser(input);
2980
- ++resources.recursion;
2995
+ recursion && --resources.recursion;
2996
+ const result = parser({
2997
+ source,
2998
+ context
2999
+ });
3000
+ recursion && ++resources.recursion;
2981
3001
 
2982
3002
  if (result) {
2983
3003
  resources.clock -= cost;
@@ -2990,13 +3010,16 @@ function creation(cost, parser) {
2990
3010
  exports.creation = creation;
2991
3011
 
2992
3012
  function precedence(precedence, parser) {
2993
- return input => {
2994
- const {
2995
- context
2996
- } = input;
3013
+ return ({
3014
+ source,
3015
+ context
3016
+ }) => {
2997
3017
  const p = context.precedence;
2998
3018
  context.precedence = precedence;
2999
- const result = parser(input);
3019
+ const result = parser({
3020
+ source,
3021
+ context
3022
+ });
3000
3023
  context.precedence = p;
3001
3024
  return result;
3002
3025
  };
@@ -3005,7 +3028,13 @@ function precedence(precedence, parser) {
3005
3028
  exports.precedence = precedence;
3006
3029
 
3007
3030
  function guard(f, parser) {
3008
- return input => f(input.context) ? parser(input) : global_1.undefined;
3031
+ return ({
3032
+ source,
3033
+ context
3034
+ }) => f(context) ? parser({
3035
+ source,
3036
+ context
3037
+ }) : global_1.undefined;
3009
3038
  }
3010
3039
 
3011
3040
  exports.guard = guard;
@@ -3016,12 +3045,15 @@ function constraint(state, positive, parser) {
3016
3045
  positive = true;
3017
3046
  }
3018
3047
 
3019
- return input => {
3020
- const {
3021
- context
3022
- } = input;
3048
+ return ({
3049
+ source,
3050
+ context
3051
+ }) => {
3023
3052
  const s = positive ? state & context.state : state & ~context.state;
3024
- return s === state ? parser(input) : global_1.undefined;
3053
+ return s === state ? parser({
3054
+ source,
3055
+ context
3056
+ }) : global_1.undefined;
3025
3057
  };
3026
3058
  }
3027
3059
 
@@ -3033,13 +3065,16 @@ function state(state, positive, parser) {
3033
3065
  positive = true;
3034
3066
  }
3035
3067
 
3036
- return input => {
3037
- const {
3038
- context
3039
- } = input;
3068
+ return ({
3069
+ source,
3070
+ context
3071
+ }) => {
3040
3072
  const s = context.state ?? 0;
3041
3073
  context.state = positive ? s | state : s & ~state;
3042
- const result = parser(input);
3074
+ const result = parser({
3075
+ source,
3076
+ context
3077
+ });
3043
3078
  context.state = s;
3044
3079
  return result;
3045
3080
  };
@@ -3218,11 +3253,10 @@ const array_1 = __webpack_require__(8112);
3218
3253
 
3219
3254
  function inits(parsers, resume) {
3220
3255
  if (parsers.length === 1) return parsers[0];
3221
- return input => {
3222
- const {
3223
- source,
3224
- context
3225
- } = input;
3256
+ return ({
3257
+ source,
3258
+ context
3259
+ }) => {
3226
3260
  let rest = source;
3227
3261
  let nodes;
3228
3262
 
@@ -3266,11 +3300,10 @@ const array_1 = __webpack_require__(8112);
3266
3300
 
3267
3301
  function sequence(parsers, resume) {
3268
3302
  if (parsers.length === 1) return parsers[0];
3269
- return input => {
3270
- const {
3271
- source,
3272
- context
3273
- } = input;
3303
+ return ({
3304
+ source,
3305
+ context
3306
+ }) => {
3274
3307
  let rest = source;
3275
3308
  let nodes;
3276
3309
 
@@ -3322,11 +3355,10 @@ function some(parser, end, delimiters = [], limit = -1) {
3322
3355
  matcher: delimiter_1.Delimiters.matcher(delimiter),
3323
3356
  precedence
3324
3357
  }));
3325
- return input => {
3326
- const {
3327
- source,
3328
- context
3329
- } = input;
3358
+ return ({
3359
+ source,
3360
+ context
3361
+ }) => {
3330
3362
  if (source === '') return;
3331
3363
  let rest = source;
3332
3364
  let nodes;
@@ -3584,7 +3616,7 @@ const array_1 = __webpack_require__(8112);
3584
3616
  function bind(target, settings) {
3585
3617
  let context = { ...settings,
3586
3618
  host: settings.host ?? new url_1.ReadonlyURL(global_1.location.pathname, global_1.location.origin),
3587
- memorable: 118
3619
+ memorable: 236
3588
3620
  /* State.backtrackable */
3589
3621
 
3590
3622
  };
@@ -3956,7 +3988,7 @@ function parse(source, opts = {}, context) {
3956
3988
  ...(context?.resources && {
3957
3989
  resources: context.resources
3958
3990
  }),
3959
- memorable: 118
3991
+ memorable: 236
3960
3992
  /* State.backtrackable */
3961
3993
 
3962
3994
  };
@@ -4084,7 +4116,7 @@ const dom_1 = __webpack_require__(3252);
4084
4116
 
4085
4117
  const random_1 = __webpack_require__(7325);
4086
4118
 
4087
- exports.block = (0, combinator_1.creation)(error((0, combinator_1.reset)({
4119
+ exports.block = (0, combinator_1.creation)(1, false, error((0, combinator_1.reset)({
4088
4120
  resources: {
4089
4121
  clock: 50 * 1000,
4090
4122
  recursion: 20
@@ -4140,8 +4172,8 @@ const indent = (0, combinator_1.block)((0, combinator_1.open)(opener, (0, combin
4140
4172
 
4141
4173
  const unindent = source => source.replace(/(^|\n)>(?:[^\S\n]|(?=>*(?:$|\s)))|\n$/g, '$1');
4142
4174
 
4143
- const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, source)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)((0, combinator_1.some)(autolink_1.autolink), ns => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))])))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
4144
- const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, markdown)), (0, combinator_1.creation)(99, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, ({
4175
+ const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)(1, false, (0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, source)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)((0, combinator_1.some)(autolink_1.autolink), ns => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))])))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
4176
+ const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)(1, false, (0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, markdown)), (0, combinator_1.creation)(99, false, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, ({
4145
4177
  source,
4146
4178
  context
4147
4179
  }) => {
@@ -4259,21 +4291,21 @@ const dom_1 = __webpack_require__(3252);
4259
4291
 
4260
4292
  const array_1 = __webpack_require__(8112);
4261
4293
 
4262
- exports.dlist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, locale_1.localize)((0, combinator_1.fmap)((0, combinator_1.validate)(/^~[^\S\n]+(?=\S)/, (0, combinator_1.some)((0, combinator_1.inits)([(0, combinator_1.state)(64
4294
+ exports.dlist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, locale_1.localize)((0, combinator_1.fmap)((0, combinator_1.validate)(/^~[^\S\n]+(?=\S)/, (0, combinator_1.some)((0, combinator_1.inits)([(0, combinator_1.state)(128
4263
4295
  /* State.annotation */
4264
- | 32
4296
+ | 64
4265
4297
  /* State.reference */
4266
- | 16
4298
+ | 32
4267
4299
  /* State.index */
4268
- | 8
4300
+ | 16
4269
4301
  /* State.label */
4270
- | 4
4302
+ | 8
4271
4303
  /* State.link */
4272
- | 2
4304
+ | 4
4273
4305
  /* State.media */
4274
4306
  , (0, combinator_1.some)(term)), (0, combinator_1.some)(desc)]))), es => [(0, dom_1.html)('dl', fillTrailingDescription(es))]))));
4275
- const term = (0, combinator_1.creation)((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', (0, dom_1.defrag)(ns))]))));
4276
- const desc = (0, combinator_1.creation)((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, combinator_1.trimEnd)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('dd', (0, dom_1.defrag)(ns))]), false));
4307
+ const term = (0, combinator_1.creation)(1, false, (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', (0, dom_1.defrag)(ns))]))));
4308
+ const desc = (0, combinator_1.creation)(1, false, (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, combinator_1.trimEnd)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('dd', (0, dom_1.defrag)(ns))]), false));
4277
4309
 
4278
4310
  function fillTrailingDescription(es) {
4279
4311
  return es.length > 0 && es[es.length - 1].tagName === 'DT' ? (0, array_1.push)(es, [(0, dom_1.html)('dd')]) : es;
@@ -4561,7 +4593,7 @@ const memoize_1 = __webpack_require__(1808);
4561
4593
 
4562
4594
  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)([// All parsers which can include closing terms.
4563
4595
  (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, [])));
4564
- 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, locale_1.localize)((0, combinator_1.state)(2
4596
+ 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, locale_1.localize)((0, combinator_1.state)(4
4565
4597
  /* State.media */
4566
4598
  , (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.trimEnd)((0, combinator_1.some)(inline_1.inline)))))))])])), ([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', {
4567
4599
  class: 'figindex'
@@ -4859,9 +4891,9 @@ const row = (0, combinator_1.lazy)(() => (0, combinator_1.dup)((0, combinator_1.
4859
4891
  const alignment = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)/;
4860
4892
  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(''))));
4861
4893
  const delimiter = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|^[#:](?:(?!:\D|0)\d*:(?!0)\d*)?!*(?=\s)/;
4862
- const head = (0, combinator_1.creation)((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.trim)((0, visibility_1.visualize)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('th', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false));
4863
- const data = (0, combinator_1.creation)((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.trim)((0, visibility_1.visualize)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('td', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false));
4864
- const dataline = (0, combinator_1.creation)((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)), (0, combinator_1.convert)(source => `: ${source}`, data)]))));
4894
+ const head = (0, combinator_1.creation)(1, false, (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.trim)((0, visibility_1.visualize)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('th', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false));
4895
+ const data = (0, combinator_1.creation)(1, false, (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.trim)((0, visibility_1.visualize)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('td', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false));
4896
+ const dataline = (0, combinator_1.creation)(1, false, (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)), (0, combinator_1.convert)(source => `: ${source}`, data)]))));
4865
4897
 
4866
4898
  function attributes(source) {
4867
4899
  let [, rowspan = global_1.undefined, colspan = global_1.undefined, highlight = global_1.undefined] = source.match(/^.(?:(\d+)?:(\d+)?)?(!+)?$/) ?? [];
@@ -5098,19 +5130,19 @@ const dom_1 = __webpack_require__(3252);
5098
5130
  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)(({
5099
5131
  source
5100
5132
  }) => [[source], ''])))));
5101
- exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.state)(64
5133
+ exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.state)(128
5102
5134
  /* State.annotation */
5103
- | 32
5135
+ | 64
5104
5136
  /* State.reference */
5105
- | 16
5137
+ | 32
5106
5138
  /* State.index */
5107
- | 8
5139
+ | 16
5108
5140
  /* State.label */
5109
- | 4
5141
+ | 8
5110
5142
  /* State.link */
5111
- | 2
5143
+ | 4
5112
5144
  /* State.media */
5113
- , (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)(1
5145
+ , (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)(2
5114
5146
  /* State.autolink */
5115
5147
  , (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]) => [h.length <= 6 ? (0, dom_1.html)(`h${h.length}`, (0, dom_1.defrag)(ns)) : (0, dom_1.html)(`h6`, {
5116
5148
  class: 'invalid',
@@ -5161,10 +5193,10 @@ const inline_1 = __webpack_require__(1160);
5161
5193
 
5162
5194
  const dom_1 = __webpack_require__(3252);
5163
5195
 
5164
- exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^[-+*](?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.state)(2
5196
+ exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^[-+*](?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.state)(4
5165
5197
  /* State.media */
5166
5198
  , exports.ilist_))));
5167
- 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.creation)((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.some)(inline_1.inline), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), olist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])])))), es => [(0, dom_1.html)('ul', {
5199
+ 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.creation)(1, false, (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.some)(inline_1.inline), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), olist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])])))), es => [(0, dom_1.html)('ul', {
5168
5200
  class: 'invalid',
5169
5201
  'data-invalid-syntax': 'list',
5170
5202
  'data-invalid-type': 'syntax',
@@ -5248,12 +5280,12 @@ const openers = {
5248
5280
  '.': /^([0-9]+|[a-z]+|[A-Z]+)(?:-(?!-)[0-9]*)*(?![^\S\n])\.?(?:$|\s)/,
5249
5281
  '(': /^\(([0-9]*|[a-z]*)(?![^)\n])\)?(?:-(?!-)[0-9]*)*(?:$|\s)/
5250
5282
  };
5251
- 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('|')), (0, combinator_1.state)(2
5283
+ 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('|')), (0, combinator_1.state)(4
5252
5284
  /* State.media */
5253
5285
  , exports.olist_))));
5254
5286
  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 => type(ms[1]).charCodeAt(0) || 0, [])), (0, combinator_1.match)(openers['('], (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => type(ms[1]).charCodeAt(0) || 0, []))])));
5255
5287
 
5256
- const list = (type, form) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)((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.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_]))]), exports.invalid), ns => [(0, dom_1.html)('li', {
5288
+ const list = (type, form) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)(1, false, (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.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_]))]), exports.invalid), ns => [(0, dom_1.html)('li', {
5257
5289
  'data-marker': ns[0] || global_1.undefined
5258
5290
  }, (0, dom_1.defrag)((0, ulist_1.fillFirstLine)((0, array_1.shift)(ns)[1])))]), true)]))), es => [format((0, dom_1.html)('ol', es), type, form)]);
5259
5291
 
@@ -5446,7 +5478,7 @@ const source_1 = __webpack_require__(6743);
5446
5478
 
5447
5479
  const dom_1 = __webpack_require__(3252);
5448
5480
 
5449
- exports.cite = (0, combinator_1.creation)((0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.validate)('>>', (0, combinator_1.reverse)((0, combinator_1.tails)([(0, source_1.str)(/^>*(?=>>[^>\s]+[^\S\n]*(?:$|\n))/), (0, combinator_1.union)([anchor_1.anchor, // Subject page representation.
5481
+ exports.cite = (0, combinator_1.creation)(1, false, (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.validate)('>>', (0, combinator_1.reverse)((0, combinator_1.tails)([(0, source_1.str)(/^>*(?=>>[^>\s]+[^\S\n]*(?:$|\n))/), (0, combinator_1.union)([anchor_1.anchor, // Subject page representation.
5450
5482
  // リンクの実装は後で検討
5451
5483
  (0, combinator_1.focus)(/^>>\.[^\S\n]*(?:$|\n)/, () => [[(0, dom_1.html)('a', {
5452
5484
  class: 'anchor'
@@ -5492,7 +5524,7 @@ const autolink_1 = __webpack_require__(6578);
5492
5524
  const dom_1 = __webpack_require__(3252);
5493
5525
 
5494
5526
  exports.syntax = /^>+(?=[^\S\n])|^>(?=[^\s>])|^>+(?=[^\s>])(?![0-9a-z]+(?:-[0-9a-z]+)*(?![0-9A-Za-z@#:]))/;
5495
- exports.quote = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)('>', (0, combinator_1.union)([(0, combinator_1.rewrite)((0, combinator_1.some)((0, combinator_1.validate)(new RegExp(exports.syntax.source.split('|')[0]), source_1.anyline)), qblock), (0, combinator_1.rewrite)((0, combinator_1.validate)(new RegExp(exports.syntax.source.split('|').slice(1).join('|')), source_1.anyline), (0, combinator_1.line)((0, combinator_1.union)([(0, source_1.str)(/^.+/)])))])), ns => [(0, dom_1.html)('span', ns.length > 1 ? {
5527
+ exports.quote = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, false, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)('>', (0, combinator_1.union)([(0, combinator_1.rewrite)((0, combinator_1.some)((0, combinator_1.validate)(new RegExp(exports.syntax.source.split('|')[0]), source_1.anyline)), qblock), (0, combinator_1.rewrite)((0, combinator_1.validate)(new RegExp(exports.syntax.source.split('|').slice(1).join('|')), source_1.anyline), (0, combinator_1.line)((0, combinator_1.union)([(0, source_1.str)(/^.+/)])))])), ns => [(0, dom_1.html)('span', ns.length > 1 ? {
5496
5528
  class: 'quote'
5497
5529
  } : {
5498
5530
  class: 'quote invalid',
@@ -5575,7 +5607,7 @@ const opener = /^(?=\|\|+(?:$|\s))/;
5575
5607
 
5576
5608
  const unindent = source => source.replace(/(^|\n)\|(?:[^\S\n]|(?=\|*(?:$|\s)))|\n$/g, '$1');
5577
5609
 
5578
- const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.focus)(/^(?:\|\|+(?:[^\S\n][^\n]*)?(?:$|\n))+/, (0, combinator_1.convert)(unindent, source)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)((0, combinator_1.some)(autolink_1.autolink), ns => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))])))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
5610
+ const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)(1, false, (0, combinator_1.union)([(0, combinator_1.focus)(/^(?:\|\|+(?:[^\S\n][^\n]*)?(?:$|\n))+/, (0, combinator_1.convert)(unindent, source)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)((0, combinator_1.some)(autolink_1.autolink), ns => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))])))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
5579
5611
 
5580
5612
  /***/ }),
5581
5613
 
@@ -5606,7 +5638,7 @@ const array_1 = __webpack_require__(8112);
5606
5638
 
5607
5639
  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))])])));
5608
5640
 
5609
- const row = (parser, optional) => (0, combinator_1.creation)((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, ({
5641
+ const row = (parser, optional) => (0, combinator_1.creation)(1, false, (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, ({
5610
5642
  source
5611
5643
  }) => [[(0, dom_1.html)('tr', {
5612
5644
  class: 'invalid',
@@ -5615,10 +5647,10 @@ const row = (parser, optional) => (0, combinator_1.creation)((0, combinator_1.fa
5615
5647
  'data-invalid-message': 'Missing the start symbol of the table row'
5616
5648
  }, [(0, dom_1.html)('td', source.replace('\n', ''))])], ''])));
5617
5649
 
5618
- const align = (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.open)('|', (0, combinator_1.union)([(0, combinator_1.focus)(/^:-+:/, () => [['center'], '']), (0, combinator_1.focus)(/^:-+/, () => [['start'], '']), (0, combinator_1.focus)(/^-+:/, () => [['end'], '']), (0, combinator_1.focus)(/^-+/, () => [[''], ''])])), ns => [(0, dom_1.html)('td', (0, dom_1.defrag)(ns))]));
5650
+ const align = (0, combinator_1.creation)(1, false, (0, combinator_1.fmap)((0, combinator_1.open)('|', (0, combinator_1.union)([(0, combinator_1.focus)(/^:-+:/, () => [['center'], '']), (0, combinator_1.focus)(/^:-+/, () => [['start'], '']), (0, combinator_1.focus)(/^-+:/, () => [['end'], '']), (0, combinator_1.focus)(/^-+/, () => [[''], ''])])), ns => [(0, dom_1.html)('td', (0, dom_1.defrag)(ns))]));
5619
5651
  const cell = (0, combinator_1.surround)(/^\|\s*(?=\S)/, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /^\|/, [[/^[|\\]?\s*$/, 9]]), /^[^|]*/, true);
5620
- const head = (0, combinator_1.creation)((0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('th', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))]));
5621
- const data = (0, combinator_1.creation)((0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('td', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))]));
5652
+ const head = (0, combinator_1.creation)(1, false, (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('th', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))]));
5653
+ const data = (0, combinator_1.creation)(1, false, (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('td', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))]));
5622
5654
 
5623
5655
  function format(rows) {
5624
5656
  const aligns = rows[0].className === 'invalid' ? [] : (0, duff_1.duffReduce)(rows.shift().children, (acc, el) => (0, array_1.push)(acc, [el.textContent]), []);
@@ -5664,11 +5696,11 @@ const dom_1 = __webpack_require__(3252);
5664
5696
 
5665
5697
  const array_1 = __webpack_require__(8112);
5666
5698
 
5667
- exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^-(?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.state)(2
5699
+ exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^-(?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.state)(4
5668
5700
  /* State.media */
5669
5701
  , exports.ulist_))));
5670
- 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.creation)((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, 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_]))]), olist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)(fillFirstLine(ns)))]), true)])))), es => [format((0, dom_1.html)('ul', es))])));
5671
- exports.checkbox = (0, combinator_1.creation)((0, combinator_1.focus)(/^\[[xX ]\](?=$|\s)/, ({
5702
+ 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.creation)(1, false, (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, 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_]))]), olist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)(fillFirstLine(ns)))]), true)])))), es => [format((0, dom_1.html)('ul', es))])));
5703
+ exports.checkbox = (0, combinator_1.creation)(1, false, (0, combinator_1.focus)(/^\[[xX ]\](?=$|\s)/, ({
5672
5704
  source
5673
5705
  }) => [[(0, dom_1.html)('span', {
5674
5706
  class: 'checkbox'
@@ -5865,13 +5897,13 @@ const visibility_1 = __webpack_require__(7618);
5865
5897
 
5866
5898
  const dom_1 = __webpack_require__(3252);
5867
5899
 
5868
- exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('((', (0, combinator_1.constraint)(64
5900
+ exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('((', (0, combinator_1.constraint)(128
5869
5901
  /* State.annotation */
5870
5902
  , false, (0, combinator_1.syntax)(32
5871
5903
  /* Syntax.annotation */
5872
- , 6, 1, 64
5904
+ , 6, 1, 128
5873
5905
  /* State.annotation */
5874
- | 2
5906
+ | 4
5875
5907
  /* State.media */
5876
5908
  , (0, visibility_1.startLoose)((0, combinator_1.context)({
5877
5909
  delimiters: global_1.undefined
@@ -5912,7 +5944,7 @@ const source_1 = __webpack_require__(6743);
5912
5944
 
5913
5945
  const util_1 = __webpack_require__(9437);
5914
5946
 
5915
- exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]|\S[#>])/, (0, combinator_1.constraint)(1
5947
+ exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]|\S[#>])/, (0, combinator_1.constraint)(2
5916
5948
  /* State.autolink */
5917
5949
  , false, (0, combinator_1.syntax)(2
5918
5950
  /* Syntax.autolink */
@@ -5946,7 +5978,9 @@ const source_1 = __webpack_require__(6743);
5946
5978
  const dom_1 = __webpack_require__(3252); // https://example/@user must be a user page or a redirect page going there.
5947
5979
 
5948
5980
 
5949
- exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('@', (0, combinator_1.tails)([(0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?)*\//), ([source]) => source.length <= 253 + 1), (0, combinator_1.verify)((0, source_1.str)(/^[A-Za-z][0-9A-Za-z]*(?:-[0-9A-Za-z]+)*/), ([source]) => source.length <= 64)])), (0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1).replace('/', '/@')}` : `/${source}`} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
5981
+ exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1
5982
+ /* State.shortcut */
5983
+ , false, (0, combinator_1.open)('@', (0, combinator_1.tails)([(0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?)*\//), ([source]) => source.length <= 253 + 1), (0, combinator_1.verify)((0, source_1.str)(/^[A-Za-z][0-9A-Za-z]*(?:-[0-9A-Za-z]+)*/), ([source]) => source.length <= 64)]))), (0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1).replace('/', '/@')}` : `/${source}`} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
5950
5984
  class: 'account'
5951
5985
  })]));
5952
5986
 
@@ -5975,7 +6009,9 @@ const dom_1 = __webpack_require__(3252); // Timeline(pseudonym): user/tid
5975
6009
  // 外部表現は投稿ごとに投稿者の投稿時のタイムゾーンに統一する(非時系列順)
5976
6010
 
5977
6011
 
5978
- exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('>>', (0, combinator_1.fmap)((0, combinator_1.focus)(/^>>(?:[A-Za-z][0-9A-Za-z]*(?:-[0-9A-Za-z]+)*\/)?[0-9A-Za-z]+(?:-[0-9A-Za-z]+)*(?![0-9A-Za-z@#:])/, (0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `/@${source.slice(2).replace('/', '/timeline/')}` : `?at=${source.slice(2)}`} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
6012
+ exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('>>', (0, combinator_1.fmap)((0, combinator_1.constraint)(1
6013
+ /* State.shortcut */
6014
+ , false, (0, combinator_1.focus)(/^>>(?:[A-Za-z][0-9A-Za-z]*(?:-[0-9A-Za-z]+)*\/)?[0-9A-Za-z]+(?:-[0-9A-Za-z]+)*(?![0-9A-Za-z@#:])/, (0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `/@${source.slice(2).replace('/', '/timeline/')}` : `?at=${source.slice(2)}`} }`, (0, combinator_1.union)([link_1.unsafelink])))), ([el]) => [(0, dom_1.define)(el, {
5979
6015
  class: 'anchor'
5980
6016
  })])));
5981
6017
 
@@ -6064,7 +6100,9 @@ const source_1 = __webpack_require__(6743);
6064
6100
 
6065
6101
  const dom_1 = __webpack_require__(3252);
6066
6102
 
6067
- exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, source_1.str)(new RegExp(/^[0-9]{1,16}(?![^\p{C}\p{S}\p{P}\s]|emoji|['_])/u.source.replace(/emoji/, hashtag_1.emoji), 'u'))), (0, combinator_1.convert)(source => `[${source}]{ ${source.slice(1)} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
6103
+ exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1
6104
+ /* State.shortcut */
6105
+ , false, (0, combinator_1.open)('#', (0, source_1.str)(new RegExp(/^[0-9]{1,16}(?![^\p{C}\p{S}\p{P}\s]|emoji|['_])/u.source.replace(/emoji/, hashtag_1.emoji), 'u')))), (0, combinator_1.convert)(source => `[${source}]{ ${source.slice(1)} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
6068
6106
  class: 'hashnum',
6069
6107
  href: null
6070
6108
  })]));
@@ -6093,7 +6131,9 @@ const dom_1 = __webpack_require__(3252); // https://example/hashtags/a must be a
6093
6131
 
6094
6132
 
6095
6133
  exports.emoji = String.raw`\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F`;
6096
- exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, combinator_1.tails)([(0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?)*\//), ([source]) => source.length <= 253 + 1), (0, combinator_1.verify)((0, source_1.str)(new RegExp([/^(?=[0-9]{0,127}_?(?:[^\d\p{C}\p{S}\p{P}\s]|emoji))/u.source, /(?:[^\p{C}\p{S}\p{P}\s]|emoji|_(?=[^\p{C}\p{S}\p{P}\s]|emoji)){1,128}/u.source, /(?!_?(?:[^\p{C}\p{S}\p{P}\s]|emoji)|')/u.source].join('').replace(/emoji/g, exports.emoji), 'u')), ([source]) => source.length <= 128)])), (0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1).replace('/', '/hashtags/')}` : `/hashtags/${source.slice(1)}`} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
6134
+ exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1
6135
+ /* State.shortcut */
6136
+ , false, (0, combinator_1.open)('#', (0, combinator_1.tails)([(0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?)*\//), ([source]) => source.length <= 253 + 1), (0, combinator_1.verify)((0, source_1.str)(new RegExp([/^(?=[0-9]{0,127}_?(?:[^\d\p{C}\p{S}\p{P}\s]|emoji))/u.source, /(?:[^\p{C}\p{S}\p{P}\s]|emoji|_(?=[^\p{C}\p{S}\p{P}\s]|emoji)){1,128}/u.source, /(?!_?(?:[^\p{C}\p{S}\p{P}\s]|emoji)|')/u.source].join('').replace(/emoji/g, exports.emoji), 'u')), ([source]) => source.length <= 128)]))), (0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1).replace('/', '/hashtags/')}` : `/hashtags/${source.slice(1)}`} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
6097
6137
  class: 'hashtag'
6098
6138
  }, el.innerText)]));
6099
6139
 
@@ -6460,11 +6500,11 @@ const visibility_1 = __webpack_require__(7618);
6460
6500
 
6461
6501
  const dom_1 = __webpack_require__(3252);
6462
6502
 
6463
- exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[#', (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)('[#', (0, combinator_1.constraint)(16
6503
+ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[#', (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)('[#', (0, combinator_1.constraint)(32
6464
6504
  /* State.index */
6465
6505
  , false, (0, combinator_1.syntax)(1024
6466
6506
  /* Syntax.index */
6467
- , 2, 1, 127
6507
+ , 2, 1, 254
6468
6508
  /* State.linkable */
6469
6509
  , (0, visibility_1.startTight)((0, combinator_1.open)((0, source_1.stropt)(/^\|?/), (0, visibility_1.trimBlankEnd)((0, combinator_1.some)((0, combinator_1.union)([signature, inline_1.inline]), ']', [[/^\\?\n/, 9], [']', 2]])), true)))), ']', false, ([, ns], rest) => [[(0, dom_1.html)('a', (0, dom_1.defrag)(ns))], rest])), ([el]) => [(0, dom_1.define)(el, {
6470
6510
  id: el.id ? null : global_1.undefined,
@@ -6576,7 +6616,7 @@ const index_1 = __webpack_require__(4479);
6576
6616
 
6577
6617
  const dom_1 = __webpack_require__(3252);
6578
6618
 
6579
- exports.indexer = (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.surround)(/^\s+(?=\[#\S)/, (0, combinator_1.state)(16
6619
+ exports.indexer = (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.surround)(/^\s+(?=\[#\S)/, (0, combinator_1.state)(32
6580
6620
  /* State.index */
6581
6621
  , false, (0, combinator_1.union)([(0, combinator_1.focus)('[#]', () => [[(0, dom_1.html)('a', {
6582
6622
  href: '#'
@@ -6609,7 +6649,7 @@ const dom_1 = __webpack_require__(3252);
6609
6649
 
6610
6650
  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]))/);
6611
6651
  exports.segment = (0, combinator_1.clear)((0, combinator_1.validate)(['[$', '$'], (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])));
6612
- exports.label = (0, combinator_1.validate)(['[$', '$'], (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.constraint)(8
6652
+ exports.label = (0, combinator_1.validate)(['[$', '$'], (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.constraint)(16
6613
6653
  /* State.label */
6614
6654
  , false, (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])), ([text]) => [(0, dom_1.html)('a', {
6615
6655
  class: 'label',
@@ -6723,7 +6763,7 @@ exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('<', (0,
6723
6763
  /* State.none */
6724
6764
  , (0, combinator_1.union)([(0, combinator_1.focus)(/^<wbr[^\S\n]*>/i, () => [[(0, dom_1.html)('wbr')], '']), (0, combinator_1.surround)( // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
6725
6765
  (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, source_1.str)(/^[^\S\n]*>/), true, ([as, bs = [], cs], rest) => [[elem(as[0].slice(1), (0, array_1.push)((0, array_1.unshift)(as, bs), cs), [], [])], rest]), (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, source_1.str)(/^[^\S\n]*>/), true), (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}>`), 5]]), true))]), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], rest) => [[elem(tag, as, bs, cs)], rest], ([as, bs = []], rest) => [[elem(tag, as, bs, [])], rest]), ([, tag]) => TAGS.indexOf(tag), [])), (0, combinator_1.match)(/^<([a-z]+)(?=[^\S\n]|>)/i, (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, source_1.str)(/^[^\S\n]*>/), true), (0, combinator_1.subsequence)([(0, combinator_1.focus)(/^[^\S\n]*\n/, (0, combinator_1.some)(inline_1.inline)), (0, combinator_1.some)(inline_1.inline, `</${tag}>`, [[`</${tag}>`, 5]])]), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], rest) => [[elem(tag, as, bs, cs)], rest], ([as, bs = []], rest) => [[elem(tag, as, bs, [])], rest]), ([, tag]) => tag, new cache_1.Cache(10000)))])))));
6726
- exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|>)/i)]); // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
6766
+ exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="[^"\n]*")?(?=[^\S\n]|>)/i)]); // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
6727
6767
  // [...document.querySelectorAll('tbody > tr > td:first-child')].map(el => el.textContent.slice(1, -1))
6728
6768
 
6729
6769
  const TAGS = global_1.Object.freeze(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "h1", "h2", "h3", "h4", "h5", "h6", "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", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "param", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp"]);
@@ -6884,42 +6924,45 @@ const optspec = {
6884
6924
  };
6885
6925
  Object.setPrototypeOf(optspec, null);
6886
6926
  exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'], (0, combinator_1.union)([medialink, textlink])));
6887
- const textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4
6927
+ const textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8
6888
6928
  /* State.link */
6889
6929
  , false, (0, combinator_1.syntax)(256
6890
6930
  /* Syntax.link */
6891
- , 2, 10, 127
6931
+ , 2, 10, 254
6892
6932
  /* State.linkable */
6893
6933
  , (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)([inline_1.inline]), ']', [[/^\\?\n/, 9], [']', 2]]), ']', true)), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))])), ([params, content = []], rest, context) => {
6894
6934
  if (content.length !== 0 && (0, visibility_1.trimNode)(content).length === 0) return;
6895
6935
 
6896
6936
  for (let source = (0, util_1.stringify)(content); source;) {
6897
- const result = (0, combinator_1.state)(1
6898
- /* State.autolink */
6899
- , false, autolink_1.autolink)({
6937
+ const result = autolink({
6900
6938
  source,
6901
6939
  context
6902
6940
  });
6903
- if (typeof (0, parser_1.eval)(result)[0] === 'object') return;
6904
- source = (0, parser_1.exec)(result);
6941
+ if (typeof (0, parser_1.eval)(result, [])[0] === 'object') return;
6942
+ source = (0, parser_1.exec)(result, '');
6905
6943
  }
6906
6944
 
6907
6945
  return parse(content, params, rest, context);
6908
6946
  }))));
6909
- const medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4
6947
+ const medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8
6910
6948
  /* State.link */
6911
- | 2
6949
+ | 4
6912
6950
  /* State.media */
6913
6951
  , false, (0, combinator_1.syntax)(256
6914
6952
  /* Syntax.link */
6915
- , 2, 10, 127
6953
+ , 2, 10, 254
6916
6954
  /* State.linkable */
6917
- ^ 2
6955
+ ^ 4
6918
6956
  /* State.media */
6919
6957
  , (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 = []], rest, context) => parse(content, params, rest, context)))));
6920
6958
  exports.unsafelink = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(10, (0, combinator_1.precedence)(2, (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 = []], rest, context) => parse(content, params, rest, context)))));
6921
6959
  exports.uri = (0, combinator_1.union)([(0, combinator_1.open)(/^[^\S\n]+/, (0, source_1.str)(/^\S+/)), (0, source_1.str)(/^[^\s{}]+/)]);
6922
6960
  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]|})/), (0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[^\s{}]+/), opt => [` \\${opt.slice(1)}`])]);
6961
+ const autolink = (0, combinator_1.state)(2
6962
+ /* State.autolink */
6963
+ , false, (0, combinator_1.state)(1
6964
+ /* State.shortcut */
6965
+ , autolink_1.autolink));
6923
6966
 
6924
6967
  function parse(content, params, rest, context) {
6925
6968
  const INSECURE_URI = params.shift();
@@ -6928,25 +6971,6 @@ function parse(content, params, rest, context) {
6928
6971
  return [[(0, dom_1.define)(el, (0, html_1.attributes)('link', [], optspec, params))], rest];
6929
6972
  }
6930
6973
 
6931
- function resolve(uri, host, source) {
6932
- switch (true) {
6933
- case uri.slice(0, 2) === '^/':
6934
- const last = host.pathname.slice(host.pathname.lastIndexOf('/') + 1);
6935
- return last.includes('.') // isFile
6936
- && /^[0-9]*[A-Za-z][0-9A-Za-z]*$/.test(last.slice(last.lastIndexOf('.') + 1)) ? `${host.pathname.slice(0, -last.length)}${uri.slice(2)}` : `${host.pathname.replace(/\/?$/, '/')}${uri.slice(2)}`;
6937
-
6938
- case host.origin === source.origin && host.pathname === source.pathname:
6939
- case uri.slice(0, 2) === '//':
6940
- return uri;
6941
-
6942
- default:
6943
- const target = new url_1.ReadonlyURL(uri, source.href);
6944
- return target.origin === host.origin ? target.href.slice(target.origin.length) : target.href;
6945
- }
6946
- }
6947
-
6948
- exports.resolve = resolve;
6949
-
6950
6974
  function elem(INSECURE_URI, content, uri, origin) {
6951
6975
  let type;
6952
6976
  let message;
@@ -6961,6 +6985,7 @@ function elem(INSECURE_URI, content, uri, origin) {
6961
6985
  }
6962
6986
 
6963
6987
  return (0, dom_1.html)('a', {
6988
+ class: content.length === 0 ? 'url' : 'link',
6964
6989
  href: uri.source,
6965
6990
  target: global_1.undefined || uri.origin !== origin || typeof content[0] === 'object' && content[0].classList.contains('media') ? '_blank' : global_1.undefined
6966
6991
  }, content.length === 0 ? decode(INSECURE_URI) : content);
@@ -6975,6 +7000,7 @@ function elem(INSECURE_URI, content, uri, origin) {
6975
7000
  switch (true) {
6976
7001
  case content.length === 1 && typeof content[0] === 'string' && pattern.test(INSECURE_URI) && pattern.test(content[0]) && INSECURE_URI.replace(/[^+\d]/g, '') === content[0].replace(/[^+\d]/g, ''):
6977
7002
  return (0, dom_1.html)('a', {
7003
+ class: 'tel',
6978
7004
  href: uri.source
6979
7005
  }, content);
6980
7006
  }
@@ -6992,6 +7018,25 @@ function elem(INSECURE_URI, content, uri, origin) {
6992
7018
  }, content.length === 0 ? INSECURE_URI : content);
6993
7019
  }
6994
7020
 
7021
+ function resolve(uri, host, source) {
7022
+ switch (true) {
7023
+ case uri.slice(0, 2) === '^/':
7024
+ const last = host.pathname.slice(host.pathname.lastIndexOf('/') + 1);
7025
+ return last.includes('.') // isFile
7026
+ && /^[0-9]*[A-Za-z][0-9A-Za-z]*$/.test(last.slice(last.lastIndexOf('.') + 1)) ? `${host.pathname.slice(0, -last.length)}${uri.slice(2)}` : `${host.pathname.replace(/\/?$/, '/')}${uri.slice(2)}`;
7027
+
7028
+ case host.origin === source.origin && host.pathname === source.pathname:
7029
+ case uri.slice(0, 2) === '//':
7030
+ return uri;
7031
+
7032
+ default:
7033
+ const target = new url_1.ReadonlyURL(uri, source.href);
7034
+ return target.origin === host.origin ? target.href.slice(target.origin.length) : target.href;
7035
+ }
7036
+ }
7037
+
7038
+ exports.resolve = resolve;
7039
+
6995
7040
  function decode(uri) {
6996
7041
  if (!uri.includes('%')) return uri;
6997
7042
 
@@ -7111,7 +7156,7 @@ const optspec = {
7111
7156
  rel: global_1.undefined
7112
7157
  };
7113
7158
  Object.setPrototypeOf(optspec, null);
7114
- exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.open)('!', (0, combinator_1.constraint)(2
7159
+ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.open)('!', (0, combinator_1.constraint)(4
7115
7160
  /* State.media */
7116
7161
  , false, (0, combinator_1.syntax)(64
7117
7162
  /* Syntax.media */
@@ -7135,7 +7180,7 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '
7135
7180
  el.style.aspectRatio = el.getAttribute('aspect-ratio');
7136
7181
  }
7137
7182
 
7138
- if (context.state & 4
7183
+ if (context.state & 8
7139
7184
  /* State.link */
7140
7185
  ) return [[el], rest];
7141
7186
  if (cache && cache.tagName !== 'IMG') return (0, combinator_1.creation)(10, (..._) => [[el], rest])({
@@ -7143,6 +7188,7 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '
7143
7188
  context
7144
7189
  });
7145
7190
  return (0, combinator_1.fmap)(link_1.unsafelink, ([link]) => [(0, dom_1.define)(link, {
7191
+ class: null,
7146
7192
  target: '_blank'
7147
7193
  }, [el])])({
7148
7194
  source: `{ ${INSECURE_URI}${params.join('')} }${rest}`,
@@ -7219,15 +7265,15 @@ const util_1 = __webpack_require__(9437);
7219
7265
 
7220
7266
  const dom_1 = __webpack_require__(3252);
7221
7267
 
7222
- exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('[[', (0, combinator_1.constraint)(32
7268
+ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('[[', (0, combinator_1.constraint)(64
7223
7269
  /* State.reference */
7224
7270
  , false, (0, combinator_1.syntax)(4096
7225
7271
  /* Syntax.reference */
7226
- , 6, 1, 64
7272
+ , 6, 1, 128
7227
7273
  /* State.annotation */
7228
- | 32
7274
+ | 64
7229
7275
  /* State.reference */
7230
- | 2
7276
+ | 4
7231
7277
  /* State.media */
7232
7278
  , (0, visibility_1.startLoose)((0, combinator_1.context)({
7233
7279
  delimiters: global_1.undefined
@@ -7295,7 +7341,7 @@ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0,
7295
7341
  return [(0, dom_1.html)('ruby', attributes(texts, rubies), (0, dom_1.defrag)((0, array_1.unshift)([texts.join(' ')], [(0, dom_1.html)('rp', '('), (0, dom_1.html)('rt', rubies.join(' ').trim()), (0, dom_1.html)('rp', ')')])))];
7296
7342
  }
7297
7343
  }))));
7298
- const text = (0, combinator_1.creation)(({
7344
+ const text = (0, combinator_1.creation)(1, false, ({
7299
7345
  source,
7300
7346
  context
7301
7347
  }) => {
@@ -7379,7 +7425,7 @@ const url_1 = __webpack_require__(4318);
7379
7425
 
7380
7426
  const media_1 = __webpack_require__(1303);
7381
7427
 
7382
- exports.shortmedia = (0, combinator_1.rewrite)((0, combinator_1.constraint)(2
7428
+ exports.shortmedia = (0, combinator_1.rewrite)((0, combinator_1.constraint)(4
7383
7429
  /* State.media */
7384
7430
  , false, (0, combinator_1.open)('!', url_1.url)), (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media])));
7385
7431
 
@@ -8106,7 +8152,7 @@ const combinator_1 = __webpack_require__(2087);
8106
8152
  const text_1 = __webpack_require__(7763);
8107
8153
 
8108
8154
  const delimiter = /[\s\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]/;
8109
- exports.escsource = (0, combinator_1.creation)(({
8155
+ exports.escsource = (0, combinator_1.creation)(1, false, ({
8110
8156
  source
8111
8157
  }) => {
8112
8158
  if (source === '') return;
@@ -8174,12 +8220,12 @@ const global_1 = __webpack_require__(4128);
8174
8220
  const combinator_1 = __webpack_require__(2087);
8175
8221
 
8176
8222
  function str(pattern) {
8177
- return typeof pattern === 'string' ? (0, combinator_1.creation)(({
8223
+ return typeof pattern === 'string' ? (0, combinator_1.creation)(1, false, ({
8178
8224
  source
8179
8225
  }) => {
8180
8226
  if (source === '') return;
8181
8227
  return source.slice(0, pattern.length) === pattern ? [[pattern], source.slice(pattern.length)] : global_1.undefined;
8182
- }) : (0, combinator_1.creation)(({
8228
+ }) : (0, combinator_1.creation)(1, false, ({
8183
8229
  source
8184
8230
  }) => {
8185
8231
  if (source === '') return;
@@ -8191,12 +8237,12 @@ function str(pattern) {
8191
8237
  exports.str = str;
8192
8238
 
8193
8239
  function stropt(pattern) {
8194
- return typeof pattern === 'string' ? (0, combinator_1.creation)(({
8240
+ return typeof pattern === 'string' ? (0, combinator_1.creation)(1, false, ({
8195
8241
  source
8196
8242
  }) => {
8197
8243
  if (source === '') return;
8198
8244
  return source.slice(0, pattern.length) === pattern ? [[pattern], source.slice(pattern.length)] : global_1.undefined;
8199
- }) : (0, combinator_1.creation)(({
8245
+ }) : (0, combinator_1.creation)(1, false, ({
8200
8246
  source
8201
8247
  }) => {
8202
8248
  if (source === '') return;
@@ -8232,11 +8278,7 @@ exports.delimiter = /[\s\x00-\x7F]|\S[#>]|[()、。!?][^\S\n]*(?=\\\n)/;
8232
8278
  exports.nonWhitespace = /[\S\n]|$/;
8233
8279
  exports.nonAlphanumeric = /[^0-9A-Za-z]|\S[#>]|$/;
8234
8280
  const repeat = (0, str_1.str)(/^(.)\1*/);
8235
- exports.text = (0, combinator_1.syntax)(0
8236
- /* Syntax.none */
8237
- , 1, 1, 0
8238
- /* State.none */
8239
- , ({
8281
+ exports.text = (0, combinator_1.creation)(1, false, ({
8240
8282
  source,
8241
8283
  context
8242
8284
  }) => {
@@ -8340,7 +8382,7 @@ const combinator_1 = __webpack_require__(2087);
8340
8382
 
8341
8383
  const text_1 = __webpack_require__(7763);
8342
8384
 
8343
- exports.unescsource = (0, combinator_1.creation)(({
8385
+ exports.unescsource = (0, combinator_1.creation)(1, false, ({
8344
8386
  source
8345
8387
  }) => {
8346
8388
  if (source === '') return;
@@ -8440,9 +8482,9 @@ function hasVisible(nodes, {
8440
8482
  if (node && node.trimStart()) return true;
8441
8483
  } else {
8442
8484
  if (node.innerText.trimStart()) return true;
8443
- if (state & 2
8485
+ if (state & 4
8444
8486
  /* State.media */
8445
- ^ 2
8487
+ ^ 4
8446
8488
  /* State.media */
8447
8489
  && (node.classList.contains('media') || node.getElementsByClassName('media')[0])) return true;
8448
8490
  }
@@ -8941,6 +8983,7 @@ function pdf(source, url) {
8941
8983
  type: 'application/pdf',
8942
8984
  data: source.getAttribute('data-src')
8943
8985
  }), (0, dom_1.html)('div', [(0, dom_1.define)((0, parser_1.parse)(`{ ${source.getAttribute('data-src')} }`).querySelector('a'), {
8986
+ class: null,
8944
8987
  target: '_blank'
8945
8988
  })])]);
8946
8989
  }
@@ -9006,7 +9049,10 @@ function twitter(source, url) {
9006
9049
  status,
9007
9050
  statusText
9008
9051
  }) {
9009
- (0, dom_1.define)(el, [(0, parser_1.parse)(`*{ ${source.getAttribute('data-src')} }*\n\n\`\`\`\n${status}\n${statusText}\n\`\`\``)]);
9052
+ (0, dom_1.define)(el, [(0, dom_1.define)((0, parser_1.parse)(`{ ${source.getAttribute('data-src')} }`).querySelector('a'), {
9053
+ class: null,
9054
+ target: '_blank'
9055
+ }), (0, dom_1.html)('pre', `${status}\n${statusText}`)]);
9010
9056
  }
9011
9057
 
9012
9058
  });
@@ -9164,8 +9210,8 @@ const array_1 = __webpack_require__(8112);
9164
9210
  function info(source) {
9165
9211
  const match = (0, scope_1.scope)(source, '.invalid');
9166
9212
  return {
9167
- url: find('a:not(:is(.email, .account, .channel, .hashtag, .hashnum, .anchor))').filter(el => ['http:', 'https:'].includes(el.protocol)),
9168
- tel: find('a:not(:is(.email, .account, .channel, .hashtag, .hashnum, .anchor))').filter(el => ['tel:'].includes(el.protocol)),
9213
+ url: find('a.link, a.url'),
9214
+ tel: find('a.tel'),
9169
9215
  email: find('a.email'),
9170
9216
  account: find('a.account'),
9171
9217
  channel: find('a.channel'),