securemark 0.279.1 → 0.280.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +10 -10
  3. package/dist/index.js +120 -138
  4. package/markdown.d.ts +1 -7
  5. package/package.json +1 -1
  6. package/src/combinator/data/parser/context/delimiter.ts +49 -21
  7. package/src/combinator/data/parser/context/memo.ts +6 -6
  8. package/src/combinator/data/parser/context.ts +23 -7
  9. package/src/combinator/data/parser/some.ts +1 -1
  10. package/src/parser/api/bind.ts +4 -1
  11. package/src/parser/api/parse.test.ts +13 -13
  12. package/src/parser/api/parse.ts +4 -1
  13. package/src/parser/block/extension/table.ts +1 -1
  14. package/src/parser/block/heading.ts +1 -1
  15. package/src/parser/block/reply/quote.ts +9 -46
  16. package/src/parser/block.ts +2 -2
  17. package/src/parser/inline/annotation.ts +4 -4
  18. package/src/parser/inline/autolink/account.ts +1 -1
  19. package/src/parser/inline/autolink/url.ts +1 -1
  20. package/src/parser/inline/autolink.ts +2 -2
  21. package/src/parser/inline/bracket.test.ts +3 -2
  22. package/src/parser/inline/bracket.ts +8 -9
  23. package/src/parser/inline/deletion.ts +4 -4
  24. package/src/parser/inline/emphasis.ts +4 -4
  25. package/src/parser/inline/emstrong.ts +4 -4
  26. package/src/parser/inline/extension/index.test.ts +6 -0
  27. package/src/parser/inline/extension/index.ts +11 -11
  28. package/src/parser/inline/extension/placeholder.ts +4 -4
  29. package/src/parser/inline/html.test.ts +1 -1
  30. package/src/parser/inline/html.ts +5 -5
  31. package/src/parser/inline/insertion.ts +4 -4
  32. package/src/parser/inline/link.ts +6 -6
  33. package/src/parser/inline/mark.ts +4 -4
  34. package/src/parser/inline/media.ts +4 -4
  35. package/src/parser/inline/reference.ts +3 -3
  36. package/src/parser/inline/remark.test.ts +1 -0
  37. package/src/parser/inline/remark.ts +4 -4
  38. package/src/parser/inline/ruby.ts +2 -2
  39. package/src/parser/inline/strong.ts +4 -4
  40. package/src/parser/inline/template.ts +7 -4
  41. package/src/parser/inline.test.ts +2 -5
  42. package/src/parser/source/str.ts +0 -19
  43. package/src/parser/source/text.test.ts +1 -1
  44. package/src/parser/source/text.ts +3 -3
  45. package/src/parser/source.ts +1 -1
  46. package/src/parser/visibility.ts +3 -1
  47. package/src/util/toc.ts +4 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! securemark v0.279.1 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
1
+ /*! securemark v0.280.1 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory(require("Prism"), require("DOMPurify"));
@@ -3387,8 +3387,8 @@ function apply(parser, source, context, changes, values, reset = false) {
3387
3387
  }
3388
3388
  return result;
3389
3389
  }
3390
- function syntax(syntax, prec, cost, state, parser) {
3391
- return creation(cost, precedence(prec, ({
3390
+ function syntax(syntax, prec, state, parser) {
3391
+ return precedence(prec, ({
3392
3392
  source,
3393
3393
  context
3394
3394
  }) => {
@@ -3411,7 +3411,7 @@ function syntax(syntax, prec, cost, state, parser) {
3411
3411
  }
3412
3412
  context.state = stateOuter;
3413
3413
  return result;
3414
- }));
3414
+ });
3415
3415
  }
3416
3416
  exports.syntax = syntax;
3417
3417
  function creation(cost, recursion, parser) {
@@ -3422,11 +3422,11 @@ function creation(cost, recursion, parser) {
3422
3422
  context
3423
3423
  }) => {
3424
3424
  const resources = context.resources ?? {
3425
- clock: 1,
3425
+ clock: cost || 1,
3426
3426
  recursion: 1
3427
3427
  };
3428
3428
  if (resources.clock <= 0) throw new Error('Too many creations');
3429
- if (resources.recursion <= 0) throw new Error('Too much recursion');
3429
+ if (resources.recursion < +recursion) throw new Error('Too much recursion');
3430
3430
  recursion && --resources.recursion;
3431
3431
  const result = parser({
3432
3432
  source,
@@ -3503,6 +3503,19 @@ function state(state, positive, parser) {
3503
3503
  };
3504
3504
  }
3505
3505
  exports.state = state;
3506
+ //export function log<P extends Parser<unknown>>(log: number, parser: P, cond?: (ns: readonly Tree<P>[]) => boolean): P;
3507
+ //export function log<T>(log: number, parser: Parser<T>, cond: (ns: readonly T[]) => boolean = () => true): Parser<T> {
3508
+ // assert(log);
3509
+ // return ({ source, context }) => {
3510
+ // const l = context.log ?? 0;
3511
+ // context.log = 0;
3512
+ // const result = parser!({ source, context });
3513
+ // context.log = result && cond(eval(result))
3514
+ // ? l | log
3515
+ // : l;
3516
+ // return result;
3517
+ // };
3518
+ //}
3506
3519
 
3507
3520
  /***/ }),
3508
3521
 
@@ -3520,9 +3533,9 @@ exports.Delimiters = void 0;
3520
3533
  const memoize_1 = __webpack_require__(1808);
3521
3534
  class Delimiters {
3522
3535
  constructor() {
3523
- this.matchers = [];
3524
- this.registry = {};
3525
- this.length = 0;
3536
+ this.registry = (0, memoize_1.memoize)(() => []);
3537
+ this.delimiters = [];
3538
+ this.order = [];
3526
3539
  }
3527
3540
  static signature(pattern) {
3528
3541
  switch (typeof pattern) {
@@ -3534,36 +3547,62 @@ class Delimiters {
3534
3547
  return `r/${pattern.source}/${pattern.flags}`;
3535
3548
  }
3536
3549
  }
3537
- push(...delimiters) {
3538
- for (let i = 0; i < delimiters.length; ++i) {
3539
- const delimiter = delimiters[i];
3550
+ push(delims) {
3551
+ const {
3552
+ registry,
3553
+ delimiters,
3554
+ order
3555
+ } = this;
3556
+ for (let i = 0; i < delims.length; ++i) {
3540
3557
  const {
3541
3558
  signature,
3542
3559
  matcher,
3543
3560
  precedence = 1
3544
- } = delimiter;
3545
- if (!this.registry[signature]) {
3546
- this.matchers.unshift([this.length, signature, precedence, matcher]);
3547
- this.registry[signature] = true;
3561
+ } = delims[i];
3562
+ const stack = registry(signature);
3563
+ const index = stack[0]?.index ?? delimiters.length;
3564
+ if (stack.length === 0 || precedence > delimiters[index].precedence) {
3565
+ const delimiter = {
3566
+ index,
3567
+ signature,
3568
+ matcher,
3569
+ precedence
3570
+ };
3571
+ delimiters[index] = delimiter;
3572
+ stack.push(delimiter);
3573
+ order.push(index);
3574
+ } else {
3575
+ order.push(-1);
3548
3576
  }
3549
- ++this.length;
3550
3577
  }
3551
3578
  }
3552
3579
  pop(count = 1) {
3580
+ const {
3581
+ registry,
3582
+ delimiters,
3583
+ order
3584
+ } = this;
3553
3585
  for (let i = 0; i < count; ++i) {
3554
- if (--this.length === this.matchers[0][0]) {
3555
- this.registry[this.matchers.shift()[1]] = false;
3586
+ const index = order.pop();
3587
+ if (index === -1) continue;
3588
+ const stack = registry(delimiters[index].signature);
3589
+ if (stack.length === 1) {
3590
+ stack.pop();
3591
+ delimiters.pop();
3592
+ } else {
3593
+ stack.pop();
3594
+ delimiters[index] = stack.at(-1);
3556
3595
  }
3557
3596
  }
3558
3597
  }
3559
3598
  match(source, precedence = 1) {
3560
3599
  const {
3561
- matchers
3600
+ delimiters
3562
3601
  } = this;
3563
- for (let i = 0; i < matchers.length; ++i) {
3564
- const matcher = matchers[i];
3565
- if (precedence >= matcher[2]) continue;
3566
- switch (matcher[3](source)) {
3602
+ for (let i = 0; i < delimiters.length; ++i) {
3603
+ const delimiter = delimiters[i];
3604
+ if (precedence >= delimiter.precedence) continue;
3605
+ switch (delimiter.matcher(source)) {
3567
3606
  case true:
3568
3607
  return true;
3569
3608
  case false:
@@ -3611,14 +3650,14 @@ class Memo {
3611
3650
  return this.memory.length;
3612
3651
  }
3613
3652
  get(position, syntax, state) {
3614
- //console.log('get', position, syntax, state, this.memory[position - 1]?.[`${syntax}:${state}`]);;
3615
- const cache = this.memory[position - 1]?.[`${syntax}:${state}`];
3653
+ //console.log('get', position, syntax, state, this.memory[position - 1]?.[syntax]?.[state]);
3654
+ const cache = this.memory[position - 1]?.[syntax]?.[state];
3616
3655
  return cache?.length === 2 ? [cache[0].slice(), cache[1]] : cache;
3617
3656
  }
3618
3657
  set(position, syntax, state, nodes, offset) {
3619
3658
  const record = this.memory[position - 1] ??= {};
3620
- record[`${syntax}:${state}`] = nodes ? [nodes.slice(), offset] : [];
3621
- //console.log('set', position, syntax, state, record[`${syntax}:${state}`]);
3659
+ (record[syntax] ??= {})[state] = nodes ? [nodes.slice(), offset] : [];
3660
+ //console.log('set', position, syntax, state, record[syntax]?.[state]);
3622
3661
  }
3623
3662
 
3624
3663
  clear(position) {
@@ -3742,7 +3781,7 @@ function some(parser, end, delimiters = [], limit = -1) {
3742
3781
  let nodes;
3743
3782
  if (delims.length > 0) {
3744
3783
  context.delimiters ??= new delimiter_1.Delimiters();
3745
- context.delimiters.push(...delims);
3784
+ context.delimiters.push(delims);
3746
3785
  }
3747
3786
  while (true) {
3748
3787
  if (rest === '') break;
@@ -4355,10 +4394,10 @@ const reply_1 = __webpack_require__(9978);
4355
4394
  const paragraph_1 = __webpack_require__(6457);
4356
4395
  const random_1 = __webpack_require__(7325);
4357
4396
  const dom_1 = __webpack_require__(3252);
4358
- exports.block = (0, combinator_1.creation)(1, false, error((0, combinator_1.reset)({
4397
+ exports.block = (0, combinator_1.creation)(0, false, error((0, combinator_1.reset)({
4359
4398
  resources: {
4360
- clock: 50 * 1000,
4361
- recursion: 20
4399
+ clock: 20000,
4400
+ recursion: 20 + 1
4362
4401
  }
4363
4402
  }, (0, combinator_1.union)([source_1.emptyline, pagebreak_1.pagebreak, heading_1.heading, ulist_1.ulist, olist_1.olist, ilist_1.ilist, dlist_1.dlist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, extension_1.extension, sidefence_1.sidefence, blockquote_1.blockquote, mediablock_1.mediablock, reply_1.reply, paragraph_1.paragraph]))));
4364
4403
  function error(parser) {
@@ -5215,7 +5254,7 @@ const dom_1 = __webpack_require__(3252);
5215
5254
  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)(({
5216
5255
  source
5217
5256
  }) => [[source], ''])))));
5218
- exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.state)(256 /* State.annotation */ | 128 /* State.reference */ | 64 /* State.index */ | 32 /* State.label */ | 16 /* State.link */ | 8 /* State.media */, (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.trimBlankStart)((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 /* State.autolink */, (0, visibility_1.visualize)((0, visibility_1.trimBlankStart)((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, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns))) : (0, dom_1.html)(`h6`, {
5257
+ exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.state)(256 /* State.annotation */ | 128 /* State.reference */ | 64 /* State.index */ | 32 /* State.label */ | 16 /* State.link */ | 8 /* State.media */, (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.trimBlankStart)((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)(502 /* State.linkers */, (0, visibility_1.visualize)((0, visibility_1.trimBlankStart)((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, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns))) : (0, dom_1.html)(`h6`, {
5219
5258
  class: 'invalid',
5220
5259
  'data-invalid-syntax': 'heading',
5221
5260
  'data-invalid-type': 'syntax',
@@ -5547,7 +5586,6 @@ Object.defineProperty(exports, "__esModule", ({
5547
5586
  value: true
5548
5587
  }));
5549
5588
  exports.quote = exports.syntax = void 0;
5550
- const parser_1 = __webpack_require__(6728);
5551
5589
  const combinator_1 = __webpack_require__(2087);
5552
5590
  const math_1 = __webpack_require__(8946);
5553
5591
  const autolink_1 = __webpack_require__(6051);
@@ -5562,42 +5600,7 @@ exports.quote = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, false
5562
5600
  'data-invalid-type': 'syntax',
5563
5601
  'data-invalid-message': `Missing the whitespace after "${ns[0].split(/[^>]/, 1)[0]}"`
5564
5602
  }, (0, dom_1.defrag)(ns)), (0, dom_1.html)('br')]), false)));
5565
- const qblock = ({
5566
- source,
5567
- context
5568
- }) => {
5569
- source = source.replace(/\n$/, '');
5570
- const lines = source.match(/^.*\n?/mg);
5571
- const quotes = source.match(/^>+[^\S\n]/mg);
5572
- const content = lines.reduce((acc, line, i) => acc + line.slice(quotes[i].length), '');
5573
- const nodes = (0, parser_1.eval)(text({
5574
- source: `\r${content}`,
5575
- context
5576
- }), []);
5577
- nodes.unshift(quotes.shift());
5578
- for (let i = 0; i < nodes.length; ++i) {
5579
- const child = nodes[i];
5580
- if (typeof child === 'string') continue;
5581
- if ('wholeText' in child) {
5582
- nodes[i] = child.data;
5583
- continue;
5584
- }
5585
- if (child.tagName === 'BR') {
5586
- nodes.splice(i + 1, 0, quotes.shift());
5587
- ++i;
5588
- continue;
5589
- }
5590
- if (child.className === 'cite' || child.classList.contains('quote')) {
5591
- context.resources && (context.resources.clock -= child.childNodes.length);
5592
- nodes.splice(i, 1, ...child.childNodes);
5593
- --i;
5594
- continue;
5595
- }
5596
- }
5597
- nodes.unshift('');
5598
- return [nodes, ''];
5599
- };
5600
- const text = (0, combinator_1.some)((0, combinator_1.union)([math_1.math, autolink_1.autolink, source_1.linebreak, source_1.unescsource]));
5603
+ const qblock = (0, combinator_1.convert)(source => source.replace(/\n$/, '').replace(/(?<=^>+[^\S\n])/mg, '\r'), (0, combinator_1.some)((0, combinator_1.union)([math_1.math, autolink_1.autolink, source_1.linebreak, source_1.unescsource])));
5601
5604
 
5602
5605
  /***/ }),
5603
5606
 
@@ -5858,9 +5861,9 @@ const combinator_1 = __webpack_require__(2087);
5858
5861
  const inline_1 = __webpack_require__(1160);
5859
5862
  const visibility_1 = __webpack_require__(7618);
5860
5863
  const dom_1 = __webpack_require__(3252);
5861
- exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('((', (0, combinator_1.constraint)(256 /* State.annotation */, false, (0, combinator_1.syntax)(0 /* Syntax.none */, 6, 1, 256 /* State.annotation */ | 8 /* State.media */, (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[/^\\?\n/, 9], [')', 2], ['))', 6]])))), '))', false, ([, ns], rest) => [[(0, dom_1.html)('sup', {
5864
+ exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.surround)('((', (0, combinator_1.constraint)(256 /* State.annotation */, false, (0, combinator_1.syntax)(0 /* Syntax.none */, 6, 256 /* State.annotation */ | 8 /* State.media */, (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[/^\\?\n/, 9], [')', 2], ['))', 6]])))), '))', false, ([, ns], rest) => [[(0, dom_1.html)('sup', {
5862
5865
  class: 'annotation'
5863
- }, [(0, dom_1.html)('span', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))])], rest]));
5866
+ }, [(0, dom_1.html)('span', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))])], rest])));
5864
5867
 
5865
5868
  /***/ }),
5866
5869
 
@@ -5884,7 +5887,7 @@ const hashnum_1 = __webpack_require__(5631);
5884
5887
  const anchor_1 = __webpack_require__(6495);
5885
5888
  const source_1 = __webpack_require__(6743);
5886
5889
  const util_1 = __webpack_require__(9437);
5887
- exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/^(?:[@#>0-9a-z\r\n]|\S[#>])/iu, (0, combinator_1.constraint)(2 /* State.autolink */, false, (0, combinator_1.syntax)(2 /* Syntax.autolink */, 1, 1, ~1 /* State.shortcut */, (0, combinator_1.union)([(0, combinator_1.some)((0, combinator_1.union)([url_1.lineurl])), (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([url_1.url, email_1.email,
5890
+ exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/^(?:[@#>0-9a-z]|\S[#>]|[\r\n]!?https?:\/\/)/iu, (0, combinator_1.constraint)(2 /* State.autolink */, false, (0, combinator_1.syntax)(2 /* Syntax.autolink */, 1, ~1 /* State.shortcut */, (0, combinator_1.union)([(0, combinator_1.some)((0, combinator_1.union)([url_1.lineurl])), (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([url_1.url, email_1.email,
5888
5891
  // Escape unmatched email-like strings.
5889
5892
  (0, source_1.str)(/^[0-9a-z]+(?:[_.+-][0-9a-z]+)*(?:@(?:[0-9a-z]+(?:[.-][0-9a-z]+)*)?)*/i), channel_1.channel, account_1.account,
5890
5893
  // Escape unmatched account-like strings.
@@ -6057,7 +6060,7 @@ const source_1 = __webpack_require__(6743);
6057
6060
  const closer = /^[-+*=~^_,.;:!?]*(?=[\\"`|\[\](){}<>]|$)/;
6058
6061
  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])))));
6059
6062
  exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.open)(source_1.linebreak, (0, combinator_1.tails)([(0, source_1.str)('!'), (0, combinator_1.focus)(/^https?:\/\/\S+(?=[^\S\n]*(?:$|\n))/, (0, combinator_1.convert)(url => `{ ${url} }`, link_1.unsafelink))])));
6060
- 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)]))));
6063
+ 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)(3, (0, combinator_1.some)(source_1.unescsource, '"')), '"', true)]))));
6061
6064
 
6062
6065
  /***/ }),
6063
6066
 
@@ -6077,13 +6080,11 @@ const source_1 = __webpack_require__(6743);
6077
6080
  const array_1 = __webpack_require__(8112);
6078
6081
  const dom_1 = __webpack_require__(3252);
6079
6082
  const index = /^[0-9A-Za-z]+(?:(?:[.-]|, )[0-9A-Za-z]+)*/;
6080
- exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.syntax)(0 /* Syntax.none */, 2, 1, 0 /* State.none */, (0, source_1.str)(index)), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.syntax)(8 /* Syntax.bracket */, 2, 1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, ')', [[')', 2]])), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
6083
+ exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.creation)((0, combinator_1.syntax)(0 /* Syntax.none */, 2, 0 /* State.none */, (0, source_1.str)(index))), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.creation)((0, combinator_1.syntax)(8 /* Syntax.bracket */, 2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, ')', [[/^\\?\n/, 3], [')', 2]]))), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
6081
6084
  class: 'paren'
6082
- }, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.syntax)(0 /* Syntax.none */, 2, 1, 0 /* State.none */, (0, source_1.str)(new RegExp(index.source.replace(', ', '[,、]').replace(/[09AZaz.]|\-(?!\w)/g, c => c.trimStart() && String.fromCharCode(c.charCodeAt(0) + 0xFEE0))))), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.syntax)(8 /* Syntax.bracket */, 2, 1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, ')', [[')', 2]])), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
6085
+ }, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.creation)((0, combinator_1.syntax)(0 /* Syntax.none */, 2, 0 /* State.none */, (0, source_1.str)(new RegExp(index.source.replace(', ', '[,、]').replace(/[09AZaz.]|\-(?!\w)/g, c => c.trimStart() && String.fromCharCode(c.charCodeAt(0) + 0xFEE0)))))), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.creation)((0, combinator_1.syntax)(8 /* Syntax.bracket */, 2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, ')', [[/^\\?\n/, 3], [')', 2]]))), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
6083
6086
  class: 'paren'
6084
- }, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.syntax)(8 /* Syntax.bracket */, 2, 1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 2]])), (0, source_1.str)(']'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.syntax)(8 /* Syntax.bracket */, 2, 1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 2]])), (0, source_1.str)('}'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]),
6085
- // Control media blinking in editing rather than control confusion of pairs of quote marks.
6086
- (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.syntax)(0 /* Syntax.none */, 3, 1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '"', [['"', 3]])), (0, source_1.str)('"'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest])]));
6087
+ }, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.creation)((0, combinator_1.syntax)(8 /* Syntax.bracket */, 2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 3], [']', 2]]))), (0, source_1.str)(']'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.creation)((0, combinator_1.syntax)(8 /* Syntax.bracket */, 2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '}', [[/^\\?\n/, 3], ['}', 2]]))), (0, source_1.str)('}'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.creation)((0, combinator_1.syntax)(0 /* Syntax.none */, 3, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '"', [[/^\\?\n/, 4], ['"', 3]]))), (0, source_1.str)('"'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest])]));
6087
6088
 
6088
6089
  /***/ }),
6089
6090
 
@@ -6126,7 +6127,7 @@ const source_1 = __webpack_require__(6743);
6126
6127
  const visibility_1 = __webpack_require__(7618);
6127
6128
  const array_1 = __webpack_require__(8112);
6128
6129
  const dom_1 = __webpack_require__(3252);
6129
- exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('~~', '~'), (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 1, 0 /* State.none */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '~~')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '~'), true)]))), (0, source_1.str)('~~'), false, ([, bs], rest) => [[(0, dom_1.html)('del', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
6130
+ exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.surround)((0, source_1.str)('~~', '~'), (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 0 /* State.none */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '~~')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '~'), true)]))), (0, source_1.str)('~~'), false, ([, bs], rest) => [[(0, dom_1.html)('del', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
6130
6131
 
6131
6132
  /***/ }),
6132
6133
 
@@ -6148,7 +6149,7 @@ const source_1 = __webpack_require__(6743);
6148
6149
  const visibility_1 = __webpack_require__(7618);
6149
6150
  const array_1 = __webpack_require__(8112);
6150
6151
  const dom_1 = __webpack_require__(3252);
6151
- exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('*', '*'), (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 1, 0 /* State.none */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*'), [[/^\\?\n/, 9]]), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*', [[/^\\?\n/, 9]]), (0, combinator_1.union)([emstrong_1.emstrong, strong_1.strong, exports.emphasis]))])))), (0, source_1.str)('*'), false, ([, bs], rest) => [[(0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
6152
+ exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.surround)((0, source_1.str)('*', '*'), (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 0 /* State.none */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*'), [[/^\\?\n/, 9]]), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*', [[/^\\?\n/, 9]]), (0, combinator_1.union)([emstrong_1.emstrong, strong_1.strong, exports.emphasis]))])))), (0, source_1.str)('*'), false, ([, bs], rest) => [[(0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
6152
6153
 
6153
6154
  /***/ }),
6154
6155
 
@@ -6172,7 +6173,7 @@ const dom_1 = __webpack_require__(3252);
6172
6173
  const array_1 = __webpack_require__(8112);
6173
6174
  const substrong = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('**'), [[/^\\?\n/, 9]]), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*', [[/^\\?\n/, 9]]), (0, combinator_1.union)([exports.emstrong, strong_1.strong]))])));
6174
6175
  const subemphasis = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*'), [[/^\\?\n/, 9]]), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*', [[/^\\?\n/, 9]]), (0, combinator_1.union)([exports.emstrong, strong_1.strong, emphasis_1.emphasis]))])));
6175
- exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('***'), (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 1, 0 /* State.none */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*'), [[/^\\?\n/, 9]]), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*', [[/^\\?\n/, 9]]), inline_1.inline)])))), (0, source_1.str)(/^\*{1,3}/), false, ([, bs, cs], rest, context) => {
6176
+ exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.surround)((0, source_1.str)('***'), (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 0 /* State.none */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*'), [[/^\\?\n/, 9]]), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*', [[/^\\?\n/, 9]]), inline_1.inline)])))), (0, source_1.str)(/^\*{1,3}/), false, ([, bs, cs], rest, context) => {
6176
6177
  switch (cs[0]) {
6177
6178
  case '***':
6178
6179
  return [[(0, dom_1.html)('em', [(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))])], rest];
@@ -6187,7 +6188,7 @@ exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, s
6187
6188
  context
6188
6189
  }) ?? [['**', (0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest];
6189
6190
  }
6190
- }, ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
6191
+ }, ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
6191
6192
 
6192
6193
  /***/ }),
6193
6194
 
@@ -6225,16 +6226,16 @@ const indexee_1 = __webpack_require__(1269);
6225
6226
  const source_1 = __webpack_require__(6743);
6226
6227
  const visibility_1 = __webpack_require__(7618);
6227
6228
  const dom_1 = __webpack_require__(3252);
6228
- 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)(64 /* State.index */, false, (0, combinator_1.syntax)(128 /* Syntax.index */, 2, 1, 502 /* State.linkers */ | 8 /* State.media */, (0, visibility_1.startTight)((0, combinator_1.open)((0, source_1.stropt)('|'), (0, combinator_1.some)((0, combinator_1.union)([exports.signature, inline_1.inline]), ']', [[/^\\?\n/, 9], [']', 2]]), true)))), ']', false, ([, ns], rest) => [[(0, dom_1.html)('a', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))], rest])), ([el]) => [(0, dom_1.define)(el, {
6229
+ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[#', (0, combinator_1.creation)((0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)('[#', (0, combinator_1.constraint)(64 /* State.index */, false, (0, combinator_1.syntax)(128 /* Syntax.index */, 2, 502 /* State.linkers */ | 8 /* State.media */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.inits)([inline_1.inline, exports.signature]), ']', [[/^\\?\n/, 9], [']', 2]])))), ']', false, ([, ns], rest) => [[(0, dom_1.html)('a', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))], rest])), ([el]) => [(0, dom_1.define)(el, {
6229
6230
  id: el.id ? null : undefined,
6230
6231
  class: 'index',
6231
6232
  href: el.id ? `#${el.id}` : undefined
6232
- })])));
6233
- exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.open)('|', (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ']'))), ns => [(0, dom_1.html)('span', {
6233
+ })]))));
6234
+ exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|', (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.open)('|', (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ']'))), ns => [(0, dom_1.html)('span', {
6234
6235
  class: 'indexer',
6235
6236
  'data-index': (0, indexee_1.identity)(undefined, ns.join('')).slice(7)
6236
- })])));
6237
- const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(8, (0, combinator_1.some)(source_1.txt, '"')), (0, source_1.str)('"'), true)])));
6237
+ })]))));
6238
+ const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(3, (0, combinator_1.some)(source_1.txt, '"')), (0, source_1.str)('"'), true)])));
6238
6239
 
6239
6240
  /***/ }),
6240
6241
 
@@ -6427,12 +6428,12 @@ const array_1 = __webpack_require__(8112);
6427
6428
  const dom_1 = __webpack_require__(3252);
6428
6429
  // Don't use the symbols already used: !#$%@&*+~=|
6429
6430
  // All syntax surrounded by square brackets shouldn't contain line breaks.
6430
- exports.placeholder = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0, combinator_1.surround)((0, source_1.str)(/^\[[:^|]/), (0, combinator_1.syntax)(64 /* Syntax.placeholder */, 2, 1, 0 /* State.none */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 2]]))), (0, source_1.str)(']'), false, ([, bs], rest) => [[(0, dom_1.html)('span', {
6431
+ exports.placeholder = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0, combinator_1.creation)((0, combinator_1.surround)((0, source_1.str)(/^\[[:^|]/), (0, combinator_1.syntax)(64 /* Syntax.placeholder */, 2, 0 /* State.none */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 2]]))), (0, source_1.str)(']'), false, ([, bs], rest) => [[(0, dom_1.html)('span', {
6431
6432
  class: 'invalid',
6432
6433
  'data-invalid-syntax': 'extension',
6433
6434
  'data-invalid-type': 'syntax',
6434
6435
  'data-invalid-message': `Invalid start symbol or linebreak`
6435
- }, (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
6436
+ }, (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]))));
6436
6437
 
6437
6438
  /***/ }),
6438
6439
 
@@ -6462,9 +6463,9 @@ const attrspecs = {
6462
6463
  };
6463
6464
  Object.setPrototypeOf(attrspecs, null);
6464
6465
  Object.values(attrspecs).forEach(o => Object.setPrototypeOf(o, null));
6465
- exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('<', (0, combinator_1.validate)(/^<[a-z]+(?=[^\S\n]|>)/i, (0, combinator_1.syntax)(0 /* Syntax.none */, 5, 1, 0 /* State.none */, (0, combinator_1.union)([(0, combinator_1.focus)(/^<wbr[^\S\n]*>/i, () => [[(0, dom_1.html)('wbr')], '']), (0, combinator_1.surround)(
6466
+ exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('<', (0, combinator_1.validate)(/^<[a-z]+(?=[^\S\n]|>)/i, (0, combinator_1.creation)((0, combinator_1.syntax)(0 /* Syntax.none */, 4, 0 /* State.none */, (0, combinator_1.union)([(0, combinator_1.focus)(/^<wbr[^\S\n]*>/i, () => [[(0, dom_1.html)('wbr')], '']), (0, combinator_1.surround)(
6466
6467
  // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
6467
- (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]))), (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 clock_1.Clock(10000)))])))));
6468
+ (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}>`), 4]]), 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]))), (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}>`, 4]])]), (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 clock_1.Clock(10000)))]))))));
6468
6469
  exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="[^"\n]*")?(?=[^\S\n]|>)/i)]);
6469
6470
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
6470
6471
  // [...document.querySelectorAll('tbody > tr > td:first-child')].map(el => el.textContent.slice(1, -1))
@@ -6558,7 +6559,7 @@ const source_1 = __webpack_require__(6743);
6558
6559
  const visibility_1 = __webpack_require__(7618);
6559
6560
  const array_1 = __webpack_require__(8112);
6560
6561
  const dom_1 = __webpack_require__(3252);
6561
- exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('++', '+'), (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 1, 0 /* State.none */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '++')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '+'), true)]))), (0, source_1.str)('++'), false, ([, bs], rest) => [[(0, dom_1.html)('ins', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
6562
+ exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.surround)((0, source_1.str)('++', '+'), (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 0 /* State.none */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '++')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '+'), true)]))), (0, source_1.str)('++'), false, ([, bs], rest) => [[(0, dom_1.html)('ins', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
6562
6563
 
6563
6564
  /***/ }),
6564
6565
 
@@ -6585,11 +6586,11 @@ const optspec = {
6585
6586
  };
6586
6587
  Object.setPrototypeOf(optspec, null);
6587
6588
  exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'], (0, combinator_1.union)([exports.medialink, exports.textlink])));
6588
- exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(16 /* State.link */, false, (0, combinator_1.syntax)(16 /* Syntax.link */, 2, 10, 502 /* State.linkers */ | 8 /* State.media */, (0, combinator_1.bind)((0, combinator_1.reverse)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, visibility_1.trimBlankStart)((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) => {
6589
+ exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(10, (0, combinator_1.constraint)(16 /* State.link */, false, (0, combinator_1.syntax)(16 /* Syntax.link */, 2, 502 /* State.linkers */ | 8 /* State.media */, (0, combinator_1.bind)((0, combinator_1.reverse)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, visibility_1.trimBlankStart)((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) => {
6589
6590
  if (content.length !== 0 && (0, visibility_1.trimNodeEnd)(content = (0, dom_1.defrag)(content)).length === 0) return;
6590
6591
  return [[parse(content, params, context)], rest];
6591
- }))));
6592
- exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(16 /* State.link */ | 8 /* State.media */, false, (0, combinator_1.syntax)(16 /* Syntax.link */, 2, 10, 502 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.reverse)((0, combinator_1.sequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.union)([inline_1.media, inline_1.shortmedia]), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))])), ([params, content = []], rest, context) => [[parse((0, dom_1.defrag)(content), params, context)], rest]))));
6592
+ })))));
6593
+ exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(10, (0, combinator_1.constraint)(16 /* State.link */ | 8 /* State.media */, false, (0, combinator_1.syntax)(16 /* Syntax.link */, 2, 502 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.reverse)((0, combinator_1.sequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.union)([inline_1.media, inline_1.shortmedia]), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))])), ([params, content = []], rest, context) => [[parse((0, dom_1.defrag)(content), params, context)], rest])))));
6593
6594
  exports.linemedialink = (0, combinator_1.surround)(source_1.linebreak, (0, combinator_1.union)([exports.medialink]), /^(?=[^\S\n]*(?:$|\n))/);
6594
6595
  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((0, dom_1.defrag)(content), params, context)], rest]))));
6595
6596
  exports.uri = (0, combinator_1.union)([(0, combinator_1.open)(/^[^\S\n]+/, (0, source_1.str)(/^\S+/)), (0, source_1.str)(/^[^\s{}]+/)]);
@@ -6694,7 +6695,7 @@ const source_1 = __webpack_require__(6743);
6694
6695
  const visibility_1 = __webpack_require__(7618);
6695
6696
  const array_1 = __webpack_require__(8112);
6696
6697
  const dom_1 = __webpack_require__(3252);
6697
- exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('==', '='), (0, combinator_1.constraint)(4 /* State.mark */, false, (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 1, 0 /* State.none */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('=='), [[/^\\?\n/, 9]]), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '=', [[/^\\?\n/, 9]]), exports.mark)]))))), (0, source_1.str)('=='), false, ([, bs], rest, {
6698
+ exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.surround)((0, source_1.str)('==', '='), (0, combinator_1.constraint)(4 /* State.mark */, false, (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 0 /* State.none */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('=='), [[/^\\?\n/, 9]]), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '=', [[/^\\?\n/, 9]]), exports.mark)]))))), (0, source_1.str)('=='), false, ([, bs], rest, {
6698
6699
  id
6699
6700
  }) => {
6700
6701
  const el = (0, dom_1.html)('mark', (0, dom_1.defrag)(bs));
@@ -6703,7 +6704,7 @@ exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, sourc
6703
6704
  }), el.id && (0, dom_1.html)('a', {
6704
6705
  href: `#${el.id}`
6705
6706
  })], rest];
6706
- }, ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
6707
+ }, ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
6707
6708
 
6708
6709
  /***/ }),
6709
6710
 
@@ -6769,7 +6770,7 @@ const optspec = {
6769
6770
  rel: undefined
6770
6771
  };
6771
6772
  Object.setPrototypeOf(optspec, null);
6772
- exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.open)('!', (0, combinator_1.constraint)(8 /* State.media */, false, (0, combinator_1.syntax)(4 /* Syntax.media */, 2, 10, ~16 /* State.link */, (0, combinator_1.bind)((0, combinator_1.verify)((0, combinator_1.fmap)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']', [[/^\\?\n/, 9]]), ']', true)), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), /^[^\S\n]*}/))]), ([as, bs]) => bs ? [[as.join('').trim() || as.join('')], bs] : [[''], as]), ([[text]]) => text === '' || text.trim() !== ''), ([[text], params], rest, context) => {
6773
+ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.creation)(10, (0, combinator_1.open)('!', (0, combinator_1.constraint)(8 /* State.media */, false, (0, combinator_1.syntax)(4 /* Syntax.media */, 2, ~16 /* State.link */, (0, combinator_1.bind)((0, combinator_1.verify)((0, combinator_1.fmap)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']', [[/^\\?\n/, 9]]), ']', true)), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), /^[^\S\n]*}/))]), ([as, bs]) => bs ? [[as.join('').trim() || as.join('')], bs] : [[''], as]), ([[text]]) => text === '' || text.trim() !== ''), ([[text], params], rest, context) => {
6773
6774
  const INSECURE_URI = params.shift();
6774
6775
  const url = new url_1.ReadonlyURL((0, link_1.resolve)(INSECURE_URI, context.host ?? location, context.url ?? context.host ?? location), context.host?.href || location.href);
6775
6776
  let cache;
@@ -6797,9 +6798,9 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '
6797
6798
  source: `{ ${INSECURE_URI}${params.join('')} }${rest}`,
6798
6799
  context
6799
6800
  });
6800
- }))))));
6801
+ })))))));
6801
6802
  exports.linemedia = (0, combinator_1.surround)(source_1.linebreak, (0, combinator_1.union)([exports.media]), /^(?=[^\S\n]*(?:$|\n))/);
6802
- const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(8, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, source_1.txt]), '"')), (0, source_1.str)('"'), true)])));
6803
+ const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(3, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, source_1.txt]), '"')), (0, source_1.str)('"'), true)])));
6803
6804
  const option = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[1-9][0-9]*x[1-9][0-9]*(?=[^\S\n]|})/), ([opt]) => [` width="${opt.slice(1).split('x')[0]}"`, ` height="${opt.slice(1).split('x')[1]}"`]), (0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[1-9][0-9]*:[1-9][0-9]*(?=[^\S\n]|})/), ([opt]) => [` aspect-ratio="${opt.slice(1).split(':').join('/')}"`]), link_1.option]));
6804
6805
  function sanitize(target, uri, alt) {
6805
6806
  switch (uri.protocol) {
@@ -6841,7 +6842,7 @@ const inline_1 = __webpack_require__(1160);
6841
6842
  const source_1 = __webpack_require__(6743);
6842
6843
  const visibility_1 = __webpack_require__(7618);
6843
6844
  const dom_1 = __webpack_require__(3252);
6844
- exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('[[', (0, combinator_1.constraint)(128 /* State.reference */, false, (0, combinator_1.syntax)(256 /* Syntax.reference */, 6, 1, 256 /* State.annotation */ | 128 /* State.reference */ | 8 /* State.media */, (0, combinator_1.subsequence)([abbr, (0, visibility_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]]))]))), ']]', false, ([, ns], rest) => [[(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))])], rest]));
6845
+ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.surround)('[[', (0, combinator_1.constraint)(128 /* State.reference */, false, (0, combinator_1.syntax)(256 /* Syntax.reference */, 6, 256 /* State.annotation */ | 128 /* State.reference */ | 8 /* State.media */, (0, combinator_1.subsequence)([abbr, (0, visibility_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]]))]))), ']]', false, ([, ns], rest) => [[(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))])], rest])));
6845
6846
  // Chicago-Style
6846
6847
  const abbr = (0, combinator_1.creation)((0, combinator_1.surround)('^', (0, combinator_1.union)([(0, source_1.str)(/^(?=[A-Z])(?:[0-9A-Za-z]'?|(?:[-.:]|\.?\??,? ?)(?!['\-.:?, ]))+/)]), /^\|?(?=]])|^\|[^\S\n]*/, true, ([, ns], rest) => ns ? [['\n', ns[0].trimEnd()], rest.replace(visibility_1.blank.start, '')] : [[''], `^${rest}`], ([,, rest]) => [[''], `^${rest}`]));
6847
6848
  function attributes(ns) {
@@ -6885,11 +6886,11 @@ const source_1 = __webpack_require__(6743);
6885
6886
  const memoize_1 = __webpack_require__(1808);
6886
6887
  const array_1 = __webpack_require__(8112);
6887
6888
  const dom_1 = __webpack_require__(3252);
6888
- exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[%', (0, combinator_1.syntax)(0 /* Syntax.none */, 4, 1, 0 /* State.none */, (0, combinator_1.match)(/^\[(%+)\s/, (0, memoize_1.memoize)(([, fence]) => (0, combinator_1.surround)((0, combinator_1.open)((0, source_1.str)(`[${fence}`), (0, combinator_1.some)(source_1.text, new RegExp(String.raw`^\s+${fence}\]|^\S`)), true), (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), new RegExp(String.raw`^\s+${fence}\]`), [[new RegExp(String.raw`^\s+${fence}\]`), 4]]), (0, combinator_1.close)((0, combinator_1.some)(source_1.text, /^\S/), (0, source_1.str)(`${fence}]`)), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
6889
+ exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[%', (0, combinator_1.creation)((0, combinator_1.syntax)(0 /* Syntax.none */, 5, 0 /* State.none */, (0, combinator_1.match)(/^\[(%+)\s/, (0, memoize_1.memoize)(([, fence]) => (0, combinator_1.surround)((0, combinator_1.open)((0, source_1.str)(`[${fence}`), (0, combinator_1.some)(source_1.text, new RegExp(String.raw`^\s+${fence}\]|^\S`)), true), (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), new RegExp(String.raw`^\s+${fence}\]`), [[new RegExp(String.raw`^\s+${fence}\]`), 5]]), (0, combinator_1.close)((0, combinator_1.some)(source_1.text, /^\S/), (0, source_1.str)(`${fence}]`)), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
6889
6890
  class: 'remark'
6890
6891
  }, [(0, dom_1.html)('input', {
6891
6892
  type: 'checkbox'
6892
- }), (0, dom_1.html)('span', (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))])], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), ([, fence]) => fence.length, {})))));
6893
+ }), (0, dom_1.html)('span', (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))])], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), ([, fence]) => fence.length, {}))))));
6893
6894
 
6894
6895
  /***/ }),
6895
6896
 
@@ -6910,7 +6911,7 @@ const source_1 = __webpack_require__(6743);
6910
6911
  const visibility_1 = __webpack_require__(7618);
6911
6912
  const array_1 = __webpack_require__(8112);
6912
6913
  const dom_1 = __webpack_require__(3252);
6913
- exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0, combinator_1.syntax)(32 /* Syntax.ruby */, 2, 1, -1 /* State.all */, (0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.fmap)((0, combinator_1.sequence)([(0, combinator_1.surround)('[', (0, source_1.str)(/^(?:\\[^\n]|[^\\[\](){}"\n])+/), ']'), (0, combinator_1.surround)('(', (0, source_1.str)(/^(?:\\[^\n]|[^\\[\](){}"\n])+/), ')')]), ([texts, rubies], _, context) => [(0, parser_1.eval)(text({
6914
+ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0, combinator_1.creation)((0, combinator_1.syntax)(32 /* Syntax.ruby */, 2, -1 /* State.all */, (0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.fmap)((0, combinator_1.sequence)([(0, combinator_1.surround)('[', (0, source_1.str)(/^(?:\\[^\n]|[^\\[\](){}"\n])+/), ']'), (0, combinator_1.surround)('(', (0, source_1.str)(/^(?:\\[^\n]|[^\\[\](){}"\n])+/), ')')]), ([texts, rubies], _, context) => [(0, parser_1.eval)(text({
6914
6915
  source: texts,
6915
6916
  context
6916
6917
  }), [])[0] ?? '', (0, parser_1.eval)(text({
@@ -6926,7 +6927,7 @@ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0,
6926
6927
  default:
6927
6928
  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', ')')])))];
6928
6929
  }
6929
- }))));
6930
+ })))));
6930
6931
  const text = (0, combinator_1.creation)(1, false, ({
6931
6932
  source,
6932
6933
  context
@@ -7023,7 +7024,7 @@ const source_1 = __webpack_require__(6743);
7023
7024
  const visibility_1 = __webpack_require__(7618);
7024
7025
  const array_1 = __webpack_require__(8112);
7025
7026
  const dom_1 = __webpack_require__(3252);
7026
- exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('**', '*'), (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 1, 0 /* State.none */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('**'), [[/^\\?\n/, 9]]), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*', [[/^\\?\n/, 9]]), (0, combinator_1.union)([emstrong_1.emstrong, exports.strong]))])))), (0, source_1.str)('**'), false, ([, bs], rest) => [[(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
7027
+ exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.surround)((0, source_1.str)('**', '*'), (0, combinator_1.syntax)(0 /* Syntax.none */, 1, 0 /* State.none */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('**'), [[/^\\?\n/, 9]]), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*', [[/^\\?\n/, 9]]), (0, combinator_1.union)([emstrong_1.emstrong, exports.strong]))])))), (0, source_1.str)('**'), false, ([, bs], rest) => [[(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
7027
7028
 
7028
7029
  /***/ }),
7029
7030
 
@@ -7041,10 +7042,10 @@ const combinator_1 = __webpack_require__(2087);
7041
7042
  const source_1 = __webpack_require__(6743);
7042
7043
  const array_1 = __webpack_require__(8112);
7043
7044
  const dom_1 = __webpack_require__(3252);
7044
- exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('{{', (0, combinator_1.syntax)(0 /* Syntax.none */, 2, 1, -1 /* State.all */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), '}}', true, ([, ns = []], rest) => [[(0, dom_1.html)('span', {
7045
+ exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.surround)('{{', (0, combinator_1.syntax)(0 /* Syntax.none */, 6, -1 /* State.all */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}', [['}}', 6]])), '}}', true, ([, ns = []], rest) => [[(0, dom_1.html)('span', {
7045
7046
  class: 'template'
7046
- }, `{{${ns.join('').replace(/\x1B/g, '')}}}`)], rest]));
7047
- const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')'), (0, source_1.str)(')'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ']'), (0, source_1.str)(']'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}'), (0, source_1.str)('}'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(8, (0, combinator_1.some)(source_1.escsource, /^"|^\\?\n/)), (0, source_1.str)('"'), true)])));
7047
+ }, `{{${ns.join('').replace(/\x1B/g, '')}}}`)], rest])));
7048
+ const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')'), (0, source_1.str)(')'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ']'), (0, source_1.str)(']'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}'), (0, source_1.str)('}'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(3, (0, combinator_1.some)(source_1.escsource, /^"|^\\?\n/)), (0, source_1.str)('"'), true)])));
7048
7049
 
7049
7050
  /***/ }),
7050
7051
 
@@ -7408,7 +7409,7 @@ exports.validate = validate;
7408
7409
  Object.defineProperty(exports, "__esModule", ({
7409
7410
  value: true
7410
7411
  }));
7411
- exports.anyline = exports.emptyline = exports.contentline = exports.stropt = exports.str = exports.unescsource = exports.escsource = exports.linebreak = exports.txt = exports.text = void 0;
7412
+ exports.anyline = exports.emptyline = exports.contentline = exports.str = exports.unescsource = exports.escsource = exports.linebreak = exports.txt = exports.text = void 0;
7412
7413
  var text_1 = __webpack_require__(7763);
7413
7414
  Object.defineProperty(exports, "text", ({
7414
7415
  enumerable: true,
@@ -7449,12 +7450,6 @@ Object.defineProperty(exports, "str", ({
7449
7450
  return str_1.str;
7450
7451
  }
7451
7452
  }));
7452
- Object.defineProperty(exports, "stropt", ({
7453
- enumerable: true,
7454
- get: function () {
7455
- return str_1.stropt;
7456
- }
7457
- }));
7458
7453
  var line_1 = __webpack_require__(5034);
7459
7454
  Object.defineProperty(exports, "contentline", ({
7460
7455
  enumerable: true,
@@ -7552,7 +7547,7 @@ exports.contentline = (0, combinator_1.line)(i => !(0, combinator_1.isBlank)(i.s
7552
7547
  Object.defineProperty(exports, "__esModule", ({
7553
7548
  value: true
7554
7549
  }));
7555
- exports.stropt = exports.str = void 0;
7550
+ exports.str = void 0;
7556
7551
  const combinator_1 = __webpack_require__(2087);
7557
7552
  function str(pattern, not) {
7558
7553
  return typeof pattern === 'string' ? (0, combinator_1.creation)(1, false, ({
@@ -7571,21 +7566,6 @@ function str(pattern, not) {
7571
7566
  });
7572
7567
  }
7573
7568
  exports.str = str;
7574
- function stropt(pattern) {
7575
- return typeof pattern === 'string' ? (0, combinator_1.creation)(1, false, ({
7576
- source
7577
- }) => {
7578
- if (source === '') return;
7579
- return source.slice(0, pattern.length) === pattern ? [[pattern], source.slice(pattern.length)] : [[''], source];
7580
- }) : (0, combinator_1.creation)(1, false, ({
7581
- source
7582
- }) => {
7583
- if (source === '') return;
7584
- const m = source.match(pattern);
7585
- return m ? [[m[0]], source.slice(m[0].length)] : undefined;
7586
- });
7587
- }
7588
- exports.stropt = stropt;
7589
7569
 
7590
7570
  /***/ }),
7591
7571
 
@@ -7602,9 +7582,9 @@ exports.isAlphanumeric = exports.linebreak = exports.txt = exports.text = export
7602
7582
  const combinator_1 = __webpack_require__(2087);
7603
7583
  const str_1 = __webpack_require__(2790);
7604
7584
  const dom_1 = __webpack_require__(3252);
7605
- exports.delimiter = /[\s\x00-\x7F]|\S[#>]/u;
7606
- exports.nonWhitespace = /[\S\n]|$/;
7607
- exports.nonAlphanumeric = /[^0-9A-Za-z]|\S[#>]|$/;
7585
+ exports.delimiter = /[\s\x00-\x7F()]|\S[#>]/u;
7586
+ exports.nonWhitespace = /[\S\n]|$/u;
7587
+ exports.nonAlphanumeric = /[^0-9A-Za-z]|\S[#>]|$/u;
7608
7588
  const repeat = (0, str_1.str)(/^(.)\1*/);
7609
7589
  exports.text = (0, combinator_1.creation)(1, false, ({
7610
7590
  source,
@@ -7886,7 +7866,6 @@ function trimBlankEnd(parser) {
7886
7866
  //}
7887
7867
  //function trimNodeStart<T extends HTMLElement | string>(nodes: T[]): T[] {
7888
7868
  // for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes[0], 0);) {
7889
- // if (nodes.length === 1 && typeof node === 'object' && node.className === 'indexer') break;
7890
7869
  // if (typeof node === 'string') {
7891
7870
  // const pos = node.trimStart().length;
7892
7871
  // if (pos > 0) {
@@ -7894,6 +7873,9 @@ function trimBlankEnd(parser) {
7894
7873
  // break;
7895
7874
  // }
7896
7875
  // }
7876
+ // else if (nodes.length === 1 && node.className === 'indexer') {
7877
+ // break;
7878
+ // }
7897
7879
  // nodes.shift();
7898
7880
  // }
7899
7881
  // return nodes;
@@ -8546,7 +8528,7 @@ function level(h) {
8546
8528
  function unlink(h) {
8547
8529
  for (let es = h.getElementsByTagName('a'), len = es.length, i = 0; i < len; ++i) {
8548
8530
  const el = es[i];
8549
- el.replaceWith(...el.childNodes);
8531
+ el.firstChild ? el.replaceWith(el.firstChild) : el.remove();
8550
8532
  }
8551
8533
  return h.childNodes;
8552
8534
  }