securemark 0.259.2 → 0.260.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/design.md +14 -4
  3. package/dist/index.js +203 -153
  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 +14 -18
  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/codeblock.test.ts +4 -4
  22. package/src/parser/block/dlist.test.ts +1 -1
  23. package/src/parser/block/extension/figure.test.ts +1 -1
  24. package/src/parser/block/heading.test.ts +5 -5
  25. package/src/parser/block/olist.test.ts +1 -1
  26. package/src/parser/block/paragraph.test.ts +14 -14
  27. package/src/parser/block/reply/cite.test.ts +11 -11
  28. package/src/parser/block/reply/quote.test.ts +3 -3
  29. package/src/parser/block/reply.test.ts +8 -8
  30. package/src/parser/block/sidefence.test.ts +6 -6
  31. package/src/parser/block/ulist.test.ts +1 -1
  32. package/src/parser/context.ts +8 -7
  33. package/src/parser/inline/annotation.test.ts +3 -3
  34. package/src/parser/inline/autolink/account.test.ts +11 -11
  35. package/src/parser/inline/autolink/account.ts +4 -2
  36. package/src/parser/inline/autolink/anchor.test.ts +9 -9
  37. package/src/parser/inline/autolink/anchor.ts +14 -11
  38. package/src/parser/inline/autolink/channel.test.ts +3 -3
  39. package/src/parser/inline/autolink/hashnum.ts +4 -2
  40. package/src/parser/inline/autolink/hashtag.test.ts +20 -20
  41. package/src/parser/inline/autolink/hashtag.ts +4 -2
  42. package/src/parser/inline/autolink/url.test.ts +55 -55
  43. package/src/parser/inline/autolink/url.ts +5 -3
  44. package/src/parser/inline/html.test.ts +0 -2
  45. package/src/parser/inline/html.ts +1 -1
  46. package/src/parser/inline/link.test.ts +110 -110
  47. package/src/parser/inline/link.ts +8 -6
  48. package/src/parser/inline/media.test.ts +1 -0
  49. package/src/parser/inline/media.ts +1 -1
  50. package/src/parser/inline/reference.test.ts +3 -3
  51. package/src/parser/inline.test.ts +51 -51
  52. package/src/renderer/render/media/pdf.ts +1 -0
  53. 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.0 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);
@@ -2968,15 +2981,21 @@ exports.syntax = syntax;
2968
2981
 
2969
2982
  function creation(cost, parser) {
2970
2983
  if (typeof cost === 'function') return creation(1, cost);
2971
- return input => {
2972
- const resources = input.context.resources ?? {
2984
+ return ({
2985
+ source,
2986
+ context
2987
+ }) => {
2988
+ const resources = context.resources ?? {
2973
2989
  clock: 1,
2974
2990
  recursion: 1
2975
2991
  };
2976
2992
  if (resources.clock <= 0) throw new Error('Too many creations');
2977
2993
  if (resources.recursion <= 0) throw new Error('Too much recursion');
2978
2994
  --resources.recursion;
2979
- const result = parser(input);
2995
+ const result = parser({
2996
+ source,
2997
+ context
2998
+ });
2980
2999
  ++resources.recursion;
2981
3000
 
2982
3001
  if (result) {
@@ -2990,13 +3009,16 @@ function creation(cost, parser) {
2990
3009
  exports.creation = creation;
2991
3010
 
2992
3011
  function precedence(precedence, parser) {
2993
- return input => {
2994
- const {
2995
- context
2996
- } = input;
3012
+ return ({
3013
+ source,
3014
+ context
3015
+ }) => {
2997
3016
  const p = context.precedence;
2998
3017
  context.precedence = precedence;
2999
- const result = parser(input);
3018
+ const result = parser({
3019
+ source,
3020
+ context
3021
+ });
3000
3022
  context.precedence = p;
3001
3023
  return result;
3002
3024
  };
@@ -3005,7 +3027,13 @@ function precedence(precedence, parser) {
3005
3027
  exports.precedence = precedence;
3006
3028
 
3007
3029
  function guard(f, parser) {
3008
- return input => f(input.context) ? parser(input) : global_1.undefined;
3030
+ return ({
3031
+ source,
3032
+ context
3033
+ }) => f(context) ? parser({
3034
+ source,
3035
+ context
3036
+ }) : global_1.undefined;
3009
3037
  }
3010
3038
 
3011
3039
  exports.guard = guard;
@@ -3016,12 +3044,15 @@ function constraint(state, positive, parser) {
3016
3044
  positive = true;
3017
3045
  }
3018
3046
 
3019
- return input => {
3020
- const {
3021
- context
3022
- } = input;
3047
+ return ({
3048
+ source,
3049
+ context
3050
+ }) => {
3023
3051
  const s = positive ? state & context.state : state & ~context.state;
3024
- return s === state ? parser(input) : global_1.undefined;
3052
+ return s === state ? parser({
3053
+ source,
3054
+ context
3055
+ }) : global_1.undefined;
3025
3056
  };
3026
3057
  }
3027
3058
 
@@ -3033,13 +3064,16 @@ function state(state, positive, parser) {
3033
3064
  positive = true;
3034
3065
  }
3035
3066
 
3036
- return input => {
3037
- const {
3038
- context
3039
- } = input;
3067
+ return ({
3068
+ source,
3069
+ context
3070
+ }) => {
3040
3071
  const s = context.state ?? 0;
3041
3072
  context.state = positive ? s | state : s & ~state;
3042
- const result = parser(input);
3073
+ const result = parser({
3074
+ source,
3075
+ context
3076
+ });
3043
3077
  context.state = s;
3044
3078
  return result;
3045
3079
  };
@@ -3218,11 +3252,10 @@ const array_1 = __webpack_require__(8112);
3218
3252
 
3219
3253
  function inits(parsers, resume) {
3220
3254
  if (parsers.length === 1) return parsers[0];
3221
- return input => {
3222
- const {
3223
- source,
3224
- context
3225
- } = input;
3255
+ return ({
3256
+ source,
3257
+ context
3258
+ }) => {
3226
3259
  let rest = source;
3227
3260
  let nodes;
3228
3261
 
@@ -3266,11 +3299,10 @@ const array_1 = __webpack_require__(8112);
3266
3299
 
3267
3300
  function sequence(parsers, resume) {
3268
3301
  if (parsers.length === 1) return parsers[0];
3269
- return input => {
3270
- const {
3271
- source,
3272
- context
3273
- } = input;
3302
+ return ({
3303
+ source,
3304
+ context
3305
+ }) => {
3274
3306
  let rest = source;
3275
3307
  let nodes;
3276
3308
 
@@ -3322,11 +3354,10 @@ function some(parser, end, delimiters = [], limit = -1) {
3322
3354
  matcher: delimiter_1.Delimiters.matcher(delimiter),
3323
3355
  precedence
3324
3356
  }));
3325
- return input => {
3326
- const {
3327
- source,
3328
- context
3329
- } = input;
3357
+ return ({
3358
+ source,
3359
+ context
3360
+ }) => {
3330
3361
  if (source === '') return;
3331
3362
  let rest = source;
3332
3363
  let nodes;
@@ -3584,7 +3615,7 @@ const array_1 = __webpack_require__(8112);
3584
3615
  function bind(target, settings) {
3585
3616
  let context = { ...settings,
3586
3617
  host: settings.host ?? new url_1.ReadonlyURL(global_1.location.pathname, global_1.location.origin),
3587
- memorable: 118
3618
+ memorable: 236
3588
3619
  /* State.backtrackable */
3589
3620
 
3590
3621
  };
@@ -3956,7 +3987,7 @@ function parse(source, opts = {}, context) {
3956
3987
  ...(context?.resources && {
3957
3988
  resources: context.resources
3958
3989
  }),
3959
- memorable: 118
3990
+ memorable: 236
3960
3991
  /* State.backtrackable */
3961
3992
 
3962
3993
  };
@@ -4259,17 +4290,17 @@ const dom_1 = __webpack_require__(3252);
4259
4290
 
4260
4291
  const array_1 = __webpack_require__(8112);
4261
4292
 
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
4293
+ 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
4294
  /* State.annotation */
4264
- | 32
4295
+ | 64
4265
4296
  /* State.reference */
4266
- | 16
4297
+ | 32
4267
4298
  /* State.index */
4268
- | 8
4299
+ | 16
4269
4300
  /* State.label */
4270
- | 4
4301
+ | 8
4271
4302
  /* State.link */
4272
- | 2
4303
+ | 4
4273
4304
  /* State.media */
4274
4305
  , (0, combinator_1.some)(term)), (0, combinator_1.some)(desc)]))), es => [(0, dom_1.html)('dl', fillTrailingDescription(es))]))));
4275
4306
  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))]))));
@@ -4561,7 +4592,7 @@ const memoize_1 = __webpack_require__(1808);
4561
4592
 
4562
4593
  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
4594
  (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
4595
+ 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
4596
  /* State.media */
4566
4597
  , (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
4598
  class: 'figindex'
@@ -5098,19 +5129,19 @@ const dom_1 = __webpack_require__(3252);
5098
5129
  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
5130
  source
5100
5131
  }) => [[source], ''])))));
5101
- exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.state)(64
5132
+ exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.state)(128
5102
5133
  /* State.annotation */
5103
- | 32
5134
+ | 64
5104
5135
  /* State.reference */
5105
- | 16
5136
+ | 32
5106
5137
  /* State.index */
5107
- | 8
5138
+ | 16
5108
5139
  /* State.label */
5109
- | 4
5140
+ | 8
5110
5141
  /* State.link */
5111
- | 2
5142
+ | 4
5112
5143
  /* 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
5144
+ , (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
5145
  /* State.autolink */
5115
5146
  , (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
5147
  class: 'invalid',
@@ -5161,7 +5192,7 @@ const inline_1 = __webpack_require__(1160);
5161
5192
 
5162
5193
  const dom_1 = __webpack_require__(3252);
5163
5194
 
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
5195
+ 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
5196
  /* State.media */
5166
5197
  , exports.ilist_))));
5167
5198
  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', {
@@ -5248,7 +5279,7 @@ const openers = {
5248
5279
  '.': /^([0-9]+|[a-z]+|[A-Z]+)(?:-(?!-)[0-9]*)*(?![^\S\n])\.?(?:$|\s)/,
5249
5280
  '(': /^\(([0-9]*|[a-z]*)(?![^)\n])\)?(?:-(?!-)[0-9]*)*(?:$|\s)/
5250
5281
  };
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
5282
+ 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
5283
  /* State.media */
5253
5284
  , exports.olist_))));
5254
5285
  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, []))])));
@@ -5664,7 +5695,7 @@ const dom_1 = __webpack_require__(3252);
5664
5695
 
5665
5696
  const array_1 = __webpack_require__(8112);
5666
5697
 
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
5698
+ 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
5699
  /* State.media */
5669
5700
  , exports.ulist_))));
5670
5701
  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))])));
@@ -5865,13 +5896,13 @@ const visibility_1 = __webpack_require__(7618);
5865
5896
 
5866
5897
  const dom_1 = __webpack_require__(3252);
5867
5898
 
5868
- exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('((', (0, combinator_1.constraint)(64
5899
+ exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('((', (0, combinator_1.constraint)(128
5869
5900
  /* State.annotation */
5870
5901
  , false, (0, combinator_1.syntax)(32
5871
5902
  /* Syntax.annotation */
5872
- , 6, 1, 64
5903
+ , 6, 1, 128
5873
5904
  /* State.annotation */
5874
- | 2
5905
+ | 4
5875
5906
  /* State.media */
5876
5907
  , (0, visibility_1.startLoose)((0, combinator_1.context)({
5877
5908
  delimiters: global_1.undefined
@@ -5912,7 +5943,7 @@ const source_1 = __webpack_require__(6743);
5912
5943
 
5913
5944
  const util_1 = __webpack_require__(9437);
5914
5945
 
5915
- exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]|\S[#>])/, (0, combinator_1.constraint)(1
5946
+ exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]|\S[#>])/, (0, combinator_1.constraint)(2
5916
5947
  /* State.autolink */
5917
5948
  , false, (0, combinator_1.syntax)(2
5918
5949
  /* Syntax.autolink */
@@ -5946,7 +5977,9 @@ const source_1 = __webpack_require__(6743);
5946
5977
  const dom_1 = __webpack_require__(3252); // https://example/@user must be a user page or a redirect page going there.
5947
5978
 
5948
5979
 
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, {
5980
+ exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1
5981
+ /* State.shortcut */
5982
+ , 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
5983
  class: 'account'
5951
5984
  })]));
5952
5985
 
@@ -5975,7 +6008,9 @@ const dom_1 = __webpack_require__(3252); // Timeline(pseudonym): user/tid
5975
6008
  // 外部表現は投稿ごとに投稿者の投稿時のタイムゾーンに統一する(非時系列順)
5976
6009
 
5977
6010
 
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, {
6011
+ exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('>>', (0, combinator_1.fmap)((0, combinator_1.constraint)(1
6012
+ /* State.shortcut */
6013
+ , 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
6014
  class: 'anchor'
5980
6015
  })])));
5981
6016
 
@@ -6064,7 +6099,9 @@ const source_1 = __webpack_require__(6743);
6064
6099
 
6065
6100
  const dom_1 = __webpack_require__(3252);
6066
6101
 
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, {
6102
+ exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1
6103
+ /* State.shortcut */
6104
+ , 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
6105
  class: 'hashnum',
6069
6106
  href: null
6070
6107
  })]));
@@ -6093,7 +6130,9 @@ const dom_1 = __webpack_require__(3252); // https://example/hashtags/a must be a
6093
6130
 
6094
6131
 
6095
6132
  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, {
6133
+ exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1
6134
+ /* State.shortcut */
6135
+ , 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
6136
  class: 'hashtag'
6098
6137
  }, el.innerText)]));
6099
6138
 
@@ -6116,8 +6155,12 @@ const link_1 = __webpack_require__(9628);
6116
6155
 
6117
6156
  const source_1 = __webpack_require__(6743);
6118
6157
 
6158
+ const dom_1 = __webpack_require__(3252);
6159
+
6119
6160
  const closer = /^[-+*=~^,.;:!?]*(?=[\\"`|\[\](){}<>]|$)/;
6120
- exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['http://', 'https://'], (0, combinator_1.rewrite)((0, combinator_1.open)(/^https?:\/\/(?=[\x21-\x7E])/, (0, combinator_1.focus)(/^[\x21-\x7E]+/, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.unescsource, closer)])))), (0, combinator_1.convert)(url => `{ ${url} }`, (0, combinator_1.union)([link_1.unsafelink])))));
6161
+ exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['http://', 'https://'], (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)(/^https?:\/\/(?=[\x21-\x7E])/, (0, combinator_1.focus)(/^[\x21-\x7E]+/, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.unescsource, closer)])))), (0, combinator_1.convert)(url => `{ ${url} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
6162
+ class: 'url'
6163
+ })])));
6121
6164
  const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.precedence)(2, (0, combinator_1.union)([(0, combinator_1.surround)('(', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')'), ')', true), (0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']'), ']', true), (0, combinator_1.surround)('{', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}'), '}', true), (0, combinator_1.surround)('"', (0, combinator_1.precedence)(8, (0, combinator_1.some)(source_1.unescsource, '"')), '"', true)]))));
6122
6165
 
6123
6166
  /***/ }),
@@ -6460,11 +6503,11 @@ const visibility_1 = __webpack_require__(7618);
6460
6503
 
6461
6504
  const dom_1 = __webpack_require__(3252);
6462
6505
 
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
6506
+ 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
6507
  /* State.index */
6465
6508
  , false, (0, combinator_1.syntax)(1024
6466
6509
  /* Syntax.index */
6467
- , 2, 1, 127
6510
+ , 2, 1, 254
6468
6511
  /* State.linkable */
6469
6512
  , (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
6513
  id: el.id ? null : global_1.undefined,
@@ -6576,7 +6619,7 @@ const index_1 = __webpack_require__(4479);
6576
6619
 
6577
6620
  const dom_1 = __webpack_require__(3252);
6578
6621
 
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
6622
+ 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
6623
  /* State.index */
6581
6624
  , false, (0, combinator_1.union)([(0, combinator_1.focus)('[#]', () => [[(0, dom_1.html)('a', {
6582
6625
  href: '#'
@@ -6609,7 +6652,7 @@ const dom_1 = __webpack_require__(3252);
6609
6652
 
6610
6653
  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
6654
  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
6655
+ exports.label = (0, combinator_1.validate)(['[$', '$'], (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.constraint)(16
6613
6656
  /* State.label */
6614
6657
  , false, (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])), ([text]) => [(0, dom_1.html)('a', {
6615
6658
  class: 'label',
@@ -6723,7 +6766,7 @@ exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('<', (0,
6723
6766
  /* State.none */
6724
6767
  , (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
6768
  (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
6769
+ 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
6770
  // [...document.querySelectorAll('tbody > tr > td:first-child')].map(el => el.textContent.slice(1, -1))
6728
6771
 
6729
6772
  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 +6927,45 @@ const optspec = {
6884
6927
  };
6885
6928
  Object.setPrototypeOf(optspec, null);
6886
6929
  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
6930
+ const textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8
6888
6931
  /* State.link */
6889
6932
  , false, (0, combinator_1.syntax)(256
6890
6933
  /* Syntax.link */
6891
- , 2, 10, 127
6934
+ , 2, 10, 254
6892
6935
  /* State.linkable */
6893
6936
  , (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
6937
  if (content.length !== 0 && (0, visibility_1.trimNode)(content).length === 0) return;
6895
6938
 
6896
6939
  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)({
6940
+ const result = autolink({
6900
6941
  source,
6901
6942
  context
6902
6943
  });
6903
- if (typeof (0, parser_1.eval)(result)[0] === 'object') return;
6904
- source = (0, parser_1.exec)(result);
6944
+ if (typeof (0, parser_1.eval)(result, [])[0] === 'object') return;
6945
+ source = (0, parser_1.exec)(result, '');
6905
6946
  }
6906
6947
 
6907
6948
  return parse(content, params, rest, context);
6908
6949
  }))));
6909
- const medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4
6950
+ const medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8
6910
6951
  /* State.link */
6911
- | 2
6952
+ | 4
6912
6953
  /* State.media */
6913
6954
  , false, (0, combinator_1.syntax)(256
6914
6955
  /* Syntax.link */
6915
- , 2, 10, 127
6956
+ , 2, 10, 254
6916
6957
  /* State.linkable */
6917
- ^ 2
6958
+ ^ 4
6918
6959
  /* State.media */
6919
6960
  , (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
6961
  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
6962
  exports.uri = (0, combinator_1.union)([(0, combinator_1.open)(/^[^\S\n]+/, (0, source_1.str)(/^\S+/)), (0, source_1.str)(/^[^\s{}]+/)]);
6922
6963
  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)}`])]);
6964
+ const autolink = (0, combinator_1.state)(2
6965
+ /* State.autolink */
6966
+ , false, (0, combinator_1.state)(1
6967
+ /* State.shortcut */
6968
+ , autolink_1.autolink));
6923
6969
 
6924
6970
  function parse(content, params, rest, context) {
6925
6971
  const INSECURE_URI = params.shift();
@@ -6961,6 +7007,7 @@ function elem(INSECURE_URI, content, uri, origin) {
6961
7007
  }
6962
7008
 
6963
7009
  return (0, dom_1.html)('a', {
7010
+ class: 'link',
6964
7011
  href: uri.source,
6965
7012
  target: global_1.undefined || uri.origin !== origin || typeof content[0] === 'object' && content[0].classList.contains('media') ? '_blank' : global_1.undefined
6966
7013
  }, content.length === 0 ? decode(INSECURE_URI) : content);
@@ -6975,6 +7022,7 @@ function elem(INSECURE_URI, content, uri, origin) {
6975
7022
  switch (true) {
6976
7023
  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
7024
  return (0, dom_1.html)('a', {
7025
+ class: 'tel',
6978
7026
  href: uri.source
6979
7027
  }, content);
6980
7028
  }
@@ -7111,7 +7159,7 @@ const optspec = {
7111
7159
  rel: global_1.undefined
7112
7160
  };
7113
7161
  Object.setPrototypeOf(optspec, null);
7114
- exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.open)('!', (0, combinator_1.constraint)(2
7162
+ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.open)('!', (0, combinator_1.constraint)(4
7115
7163
  /* State.media */
7116
7164
  , false, (0, combinator_1.syntax)(64
7117
7165
  /* Syntax.media */
@@ -7135,7 +7183,7 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '
7135
7183
  el.style.aspectRatio = el.getAttribute('aspect-ratio');
7136
7184
  }
7137
7185
 
7138
- if (context.state & 4
7186
+ if (context.state & 8
7139
7187
  /* State.link */
7140
7188
  ) return [[el], rest];
7141
7189
  if (cache && cache.tagName !== 'IMG') return (0, combinator_1.creation)(10, (..._) => [[el], rest])({
@@ -7143,6 +7191,7 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '
7143
7191
  context
7144
7192
  });
7145
7193
  return (0, combinator_1.fmap)(link_1.unsafelink, ([link]) => [(0, dom_1.define)(link, {
7194
+ class: null,
7146
7195
  target: '_blank'
7147
7196
  }, [el])])({
7148
7197
  source: `{ ${INSECURE_URI}${params.join('')} }${rest}`,
@@ -7219,15 +7268,15 @@ const util_1 = __webpack_require__(9437);
7219
7268
 
7220
7269
  const dom_1 = __webpack_require__(3252);
7221
7270
 
7222
- exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('[[', (0, combinator_1.constraint)(32
7271
+ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('[[', (0, combinator_1.constraint)(64
7223
7272
  /* State.reference */
7224
7273
  , false, (0, combinator_1.syntax)(4096
7225
7274
  /* Syntax.reference */
7226
- , 6, 1, 64
7275
+ , 6, 1, 128
7227
7276
  /* State.annotation */
7228
- | 32
7277
+ | 64
7229
7278
  /* State.reference */
7230
- | 2
7279
+ | 4
7231
7280
  /* State.media */
7232
7281
  , (0, visibility_1.startLoose)((0, combinator_1.context)({
7233
7282
  delimiters: global_1.undefined
@@ -7379,7 +7428,7 @@ const url_1 = __webpack_require__(4318);
7379
7428
 
7380
7429
  const media_1 = __webpack_require__(1303);
7381
7430
 
7382
- exports.shortmedia = (0, combinator_1.rewrite)((0, combinator_1.constraint)(2
7431
+ exports.shortmedia = (0, combinator_1.rewrite)((0, combinator_1.constraint)(4
7383
7432
  /* State.media */
7384
7433
  , false, (0, combinator_1.open)('!', url_1.url)), (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media])));
7385
7434
 
@@ -8440,9 +8489,9 @@ function hasVisible(nodes, {
8440
8489
  if (node && node.trimStart()) return true;
8441
8490
  } else {
8442
8491
  if (node.innerText.trimStart()) return true;
8443
- if (state & 2
8492
+ if (state & 4
8444
8493
  /* State.media */
8445
- ^ 2
8494
+ ^ 4
8446
8495
  /* State.media */
8447
8496
  && (node.classList.contains('media') || node.getElementsByClassName('media')[0])) return true;
8448
8497
  }
@@ -8941,6 +8990,7 @@ function pdf(source, url) {
8941
8990
  type: 'application/pdf',
8942
8991
  data: source.getAttribute('data-src')
8943
8992
  }), (0, dom_1.html)('div', [(0, dom_1.define)((0, parser_1.parse)(`{ ${source.getAttribute('data-src')} }`).querySelector('a'), {
8993
+ class: null,
8944
8994
  target: '_blank'
8945
8995
  })])]);
8946
8996
  }
@@ -9164,8 +9214,8 @@ const array_1 = __webpack_require__(8112);
9164
9214
  function info(source) {
9165
9215
  const match = (0, scope_1.scope)(source, '.invalid');
9166
9216
  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)),
9217
+ url: find('a.link, a.url'),
9218
+ tel: find('a.tel'),
9169
9219
  email: find('a.email'),
9170
9220
  account: find('a.account'),
9171
9221
  channel: find('a.channel'),