securemark 0.283.3 → 0.283.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/index.js +142 -107
  3. package/markdown.d.ts +16 -8
  4. package/package.json +1 -1
  5. package/src/combinator/control/manipulation/surround.ts +4 -4
  6. package/src/combinator/data/parser/context/delimiter.ts +20 -20
  7. package/src/combinator/data/parser/context.ts +4 -3
  8. package/src/parser/block/blockquote.ts +1 -1
  9. package/src/parser/block/dlist.ts +6 -6
  10. package/src/parser/block/extension/aside.ts +1 -1
  11. package/src/parser/block/extension/example.ts +2 -2
  12. package/src/parser/block/extension/figure.ts +3 -3
  13. package/src/parser/block/extension/table.ts +5 -5
  14. package/src/parser/block/heading.ts +6 -6
  15. package/src/parser/block/ilist.ts +1 -1
  16. package/src/parser/block/olist.ts +1 -1
  17. package/src/parser/block/paragraph.ts +3 -3
  18. package/src/parser/block/reply.ts +2 -2
  19. package/src/parser/block/sidefence.ts +1 -1
  20. package/src/parser/block/table.ts +4 -4
  21. package/src/parser/block/ulist.ts +1 -1
  22. package/src/parser/block.ts +4 -3
  23. package/src/parser/context.ts +18 -9
  24. package/src/parser/inline/annotation.ts +7 -4
  25. package/src/parser/inline/autolink/account.ts +15 -14
  26. package/src/parser/inline/autolink/anchor.ts +14 -13
  27. package/src/parser/inline/autolink/channel.ts +6 -3
  28. package/src/parser/inline/autolink/email.ts +4 -3
  29. package/src/parser/inline/autolink/hashnum.ts +11 -9
  30. package/src/parser/inline/autolink/hashtag.ts +11 -9
  31. package/src/parser/inline/autolink/url.ts +24 -18
  32. package/src/parser/inline/autolink.ts +4 -5
  33. package/src/parser/inline/bracket.ts +6 -6
  34. package/src/parser/inline/code.ts +1 -1
  35. package/src/parser/inline/deletion.ts +1 -1
  36. package/src/parser/inline/emphasis.ts +1 -1
  37. package/src/parser/inline/emstrong.ts +1 -1
  38. package/src/parser/inline/extension/index.ts +9 -6
  39. package/src/parser/inline/extension/indexer.ts +1 -1
  40. package/src/parser/inline/extension/label.ts +1 -1
  41. package/src/parser/inline/extension/placeholder.ts +1 -1
  42. package/src/parser/inline/html.ts +45 -43
  43. package/src/parser/inline/htmlentity.ts +3 -3
  44. package/src/parser/inline/insertion.ts +1 -1
  45. package/src/parser/inline/link.test.ts +7 -2
  46. package/src/parser/inline/link.ts +11 -15
  47. package/src/parser/inline/mark.ts +1 -1
  48. package/src/parser/inline/math.ts +1 -1
  49. package/src/parser/inline/media.ts +4 -4
  50. package/src/parser/inline/reference.ts +7 -4
  51. package/src/parser/inline/remark.ts +4 -4
  52. package/src/parser/inline/ruby.ts +7 -6
  53. package/src/parser/inline/shortmedia.ts +1 -1
  54. package/src/parser/inline/strong.ts +1 -1
  55. package/src/parser/inline/template.ts +2 -2
  56. package/src/parser/inline.test.ts +1 -0
  57. package/src/parser/segment.ts +3 -2
  58. package/src/parser/source/escapable.ts +2 -2
  59. package/src/parser/source/str.ts +1 -1
  60. package/src/parser/source/text.ts +3 -3
  61. package/src/parser/source/unescapable.ts +4 -2
  62. package/src/parser/visibility.ts +14 -13
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! securemark v0.283.3 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
1
+ /*! securemark v0.283.5 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory(require("Prism"), require("DOMPurify"));
@@ -907,8 +907,8 @@ const dom_1 = __webpack_require__(394);
907
907
  const memoize_1 = __webpack_require__(6925);
908
908
  exports.unsafehtmlentity = (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.validate)('&', (0, combinator_1.focus)(/^&[0-9A-Za-z]{1,99};/, ({
909
909
  source
910
- }) => [[parse(source) ?? `\x1B${source}`], ''])));
911
- exports.htmlentity = (0, combinator_1.fmap)((0, combinator_1.union)([exports.unsafehtmlentity]), ([text]) => [text[0] === '\x1B' ? (0, dom_1.html)('span', {
910
+ }) => [[parse(source) ?? `${"\u001B" /* Command.Escape */}${source}`], ''])));
911
+ exports.htmlentity = (0, combinator_1.fmap)((0, combinator_1.union)([exports.unsafehtmlentity]), ([text]) => [text[0] === "\u001B" /* Command.Escape */ ? (0, dom_1.html)('span', {
912
912
  class: 'invalid',
913
913
  'data-invalid-syntax': 'htmlentity',
914
914
  'data-invalid-type': 'syntax',
@@ -1031,11 +1031,11 @@ const util_1 = __webpack_require__(4992);
1031
1031
  const visibility_1 = __webpack_require__(6364);
1032
1032
  const array_1 = __webpack_require__(6876);
1033
1033
  const dom_1 = __webpack_require__(394);
1034
- exports.dlist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^~[^\S\n]+(?=\S)/, (0, combinator_1.some)((0, combinator_1.inits)([(0, combinator_1.state)(256 /* State.annotation */ | 128 /* State.reference */ | 64 /* State.index */ | 32 /* State.label */ | 16 /* State.link */ | 8 /* State.media */, (0, combinator_1.some)(term)), (0, combinator_1.some)(desc)]))), es => [(0, dom_1.html)('dl', fillTrailingDescription(es))])));
1035
- const term = (0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.open)(/^~[^\S\n]+(?=\S)/, (0, visibility_1.visualize)((0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), ns => [(0, dom_1.html)('dt', {
1034
+ exports.dlist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^~[^\S\n]+(?=\S)/, (0, combinator_1.some)((0, combinator_1.inits)([(0, combinator_1.state)(128 /* State.annotation */ | 64 /* State.reference */ | 32 /* State.index */ | 16 /* State.label */ | 8 /* State.link */ | 4 /* State.media */, (0, combinator_1.some)(term)), (0, combinator_1.some)(desc)]))), es => [(0, dom_1.html)('dl', fillTrailingDescription(es))])));
1035
+ const term = (0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.open)(/^~[^\S\n]+(?=\S)/, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), ns => [(0, dom_1.html)('dt', {
1036
1036
  'data-index': (0, inline_1.dataindex)(ns)
1037
- }, (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))])));
1038
- const desc = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)(/^:[^\S\n]+(?=\S)|/, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, /^[~:][^\S\n]+\S/), (0, visibility_1.visualize)((0, util_1.lineable)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('dd', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]), false);
1037
+ }, (0, dom_1.defrag)(ns))])));
1038
+ const desc = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)(/^:[^\S\n]+(?=\S)|/, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, /^[~:][^\S\n]+\S/), (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, util_1.lineable)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline])))))), true), ns => [(0, dom_1.html)('dd', (0, dom_1.defrag)(ns))]), false);
1039
1039
  function fillTrailingDescription(es) {
1040
1040
  return es.length > 0 && es.at(-1).tagName === 'DT' ? (0, array_1.push)(es, [(0, dom_1.html)('dd')]) : es;
1041
1041
  }
@@ -1965,9 +1965,13 @@ const combinator_1 = __webpack_require__(3484);
1965
1965
  const link_1 = __webpack_require__(3628);
1966
1966
  const source_1 = __webpack_require__(8745);
1967
1967
  const closer = /^[-+*=~^_,.;:!?]*(?=[\\"`|\[\](){}<>]|$)/;
1968
- 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])))));
1969
- 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))])));
1970
- const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(0, 6 /* Recursion.terminal */, (0, combinator_1.precedence)(1, (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')'), (0, source_1.str)(')'), true, undefined, undefined, 3 | 8 /* Backtrack.url */), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']'), (0, source_1.str)(']'), true, undefined, undefined, 3 | 8 /* Backtrack.url */), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}'), (0, source_1.str)('}'), true, undefined, undefined, 3 | 8 /* Backtrack.url */), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.some)(source_1.unescsource, '"')), (0, source_1.str)('"'), true, undefined, undefined, 3 | 8 /* Backtrack.url */)]))));
1968
+ 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.union)([(0, combinator_1.constraint)(1 /* State.autolink */, false, (0, combinator_1.syntax)(0, 1 /* State.autolink */, (0, combinator_1.convert)(url => `{ ${url} }`, link_1.unsafelink))), ({
1969
+ source
1970
+ }) => [[source], '']]))));
1971
+ exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.open)(source_1.linebreak, (0, combinator_1.focus)(/^!?https?:\/\/\S+(?=[^\S\n]*(?:$|\n))/, (0, combinator_1.tails)([(0, source_1.str)('!'), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, false, (0, combinator_1.syntax)(0, 1 /* State.autolink */, (0, combinator_1.convert)(url => `{ ${url} }`, link_1.unsafelink))), ({
1972
+ source
1973
+ }) => [[source], '']])]))));
1974
+ const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(0, 6 /* Recursion.terminal */, (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')')), (0, source_1.str)(')'), true, undefined, undefined, 3 | 8 /* Backtrack.url */), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']')), (0, source_1.str)(']'), true, undefined, undefined, 3 | 8 /* Backtrack.url */), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}')), (0, source_1.str)('}'), true, undefined, undefined, 3 | 8 /* Backtrack.url */), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.some)(source_1.unescsource, '"')), (0, source_1.str)('"'), true, undefined, undefined, 3 | 8 /* Backtrack.url */)])));
1971
1975
 
1972
1976
  /***/ },
1973
1977
 
@@ -2041,7 +2045,7 @@ const source_1 = __webpack_require__(8745);
2041
2045
  const dom_1 = __webpack_require__(394);
2042
2046
  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]))/);
2043
2047
  exports.segment = (0, combinator_1.clear)((0, combinator_1.validate)(['[$', '$'], (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])));
2044
- exports.label = (0, combinator_1.validate)(['[$', '$'], (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.fmap)((0, combinator_1.constraint)(32 /* State.label */, false, (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])), ([text]) => [(0, dom_1.html)('a', {
2048
+ exports.label = (0, combinator_1.validate)(['[$', '$'], (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.fmap)((0, combinator_1.constraint)(16 /* State.label */, false, (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])), ([text]) => [(0, dom_1.html)('a', {
2045
2049
  class: 'label',
2046
2050
  'data-label': text.slice(text[1] === '-' ? 0 : 1).toLowerCase()
2047
2051
  }, text)])));
@@ -2290,9 +2294,9 @@ const row = (parser, optional) => (0, combinator_1.fallback)((0, combinator_1.fm
2290
2294
  'data-invalid-message': 'Missing the start symbol of the table row'
2291
2295
  }, [(0, dom_1.html)('td', source.replace('\n', ''))])], '']));
2292
2296
  const align = (0, combinator_1.fmap)((0, combinator_1.open)('|', (0, combinator_1.union)([(0, combinator_1.focus)(/^:-+:/, () => [['center'], '']), (0, combinator_1.focus)(/^:-+/, () => [['start'], '']), (0, combinator_1.focus)(/^-+:/, () => [['end'], '']), (0, combinator_1.focus)(/^-+/, () => [[''], ''])])), ns => [(0, dom_1.html)('td', (0, dom_1.defrag)(ns))]);
2293
- const cell = (0, combinator_1.surround)(/^\|\s*(?=\S)/, (0, combinator_1.trimStart)((0, combinator_1.union)([(0, combinator_1.close)(inline_1.medialink, /^\s*(?=\||$)/), (0, combinator_1.close)(inline_1.media, /^\s*(?=\||$)/), (0, combinator_1.close)(inline_1.shortmedia, /^\s*(?=\||$)/), (0, visibility_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, /^\|/, [[/^[|\\]?\s*$/, 9]]))])), /^[^|]*/, true);
2294
- const head = (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('th', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]);
2295
- const data = (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('td', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]);
2297
+ const cell = (0, combinator_1.surround)(/^\|\s*(?=\S)/, (0, combinator_1.trimStart)((0, combinator_1.union)([(0, combinator_1.close)(inline_1.medialink, /^\s*(?=\||$)/), (0, combinator_1.close)(inline_1.media, /^\s*(?=\||$)/), (0, combinator_1.close)(inline_1.shortmedia, /^\s*(?=\||$)/), (0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline, /^\|/, [[/^[|\\]?\s*$/, 9]]))])), /^[^|]*/, true);
2298
+ const head = (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('th', (0, dom_1.defrag)(ns))]);
2299
+ const data = (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('td', (0, dom_1.defrag)(ns))]);
2296
2300
  function format(rows) {
2297
2301
  const aligns = rows[0].className === 'invalid' ? [] : (0, duff_1.duffReduce)(rows.shift().children, (acc, el) => (0, array_1.push)(acc, [el.textContent]), []);
2298
2302
  for (let i = 0; i < rows.length; ++i) {
@@ -2329,14 +2333,14 @@ exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('#', (0, co
2329
2333
  }) => [[source], ''])))));
2330
2334
  exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment,
2331
2335
  // その他の表示制御は各所のCSSで行う。
2332
- (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}`, {
2336
+ (0, combinator_1.state)(128 /* State.annotation */ | 64 /* State.reference */ | 32 /* State.index */ | 16 /* State.label */ | 8 /* State.link */ | 4 /* 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.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), (0, combinator_1.open)((0, source_1.str)('#'), (0, combinator_1.state)(251 /* State.linkers */, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline]))))), true)]), ([h, ...ns]) => [h.length <= 6 ? (0, dom_1.html)(`h${h.length}`, {
2333
2337
  'data-index': (0, inline_1.dataindex)(ns)
2334
- }, (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns))) : (0, dom_1.html)(`h6`, {
2338
+ }, (0, dom_1.defrag)(ns)) : (0, dom_1.html)(`h6`, {
2335
2339
  class: 'invalid',
2336
2340
  'data-invalid-syntax': 'heading',
2337
2341
  'data-invalid-type': 'syntax',
2338
2342
  'data-invalid-message': 'Heading level must be up to 6'
2339
- }, (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]))))));
2343
+ }, (0, dom_1.defrag)(ns))]))))));
2340
2344
 
2341
2345
  /***/ },
2342
2346
 
@@ -3220,7 +3224,7 @@ exports.media = media;
3220
3224
  Object.defineProperty(exports, "__esModule", ({
3221
3225
  value: true
3222
3226
  }));
3223
- exports.resolve = exports.option = exports.uri = exports.unsafelink = exports.linemedialink = exports.medialink = exports.textlink = exports.link = void 0;
3227
+ exports.resolve = exports.option = exports.uri = exports.unsafelink = exports.linemedialink = exports.medialink = exports.textlink = void 0;
3224
3228
  const combinator_1 = __webpack_require__(3484);
3225
3229
  const inline_1 = __webpack_require__(7973);
3226
3230
  const html_1 = __webpack_require__(5013);
@@ -3233,12 +3237,11 @@ const optspec = {
3233
3237
  rel: ['nofollow']
3234
3238
  };
3235
3239
  Object.setPrototypeOf(optspec, null);
3236
- exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'], (0, combinator_1.union)([exports.medialink, exports.textlink])));
3237
- exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.constraint)(16 /* State.link */, false, (0, combinator_1.syntax)(1, 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], [']', 1]])), ']', true, undefined, undefined, 1 | 4 /* Backtrack.bracket */)), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/, false, undefined, undefined, 3 | 16 /* Backtrack.link */))])), ([params, content = []], rest, context) => {
3238
- if (content.length !== 0 && (0, visibility_1.trimNodeEnd)(content = (0, dom_1.defrag)(content)).length === 0) return;
3239
- return [[parse(content, params, context)], rest];
3240
- })))));
3241
- exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.constraint)(16 /* State.link */ | 8 /* State.media */, false, (0, combinator_1.syntax)(1, 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])))));
3240
+ exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'], (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.constraint)(8 /* State.link */, false, (0, combinator_1.syntax)(1, 251 /* State.linkers */ | 4 /* 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], [']', 1]])), ']', true, undefined, undefined, 1 | 4 /* Backtrack.bracket */)), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/, false, undefined, undefined, 3 | 16 /* Backtrack.link */))])), ([params, content = []], rest, context) => {
3241
+ if (content.length !== 0 && (0, visibility_1.trimBlankNodeEnd)(content).length === 0) return;
3242
+ return [[parse((0, dom_1.defrag)(content), params, context)], rest];
3243
+ }))))));
3244
+ exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'], (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.constraint)(8 /* State.link */ | 4 /* State.media */, false, (0, combinator_1.syntax)(1, 251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.reverse)((0, combinator_1.sequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.union)([inline_1.media, inline_1.shortmedia]), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))])), ([params, content = []], rest, context) => [[parse((0, dom_1.defrag)(content), params, context)], rest]))))));
3242
3245
  exports.linemedialink = (0, combinator_1.surround)(source_1.linebreak, (0, combinator_1.union)([exports.medialink]), /^(?=[^\S\n]*(?:$|\n))/);
3243
3246
  exports.unsafelink = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.precedence)(1, (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]))));
3244
3247
  exports.uri = (0, combinator_1.union)([(0, combinator_1.open)(/^[^\S\n]+/, (0, source_1.str)(/^\S+/)), (0, source_1.str)(/^[^\s{}]+/)]);
@@ -3382,8 +3385,8 @@ const row = (0, combinator_1.lazy)(() => (0, combinator_1.dup)((0, combinator_1.
3382
3385
  const alignment = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)/;
3383
3386
  const align = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.union)([(0, source_1.str)(alignment)]), ([s]) => s.split('/').map(s => s.split(''))));
3384
3387
  const delimiter = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|^[#:](?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/;
3385
- const head = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.medialink, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.media, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.shortmedia, /^\s*$/)), (0, combinator_1.open)(/^(?:\s*\n|\s)/, (0, visibility_1.visualize)((0, visibility_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => [(0, dom_1.html)('th', attributes(ns.shift()), (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]), false);
3386
- const data = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.medialink, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.media, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.shortmedia, /^\s*$/)), (0, combinator_1.open)(/^(?:\s*\n|\s)/, (0, visibility_1.visualize)((0, util_1.lineable)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => [(0, dom_1.html)('td', attributes(ns.shift()), (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]), false);
3388
+ const head = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.medialink, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.media, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.shortmedia, /^\s*$/)), (0, combinator_1.open)(/^(?:\s*\n|\s)/, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => [(0, dom_1.html)('th', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false);
3389
+ const data = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.medialink, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.media, /^\s*$/)), (0, combinator_1.block)((0, combinator_1.surround)(/^[^\n]/, inline_1.shortmedia, /^\s*$/)), (0, combinator_1.open)(/^(?:\s*\n|\s)/, (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, util_1.lineable)((0, combinator_1.some)(inline_1.inline)))), true)])), true), ns => [(0, dom_1.html)('td', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false);
3387
3390
  const dataline = (0, combinator_1.line)((0, combinator_1.rewrite)(source_1.contentline, (0, combinator_1.union)([(0, combinator_1.validate)(/^!+\s/, (0, combinator_1.convert)(source => `:${source}`, data)), (0, combinator_1.convert)(source => `: ${source}`, data)])));
3388
3391
  function attributes(source) {
3389
3392
  let [, rowspan = undefined, colspan = undefined, highlight = undefined, extension = undefined] = source.match(/^[#:](?:(\d+)?:(\d+)?)?(?:(!+)([+]?))?$/) ?? [];
@@ -3944,7 +3947,7 @@ exports.escsource = (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, ({
3944
3947
  case '\r':
3945
3948
  context.resources && ++context.resources.clock;
3946
3949
  return [[], source.slice(1)];
3947
- case '\x1B':
3950
+ case "\u001B" /* Command.Escape */:
3948
3951
  return [[source.slice(1, 2)], source.slice(2)];
3949
3952
  case '\\':
3950
3953
  switch (source[1]) {
@@ -3991,7 +3994,7 @@ const dom_1 = __webpack_require__(394);
3991
3994
  対象をURLで指定すべき(引用ツリーにルートを追加する)場合はない
3992
3995
  対象と引用は1:N(分割)、N:1(統合)のみ可能、N:N(混合)は不可能
3993
3996
  */
3994
- exports.reply = (0, combinator_1.block)((0, combinator_1.validate)('>', (0, combinator_1.fmap)((0, combinator_1.inits)([(0, combinator_1.some)((0, combinator_1.inits)([cite_1.cite, quote_1.quote])), (0, combinator_1.some)((0, combinator_1.subsequence)([(0, combinator_1.some)(quote_1.quote), (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, quote_1.syntax), (0, visibility_1.visualize)((0, util_1.lineable)((0, combinator_1.some)(inline_1.inline)))), ns => (0, array_1.push)(ns, [(0, dom_1.html)('br')]))]))]), ns => [(0, dom_1.html)('p', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))])));
3997
+ exports.reply = (0, combinator_1.block)((0, combinator_1.validate)('>', (0, combinator_1.fmap)((0, combinator_1.inits)([(0, combinator_1.some)((0, combinator_1.inits)([cite_1.cite, quote_1.quote])), (0, combinator_1.some)((0, combinator_1.subsequence)([(0, combinator_1.some)(quote_1.quote), (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, quote_1.syntax), (0, visibility_1.visualize)((0, util_1.lineable)((0, combinator_1.some)(inline_1.inline)))), ns => (0, array_1.push)(ns, [(0, dom_1.html)('br')]))]))]), ns => [(0, dom_1.html)('p', (0, visibility_1.trimBlankNodeEnd)((0, dom_1.defrag)(ns)))])));
3995
3998
 
3996
3999
  /***/ },
3997
4000
 
@@ -4089,7 +4092,7 @@ exports.MAX_SEGMENT_SIZE = 100_000; // 100,000 bytes (Max value size of FDB)
4089
4092
  exports.MAX_INPUT_SIZE = exports.MAX_SEGMENT_SIZE * 10;
4090
4093
  const parser = (0, combinator_1.union)([heading_1.segment, codeblock_1.segment, mathblock_1.segment, extension_1.segment, (0, combinator_1.some)(source_1.contentline, exports.MAX_SEGMENT_SIZE * 2), (0, combinator_1.some)(source_1.emptyline, exports.MAX_SEGMENT_SIZE * 2)]);
4091
4094
  function* segment(source) {
4092
- if (!validate(source, exports.MAX_INPUT_SIZE)) return yield `\x07Too large input over ${exports.MAX_INPUT_SIZE.toLocaleString('en')} bytes.\n${source.slice(0, 1001)}`;
4095
+ if (!validate(source, exports.MAX_INPUT_SIZE)) return yield `${"\u0007" /* Command.Error */}Too large input over ${exports.MAX_INPUT_SIZE.toLocaleString('en')} bytes.\n${source.slice(0, 1001)}`;
4093
4096
  while (source !== '') {
4094
4097
  const result = parser({
4095
4098
  source,
@@ -4099,7 +4102,7 @@ function* segment(source) {
4099
4102
  const segs = (0, parser_1.eval)(result).length ? (0, parser_1.eval)(result) : [source.slice(0, source.length - rest.length)];
4100
4103
  for (let i = 0; i < segs.length; ++i) {
4101
4104
  const seg = segs[i];
4102
- validate(seg, exports.MAX_SEGMENT_SIZE) ? yield seg : yield `\x07Too large segment over ${exports.MAX_SEGMENT_SIZE.toLocaleString('en')} bytes.\n${seg}`;
4105
+ validate(seg, exports.MAX_SEGMENT_SIZE) ? yield seg : yield `${"\u0007" /* Command.Error */}Too large segment over ${exports.MAX_SEGMENT_SIZE.toLocaleString('en')} bytes.\n${seg}`;
4103
4106
  }
4104
4107
  source = rest;
4105
4108
  }
@@ -4286,9 +4289,9 @@ const combinator_1 = __webpack_require__(3484);
4286
4289
  const inline_1 = __webpack_require__(7973);
4287
4290
  const visibility_1 = __webpack_require__(6364);
4288
4291
  const dom_1 = __webpack_require__(394);
4289
- exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.surround)('((', (0, combinator_1.constraint)(256 /* State.annotation */, false, (0, combinator_1.syntax)(1, 256 /* State.annotation */ | 8 /* State.media */, (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[/^\\?\n/, 9], [')', 1]])))), '))', false, ([, ns], rest) => [[(0, dom_1.html)('sup', {
4292
+ exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.surround)('((', (0, combinator_1.constraint)(128 /* State.annotation */, false, (0, combinator_1.syntax)(1, 128 /* State.annotation */ | 4 /* State.media */, (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [['\n', 9], [')', 1]])))), '))', false, ([, ns], rest) => (0, visibility_1.trimBlankNodeEnd)(ns).length > 0 ? [[(0, dom_1.html)('sup', {
4290
4293
  class: 'annotation'
4291
- }, [(0, dom_1.html)('span', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))])], rest], undefined, 1 | 4 /* Backtrack.bracket */)));
4294
+ }, [(0, dom_1.html)('span', (0, dom_1.defrag)(ns))])], rest] : undefined, undefined, 1 | 4 /* Backtrack.bracket */)));
4292
4295
 
4293
4296
  /***/ },
4294
4297
 
@@ -4330,9 +4333,11 @@ const link_1 = __webpack_require__(3628);
4330
4333
  const source_1 = __webpack_require__(8745);
4331
4334
  const dom_1 = __webpack_require__(394);
4332
4335
  // https://example/@user must be a user page or a redirect page going there.
4333
- exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1 /* State.shortcut */, false, (0, combinator_1.open)('@', (0, combinator_1.tails)([(0, source_1.str)(/^[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?)*\//i), (0, source_1.str)(/^[a-z][0-9a-z]*(?:[-.][0-9a-z]+)*/i)]))), (0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1).replace('/', '/@')}` : `/${source}`} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
4336
+ exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)('@', (0, combinator_1.tails)([(0, source_1.str)(/^[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?)*\//i), (0, source_1.str)(/^[a-z][0-9a-z]*(?:[-.][0-9a-z]+)*/i)])), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, false, (0, combinator_1.syntax)(0, 1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `https://${source.slice(1).replace('/', '/@')}` : `/${source}`} }`, link_1.unsafelink), ([el]) => [(0, dom_1.define)(el, {
4334
4337
  class: 'account'
4335
- })]));
4338
+ })]))), ({
4339
+ source
4340
+ }) => [[source], '']])));
4336
4341
 
4337
4342
  /***/ },
4338
4343
 
@@ -4634,11 +4639,11 @@ const dom_1 = __webpack_require__(394);
4634
4639
  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)([
4635
4640
  // All parsers which can include closing terms.
4636
4641
  (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, {})));
4637
- exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:\w+\s+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.sequence)([label_1.label, (0, source_1.str)(/^(?=\s).*\n/)])), (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([ulist_1.ulist, olist_1.olist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, example_1.example, table_2.table, blockquote_1.blockquote, placeholder_1.placeholder, (0, combinator_1.line)(inline_1.media), (0, combinator_1.line)(inline_1.shortmedia)])), source_1.emptyline, (0, combinator_1.block)((0, visibility_1.visualize)((0, visibility_1.trimBlankStart)((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', {
4642
+ exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:\w+\s+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.sequence)([label_1.label, (0, source_1.str)(/^(?=\s).*\n/)])), (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([ulist_1.ulist, olist_1.olist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, example_1.example, table_2.table, blockquote_1.blockquote, placeholder_1.placeholder, (0, combinator_1.line)(inline_1.media), (0, combinator_1.line)(inline_1.shortmedia)])), source_1.emptyline, (0, combinator_1.block)((0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))))])])), ([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', {
4638
4643
  class: 'figindex'
4639
4644
  }), (0, dom_1.html)('span', {
4640
4645
  class: 'figtext'
4641
- }, (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(caption)))]), (0, dom_1.html)('div', [content])])])), (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})(?:figure|\[?\$\S*)(?!\S)[^\n]*(?:$|\n)/, 300), ([body, overflow, closer, opener, delim], _, context) => [(0, dom_1.html)('pre', {
4646
+ }, (0, dom_1.defrag)(caption))]), (0, dom_1.html)('div', [content])])])), (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})(?:figure|\[?\$\S*)(?!\S)[^\n]*(?:$|\n)/, 300), ([body, overflow, closer, opener, delim], _, context) => [(0, dom_1.html)('pre', {
4642
4647
  class: 'invalid',
4643
4648
  translate: 'no',
4644
4649
  'data-invalid-syntax': 'figure',
@@ -4828,7 +4833,7 @@ const inline_1 = __webpack_require__(7973);
4828
4833
  const util_1 = __webpack_require__(4992);
4829
4834
  const visibility_1 = __webpack_require__(6364);
4830
4835
  const dom_1 = __webpack_require__(394);
4831
- exports.paragraph = (0, combinator_1.block)((0, combinator_1.fmap)((0, visibility_1.visualize)((0, util_1.lineable)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline])))), ns => [(0, dom_1.html)('p', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]));
4836
+ exports.paragraph = (0, combinator_1.block)((0, combinator_1.fmap)((0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, util_1.lineable)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), ns => [(0, dom_1.html)('p', (0, dom_1.defrag)(ns))]));
4832
4837
 
4833
4838
  /***/ },
4834
4839
 
@@ -4957,7 +4962,7 @@ const array_1 = __webpack_require__(6876);
4957
4962
  const dom_1 = __webpack_require__(394);
4958
4963
  exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.surround)('{{', (0, combinator_1.syntax)(1, -1 /* State.all */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), '}}', true, ([, ns = []], rest) => [[(0, dom_1.html)('span', {
4959
4964
  class: 'template'
4960
- }, `{{${ns.join('').replace(/\x1B/g, '')}}}`)], rest], undefined, 3 | 28 /* Backtrack.template */)));
4965
+ }, `{{${ns.join('')}}}`)], rest], undefined, 3 | 28 /* Backtrack.template */)));
4961
4966
  const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(0, 6 /* Recursion.terminal */, (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], 3 | 28 /* Backtrack.template */), (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], 3 | 28 /* Backtrack.template */), (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], 3 | 28 /* Backtrack.template */), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.some)(source_1.escsource, /^"|^\\?\n/)), (0, source_1.str)('"'), true, undefined, undefined, 3 | 28 /* Backtrack.template */)])));
4962
4967
 
4963
4968
  /***/ },
@@ -5005,7 +5010,7 @@ exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, comb
5005
5010
  class: 'paren'
5006
5011
  }, (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, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (0, source_1.str)(']'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest], 3 | 4 /* Backtrack.bracket */), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.creation)(0, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (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, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest], 3 | 4 /* Backtrack.bracket */), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.creation)(0, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]),
5007
5012
  // 改行禁止はバックトラックなしでは内側の構文を破壊するため安易に行えない。
5008
- (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.creation)(0, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '"', [[/^\\?\n/, 9], ['"', 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, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '”', [[/^\\?\n/, 9], ['”', 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, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '’', [[/^\\?\n/, 9], ['’', 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, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '」', [[/^\\?\n/, 9], ['」', 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, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '』', [[/^\\?\n/, 9], ['』', 2]]))), (0, source_1.str)('』'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest])]));
5013
+ (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.creation)(0, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '"', [['\n', 9], ['"', 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, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '”', [['\n', 9], ['”', 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, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '’', [['\n', 9], ['’', 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, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '」', [['\n', 9], ['」', 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, 5 /* Recursion.bracket */, (0, combinator_1.syntax)(2, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '』', [['\n', 9], ['』', 2]]))), (0, source_1.str)('』'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest])]));
5009
5014
 
5010
5015
  /***/ },
5011
5016
 
@@ -5057,15 +5062,16 @@ const hashtag_1 = __webpack_require__(5764);
5057
5062
  const util_1 = __webpack_require__(4992);
5058
5063
  const dom_1 = __webpack_require__(394);
5059
5064
  // https://example/@user?ch=a+b must be a user channel page or a redirect page going there.
5060
- exports.channel = (0, combinator_1.validate)('@', (0, combinator_1.bind)((0, combinator_1.sequence)([account_1.account, (0, combinator_1.some)(hashtag_1.hashtag)]), (es, rest) => {
5065
+ exports.channel = (0, combinator_1.validate)('@', (0, combinator_1.constraint)(1 /* State.autolink */, false, (0, combinator_1.bind)((0, combinator_1.sequence)([account_1.account, (0, combinator_1.some)(hashtag_1.hashtag)]), (es, rest) => {
5061
5066
  const source = (0, util_1.stringify)(es);
5062
5067
  const el = es[0];
5068
+ if (typeof el === 'string') return [es, rest];
5063
5069
  const url = `${el.getAttribute('href')}?ch=${source.slice(source.indexOf('#') + 1).replace(/#/g, '+')}`;
5064
5070
  return [[(0, dom_1.define)(el, {
5065
5071
  class: 'channel',
5066
5072
  href: url
5067
5073
  }, source)], rest];
5068
- }));
5074
+ })));
5069
5075
 
5070
5076
  /***/ },
5071
5077
 
@@ -5085,14 +5091,14 @@ const indexee_1 = __webpack_require__(7610);
5085
5091
  const source_1 = __webpack_require__(8745);
5086
5092
  const visibility_1 = __webpack_require__(6364);
5087
5093
  const dom_1 = __webpack_require__(394);
5088
- exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[#', (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)('[#', (0, combinator_1.constraint)(64 /* State.index */, false, (0, combinator_1.syntax)(1, 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], [']', 1]])))), ']', false, ([, ns], rest) => [[(0, dom_1.html)('a', {
5094
+ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[#', (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)('[#', (0, combinator_1.constraint)(32 /* State.index */, false, (0, combinator_1.syntax)(1, 251 /* State.linkers */ | 4 /* State.media */, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.inits)([inline_1.inline, exports.signature]), ']', [['\n', 9], [']', 1]])))), ']', false, ([, ns], rest) => (0, visibility_1.trimBlankNodeEnd)(ns).length > 0 ? [[(0, dom_1.html)('a', {
5089
5095
  'data-index': dataindex(ns)
5090
- }, (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))], rest], undefined, 1 | 4 /* Backtrack.bracket */)), ([el]) => [(0, dom_1.define)(el, {
5096
+ }, (0, dom_1.defrag)(ns))], rest] : undefined, undefined, 1 | 4 /* Backtrack.bracket */)), ([el]) => [(0, dom_1.define)(el, {
5091
5097
  id: el.id ? null : undefined,
5092
5098
  class: 'index',
5093
5099
  href: el.id ? `#${el.id}` : undefined
5094
5100
  })]))));
5095
- exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|', (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (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', {
5101
+ exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|', (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.fmap)((0, combinator_1.open)(/^\|(?!\\?\s)/, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ']')), ns => [(0, dom_1.html)('span', {
5096
5102
  class: 'indexer',
5097
5103
  'data-index': (0, indexee_1.identity)('index', undefined, ns.join('')).slice(7)
5098
5104
  })]))));
@@ -5354,7 +5360,7 @@ const source_1 = __webpack_require__(8745);
5354
5360
  const visibility_1 = __webpack_require__(6364);
5355
5361
  const array_1 = __webpack_require__(6876);
5356
5362
  const dom_1 = __webpack_require__(394);
5357
- exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, 4 /* Recursion.inline */, (0, combinator_1.surround)((0, source_1.str)('==', '='), (0, combinator_1.constraint)(4 /* State.mark */, false, (0, combinator_1.syntax)(0, 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)('==')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '='), exports.mark)]))))), (0, source_1.str)('=='), false, ([, bs], rest, {
5363
+ exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, 4 /* Recursion.inline */, (0, combinator_1.surround)((0, source_1.str)('==', '='), (0, combinator_1.constraint)(2 /* State.mark */, false, (0, combinator_1.syntax)(0, 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)('==')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '='), exports.mark)]))))), (0, source_1.str)('=='), false, ([, bs], rest, {
5358
5364
  id
5359
5365
  }) => {
5360
5366
  const el = (0, dom_1.html)('mark', (0, dom_1.defrag)(bs));
@@ -5422,7 +5428,7 @@ exports.text = (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, ({
5422
5428
  case '\r':
5423
5429
  context.resources && ++context.resources.clock;
5424
5430
  return [[], source.slice(1)];
5425
- case '\x1B':
5431
+ case "\u001B" /* Command.Escape */:
5426
5432
  case '\\':
5427
5433
  switch (source[1]) {
5428
5434
  case undefined:
@@ -5477,7 +5483,7 @@ class Delimiters {
5477
5483
  constructor() {
5478
5484
  this.registry = (0, memoize_1.memoize)(() => []);
5479
5485
  this.delimiters = [];
5480
- this.order = [];
5486
+ this.stack = [];
5481
5487
  this.states = [];
5482
5488
  }
5483
5489
  static signature(pattern) {
@@ -5494,9 +5500,9 @@ class Delimiters {
5494
5500
  const {
5495
5501
  registry,
5496
5502
  delimiters,
5497
- order
5503
+ stack
5498
5504
  } = this;
5499
- // 構文数x優先順位数以下
5505
+ // シグネチャ数以下
5500
5506
 
5501
5507
  for (let i = 0; i < delims.length; ++i) {
5502
5508
  const {
@@ -5504,9 +5510,9 @@ class Delimiters {
5504
5510
  matcher,
5505
5511
  precedence
5506
5512
  } = delims[i];
5507
- const stack = registry(signature);
5508
- const index = stack[0]?.index ?? delimiters.length;
5509
- if (stack.length === 0 || precedence > delimiters[index].precedence) {
5513
+ const memory = registry(signature);
5514
+ const index = memory[0]?.index ?? delimiters.length;
5515
+ if (memory.length === 0 || precedence > delimiters[index].precedence) {
5510
5516
  const delimiter = {
5511
5517
  index,
5512
5518
  signature,
@@ -5515,10 +5521,10 @@ class Delimiters {
5515
5521
  state: true
5516
5522
  };
5517
5523
  delimiters[index] = delimiter;
5518
- stack.push(delimiter);
5519
- order.push(index);
5524
+ memory.push(delimiter);
5525
+ stack.push(index);
5520
5526
  } else {
5521
- order.push(-1);
5527
+ stack.push(-1);
5522
5528
  }
5523
5529
  // 現状各優先順位は固定
5524
5530
  }
@@ -5527,18 +5533,18 @@ class Delimiters {
5527
5533
  const {
5528
5534
  registry,
5529
5535
  delimiters,
5530
- order
5536
+ stack
5531
5537
  } = this;
5532
5538
  for (let i = 0; i < count; ++i) {
5533
- const index = order.pop();
5539
+ const index = stack.pop();
5534
5540
  if (index === -1) continue;
5535
- const stack = registry(delimiters[index].signature);
5536
- if (stack.length === 1) {
5537
- stack.pop();
5541
+ const memory = registry(delimiters[index].signature);
5542
+ if (memory.length === 1) {
5543
+ memory.pop();
5538
5544
  delimiters.pop();
5539
5545
  } else {
5540
- stack.pop();
5541
- delimiters[index] = stack.at(-1);
5546
+ memory.pop();
5547
+ delimiters[index] = memory.at(-1);
5542
5548
  }
5543
5549
  }
5544
5550
  }
@@ -5713,14 +5719,15 @@ function precedence(precedence, parser) {
5713
5719
  delimiters,
5714
5720
  precedence: p = 0
5715
5721
  } = context;
5716
- const shift = precedence > p;
5722
+ const shift = delimiters && precedence > p;
5717
5723
  context.precedence = precedence;
5718
- shift && delimiters?.shift(precedence);
5724
+ // デリミタはシフト後に設定しなければならない
5725
+ shift && delimiters.shift(precedence);
5719
5726
  const result = parser({
5720
5727
  source,
5721
5728
  context
5722
5729
  });
5723
- shift && delimiters?.unshift();
5730
+ shift && delimiters.unshift();
5724
5731
  context.precedence = p;
5725
5732
  return result;
5726
5733
  };
@@ -5806,9 +5813,11 @@ const dom_1 = __webpack_require__(394);
5806
5813
  // https://example/hashtags/a must be a hashtag page or a redirect page going there.
5807
5814
  // https://github.com/tc39/proposal-regexp-unicode-property-escapes#matching-emoji
5808
5815
  exports.emoji = String.raw`\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F`;
5809
- exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1 /* State.shortcut */, false, (0, combinator_1.open)('#', (0, source_1.str)(new RegExp([/^(?!['_])(?=(?:[0-9]{1,9})?(?:[^\d\p{C}\p{S}\p{P}\s]|emoji|'|_(?=[^\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|'))+/u.source].join('').replace(/emoji/g, exports.emoji), 'u')))), (0, combinator_1.convert)(source => `[${source}]{ ${`/hashtags/${source.slice(1)}`} }`, (0, combinator_1.union)([link_1.unsafelink]))), ([el]) => [(0, dom_1.define)(el, {
5816
+ exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, source_1.str)(new RegExp([/^(?!['_])(?=(?:[0-9]{1,9})?(?:[^\d\p{C}\p{S}\p{P}\s]|emoji|'|_(?=[^\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|'))+/u.source].join('').replace(/emoji/g, exports.emoji), 'u'))), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, false, (0, combinator_1.syntax)(0, 1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${`/hashtags/${source.slice(1)}`} }`, link_1.unsafelink), ([el]) => [(0, dom_1.define)(el, {
5810
5817
  class: 'hashtag'
5811
- })]));
5818
+ })]))), ({
5819
+ source
5820
+ }) => [[source], '']])));
5812
5821
 
5813
5822
  /***/ },
5814
5823
 
@@ -5856,9 +5865,9 @@ function surround(opener, parser, closer, optional = false, f, g, log = 0) {
5856
5865
  } = context;
5857
5866
  for (let i = 0; i < source.length - mr_.length; ++i) {
5858
5867
  if (source[i] !== source[0]) break;
5859
- const j = source.length + offset - i;
5860
- if (!(j in logger)) continue;
5861
- if (logger[j] & 1 << (log >>> 2)) return;
5868
+ const pos = source.length + offset - i - 1;
5869
+ if (!(pos in logger)) continue;
5870
+ if (logger[pos] & 1 << (log >>> 2)) return;
5862
5871
  }
5863
5872
  }
5864
5873
  const res2 = mr_ !== '' ? parser({
@@ -5880,7 +5889,7 @@ function surround(opener, parser, closer, optional = false, f, g, log = 0) {
5880
5889
  logger = {},
5881
5890
  offset = 0
5882
5891
  } = context;
5883
- logger[source.length + offset] |= 1 << (log >>> 2);
5892
+ logger[source.length + offset - 1] |= 1 << (log >>> 2);
5884
5893
  }
5885
5894
  return rr ? f ? f([rl, rm, rr], rest, context) : [(0, array_1.push)((0, array_1.unshift)(rl, rm ?? []), rr), rest] : g ? g([rl, rm, mr_], rest, context) : undefined;
5886
5895
  };
@@ -5930,12 +5939,12 @@ const combinator_1 = __webpack_require__(3484);
5930
5939
  const source_1 = __webpack_require__(8745);
5931
5940
  const dom_1 = __webpack_require__(394);
5932
5941
  // https://html.spec.whatwg.org/multipage/input.html
5933
- exports.email = (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.rewrite)((0, combinator_1.verify)((0, source_1.str)(/^[0-9a-z](?:[_.+-](?=[0-9a-z])|[0-9a-z]){0,255}@[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?)*(?![0-9a-z])/i), ([source]) => source.length <= 255), ({
5942
+ exports.email = (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.rewrite)((0, combinator_1.verify)((0, source_1.str)(/^[0-9a-z](?:[_.+-](?=[0-9a-z])|[0-9a-z]){0,255}@[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?(?:\.[0-9a-z](?:(?:[0-9a-z]|-(?=[0-9a-z])){0,61}[0-9a-z])?)*(?![0-9a-z])/i), ([source]) => source.length <= 255), (0, combinator_1.constraint)(1 /* State.autolink */, false, (0, combinator_1.syntax)(0, 1 /* State.autolink */, ({
5934
5943
  source
5935
5944
  }) => [[(0, dom_1.html)('a', {
5936
5945
  class: 'email',
5937
5946
  href: `mailto:${source}`
5938
- }, source)], '']));
5947
+ }, source)], '']))));
5939
5948
 
5940
5949
  /***/ },
5941
5950
 
@@ -6053,7 +6062,7 @@ const combinator_1 = __webpack_require__(3484);
6053
6062
  const url_1 = __webpack_require__(2129);
6054
6063
  const media_1 = __webpack_require__(7478);
6055
6064
  const source_1 = __webpack_require__(8745);
6056
- exports.shortmedia = (0, combinator_1.rewrite)((0, combinator_1.constraint)(8 /* State.media */, false, (0, combinator_1.open)('!', url_1.url)), (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media])));
6065
+ exports.shortmedia = (0, combinator_1.rewrite)((0, combinator_1.constraint)(4 /* State.media */, false, (0, combinator_1.open)('!', url_1.url)), (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media])));
6057
6066
  exports.lineshortmedia = (0, combinator_1.open)(source_1.linebreak, (0, combinator_1.focus)(/^!https?:\/\/\S+(?=[^\S\n]*(?:$|\n))/, (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media]))));
6058
6067
 
6059
6068
  /***/ },
@@ -6199,7 +6208,7 @@ __exportStar(__webpack_require__(1311), exports);
6199
6208
  Object.defineProperty(exports, "__esModule", ({
6200
6209
  value: true
6201
6210
  }));
6202
- exports.trimNodeEnd = exports.trimBlankStart = exports.trimBlank = exports.isStartTightNodes = exports.isStartLooseNodes = exports.startTight = exports.blankWith = exports.visualize = exports.blank = void 0;
6211
+ exports.trimBlankNodeEnd = exports.trimBlankEnd = exports.trimBlankStart = exports.trimBlank = exports.isStartTightNodes = exports.isStartLooseNodes = exports.startTight = exports.blankWith = exports.visualize = exports.blank = void 0;
6203
6212
  const parser_1 = __webpack_require__(605);
6204
6213
  const combinator_1 = __webpack_require__(3484);
6205
6214
  const htmlentity_1 = __webpack_require__(470);
@@ -6213,7 +6222,7 @@ var blank;
6213
6222
  blank.start = new RegExp(/^(?:\\?[^\S\r\n]|&IHN;|<wbr[^\S\n]*>)+/.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`));
6214
6223
  })(blank || (exports.blank = blank = {}));
6215
6224
  function visualize(parser) {
6216
- return (0, combinator_1.union)([(0, combinator_1.convert)(source => source.replace(blank.line, line => line.replace(/[\\&<]/g, '\x1B$&')), (0, combinator_1.verify)(parser, (ns, rest) => !rest && hasVisible(ns))), (0, combinator_1.some)((0, combinator_1.union)([source_1.linebreak, source_1.unescsource]))]);
6225
+ return (0, combinator_1.union)([(0, combinator_1.convert)(source => source.replace(blank.line, line => line.replace(/[\\&<]/g, `${"\u001B" /* Command.Escape */}$&`)), (0, combinator_1.verify)(parser, (ns, rest) => !rest && hasVisible(ns))), (0, combinator_1.some)((0, combinator_1.union)([source_1.linebreak, source_1.unescsource]))]);
6217
6226
  }
6218
6227
  exports.visualize = visualize;
6219
6228
  function hasVisible(nodes) {
@@ -6272,7 +6281,7 @@ const isStartTight = (0, memoize_1.reduce)(({
6272
6281
  }
6273
6282
  }, ({
6274
6283
  source
6275
- }, except = '') => `${source}\x1E${except}`);
6284
+ }, except = '') => `${source}${"\u001F" /* Command.Separator */}${except}`);
6276
6285
  function isStartLooseNodes(nodes) {
6277
6286
  if (nodes.length === 0) return true;
6278
6287
  for (let i = 0; i < nodes.length; ++i) {
@@ -6324,12 +6333,13 @@ function trimBlankStart(parser) {
6324
6333
  }
6325
6334
  exports.trimBlankStart = trimBlankStart;
6326
6335
  function trimBlankEnd(parser) {
6327
- return (0, combinator_1.fmap)(parser, trimNodeEnd);
6336
+ return (0, combinator_1.fmap)(parser, trimBlankNodeEnd);
6328
6337
  }
6329
- //export function trimNode<T extends HTMLElement | string>(nodes: T[]): T[] {
6330
- // return trimNodeStart(trimNodeEnd(nodes));
6338
+ exports.trimBlankEnd = trimBlankEnd;
6339
+ //export function trimBlankNode<T extends HTMLElement | string>(nodes: T[]): T[] {
6340
+ // return trimBlankNodeStart(trimBlankNodeEnd(nodes));
6331
6341
  //}
6332
- //function trimNodeStart<T extends HTMLElement | string>(nodes: T[]): T[] {
6342
+ //function trimBlankNodeStart<T extends HTMLElement | string>(nodes: T[]): T[] {
6333
6343
  // for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes[0], 0);) {
6334
6344
  // if (typeof node === 'string') {
6335
6345
  // const pos = node.trimStart().length;
@@ -6345,13 +6355,13 @@ function trimBlankEnd(parser) {
6345
6355
  // }
6346
6356
  // return nodes;
6347
6357
  //}
6348
- function trimNodeEnd(nodes) {
6358
+ function trimBlankNodeEnd(nodes) {
6349
6359
  const skip = nodes.length > 0 && typeof nodes.at(-1) === 'object' && nodes.at(-1)['className'] === 'indexer' ? [nodes.pop()] : [];
6350
6360
  for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes.at(-1), -1);) {
6351
6361
  if (typeof node === 'string') {
6352
- const pos = node.trimEnd().length;
6353
- if (pos > 0) {
6354
- nodes[nodes.length - 1] = node.slice(0, pos);
6362
+ const len = node.trimEnd().length;
6363
+ if (len > 0) {
6364
+ nodes[nodes.length - 1] = node.slice(0, len);
6355
6365
  break;
6356
6366
  }
6357
6367
  }
@@ -6359,7 +6369,7 @@ function trimNodeEnd(nodes) {
6359
6369
  }
6360
6370
  return (0, array_1.push)(nodes, skip);
6361
6371
  }
6362
- exports.trimNodeEnd = trimNodeEnd;
6372
+ exports.trimBlankNodeEnd = trimBlankNodeEnd;
6363
6373
 
6364
6374
  /***/ },
6365
6375
 
@@ -6458,8 +6468,8 @@ Object.defineProperty(exports, "__esModule", ({
6458
6468
  exports.example = void 0;
6459
6469
  const parser_1 = __webpack_require__(605);
6460
6470
  const combinator_1 = __webpack_require__(3484);
6461
- const parse_1 = __webpack_require__(3662);
6462
6471
  const mathblock_1 = __webpack_require__(4903);
6472
+ const parse_1 = __webpack_require__(3662);
6463
6473
  const dom_1 = __webpack_require__(394);
6464
6474
  const opener = /^(~{3,})(?:example\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/;
6465
6475
  exports.example = (0, combinator_1.creation)(0, 1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
@@ -6890,7 +6900,8 @@ exports.block = (0, combinator_1.reset)({
6890
6900
  }
6891
6901
  }, error((0, combinator_1.union)([source_1.emptyline, pagebreak_1.pagebreak, heading_1.heading, ulist_1.ulist, olist_1.olist, ilist_1.ilist, dlist_1.dlist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, extension_1.extension, sidefence_1.sidefence, blockquote_1.blockquote, mediablock_1.mediablock, reply_1.reply, paragraph_1.paragraph])));
6892
6902
  function error(parser) {
6893
- return (0, combinator_1.recover)((0, combinator_1.fallback)((0, combinator_1.open)('\x07', ({
6903
+ const reg = new RegExp(String.raw`^${"\u0007" /* Command.Error */}.*\n`);
6904
+ return (0, combinator_1.recover)((0, combinator_1.fallback)((0, combinator_1.open)("\u0007" /* Command.Error */, ({
6894
6905
  source
6895
6906
  }) => {
6896
6907
  throw new Error(source.split('\n', 1)[0]);
@@ -6905,7 +6916,7 @@ function error(parser) {
6905
6916
  }, reason instanceof Error ? `${reason.name}: ${reason.message}` : `UnknownError: ${reason}`), (0, dom_1.html)('pre', {
6906
6917
  class: 'error',
6907
6918
  translate: 'no'
6908
- }, source.replace(/^\x07.*\n/, '').slice(0, 1001).replace(/^(.{997}).{4}$/s, '$1...') || undefined)], '']);
6919
+ }, source.replace(reg, '').slice(0, 1001).replace(/^(.{997}).{4}$/s, '$1...') || undefined)], '']);
6909
6920
  }
6910
6921
 
6911
6922
  /***/ },
@@ -7009,6 +7020,7 @@ Object.defineProperty(exports, "__esModule", ({
7009
7020
  value: true
7010
7021
  }));
7011
7022
  exports.ruby = void 0;
7023
+ const context_1 = __webpack_require__(8669);
7012
7024
  const parser_1 = __webpack_require__(605);
7013
7025
  const combinator_1 = __webpack_require__(3484);
7014
7026
  const htmlentity_1 = __webpack_require__(470);
@@ -7016,7 +7028,7 @@ const source_1 = __webpack_require__(8745);
7016
7028
  const visibility_1 = __webpack_require__(6364);
7017
7029
  const array_1 = __webpack_require__(6876);
7018
7030
  const dom_1 = __webpack_require__(394);
7019
- exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.syntax)(1, -1 /* State.all */, (0, combinator_1.fmap)((0, combinator_1.sequence)([(0, combinator_1.bind)((0, combinator_1.surround)('[', (0, source_1.str)(/^(?:\\[^\n]|[^\\[\](){}"\n])+/), ']', false, undefined, undefined, 3 | 20 /* Backtrack.ruby */), ([source], rest, context) => {
7031
+ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.fmap)((0, combinator_1.syntax)(1, -1 /* State.all */, (0, combinator_1.sequence)([(0, combinator_1.bind)((0, combinator_1.surround)('[', (0, source_1.str)(/^(?:\\[^\n]|[^\\[\](){}"\n])+/), ']', false, undefined, undefined, 3 | 20 /* Backtrack.ruby */), ([source], rest, context) => {
7020
7032
  const ns = (0, parser_1.eval)(text({
7021
7033
  source,
7022
7034
  context
@@ -7029,7 +7041,7 @@ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0,
7029
7041
  context
7030
7042
  }), [undefined])[0];
7031
7043
  return ns && [[ns], rest];
7032
- })]), ([texts, rubies]) => {
7044
+ })])), ([texts, rubies]) => {
7033
7045
  switch (true) {
7034
7046
  case rubies.length <= texts.length:
7035
7047
  return [(0, dom_1.html)('ruby', attributes(texts, rubies), (0, dom_1.defrag)(texts.reduce((acc, _, i) => (0, array_1.push)(acc, (0, array_1.unshift)([texts[i]], i < rubies.length && rubies[i] ? [(0, dom_1.html)('rp', '('), (0, dom_1.html)('rt', rubies[i]), (0, dom_1.html)('rp', ')')] : [(0, dom_1.html)('rt')])), [])))];
@@ -7038,7 +7050,7 @@ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0,
7038
7050
  default:
7039
7051
  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', ')')])))];
7040
7052
  }
7041
- })))));
7053
+ }))));
7042
7054
  const text = (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, ({
7043
7055
  source,
7044
7056
  context
@@ -7083,8 +7095,8 @@ function attributes(texts, rubies) {
7083
7095
  let attrs;
7084
7096
  for (const ss of [texts, rubies]) {
7085
7097
  for (let i = 0; i < ss.length; ++i) {
7086
- if (!ss[i].includes('\x1B')) continue;
7087
- ss[i] = ss[i].replace(/\x1B/g, '');
7098
+ if (!ss[i].includes("\u001B" /* Command.Escape */)) continue;
7099
+ ss[i] = ss[i].replace(context_1.CmdRegExp.Escape, '');
7088
7100
  attrs ??= {
7089
7101
  class: 'invalid',
7090
7102
  'data-invalid-syntax': 'ruby',
@@ -7160,6 +7172,7 @@ Object.defineProperty(exports, "__esModule", ({
7160
7172
  value: true
7161
7173
  }));
7162
7174
  exports.linemedia = exports.media = void 0;
7175
+ const context_1 = __webpack_require__(8669);
7163
7176
  const combinator_1 = __webpack_require__(3484);
7164
7177
  const link_1 = __webpack_require__(3628);
7165
7178
  const html_1 = __webpack_require__(5013);
@@ -7176,7 +7189,7 @@ const optspec = {
7176
7189
  rel: undefined
7177
7190
  };
7178
7191
  Object.setPrototypeOf(optspec, null);
7179
- exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.open)('!', (0, combinator_1.constraint)(8 /* State.media */, false, (0, combinator_1.syntax)(1, ~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, undefined, undefined, 1 | 12 /* Backtrack.media */)), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), /^[^\S\n]*}/, false, undefined, undefined, 3 | 16 /* Backtrack.link */))]), ([as, bs]) => bs ? [[as.join('').trim() || as.join('')], bs] : [[''], as]), ([[text]]) => text === '' || text.trim() !== ''), ([[text], params], rest, context) => {
7192
+ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.open)('!', (0, combinator_1.constraint)(4 /* State.media */, false, (0, combinator_1.syntax)(1, ~8 /* 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, undefined, undefined, 1 | 12 /* Backtrack.media */)), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), /^[^\S\n]*}/, false, undefined, undefined, 3 | 16 /* Backtrack.link */))]), ([as, bs]) => bs ? [[as.join('').trim() || as.join('')], bs] : [[''], as]), ([[text]]) => text === '' || text.trim() !== ''), ([[text], params], rest, context) => {
7180
7193
  const INSECURE_URI = params.shift();
7181
7194
  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);
7182
7195
  let cache;
@@ -7192,7 +7205,7 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '
7192
7205
  if (el.hasAttribute('aspect-ratio')) {
7193
7206
  el.style.aspectRatio = el.getAttribute('aspect-ratio');
7194
7207
  }
7195
- if (context.state & 16 /* State.link */) return [[el], rest];
7208
+ if (context.state & 8 /* State.link */) return [[el], rest];
7196
7209
  if (cache && cache.tagName !== 'IMG') return [[el], rest];
7197
7210
  return (0, combinator_1.fmap)(link_1.unsafelink, ([link]) => [(0, dom_1.define)(link, {
7198
7211
  class: null,
@@ -7218,9 +7231,9 @@ function sanitize(target, uri, alt) {
7218
7231
  (0, util_1.markInvalid)(target, 'media', 'argument', 'Invalid protocol');
7219
7232
  return false;
7220
7233
  }
7221
- if (alt.includes('\x1B')) {
7234
+ if (alt.includes("\u001B" /* Command.Escape */)) {
7222
7235
  (0, dom_1.define)(target, {
7223
- alt: target.getAttribute('alt')?.replace(/\x1B/g, '')
7236
+ alt: target.getAttribute('alt')?.replace(context_1.CmdRegExp.Escape, '')
7224
7237
  });
7225
7238
  (0, util_1.markInvalid)(target, 'media', 'content', `Cannot use invalid HTML entitiy "${alt.match(/&[0-9A-Za-z]+;/)[0]}"`);
7226
7239
  return false;
@@ -7974,7 +7987,7 @@ const hashnum_1 = __webpack_require__(8684);
7974
7987
  const anchor_1 = __webpack_require__(8535);
7975
7988
  const source_1 = __webpack_require__(8745);
7976
7989
  const util_1 = __webpack_require__(4992);
7977
- 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)(0, ~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,
7990
+ exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/^(?:[@#>0-9a-z]|\S[#>]|[\r\n]!?https?:\/\/)/iu, (0, combinator_1.syntax)(0, ~1 /* State.autolink */, (0, combinator_1.union)([(0, combinator_1.some)((0, combinator_1.union)([url_1.lineurl])), (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([url_1.url, email_1.email,
7978
7991
  // Escape unmatched email-like strings.
7979
7992
  (0, source_1.str)(/^[0-9a-z]+(?:[_.+-][0-9a-z]+)*(?:@(?:[0-9a-z]+(?:[.-][0-9a-z]+)*)?)*/i), channel_1.channel, account_1.account,
7980
7993
  // Escape unmatched account-like strings.
@@ -7984,7 +7997,7 @@ exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/^(?:
7984
7997
  // Escape unmatched hashtag-like strings.
7985
7998
  (0, source_1.str)(new RegExp(/^#+(?:[^\p{C}\p{S}\p{P}\s]|emoji|['_])*/u.source.replace('emoji', hashtag_1.emoji), 'u')),
7986
7999
  // Escape invalid leading characters.
7987
- (0, source_1.str)(/^[0-9a-z](?=>)/iu), anchor_1.anchor])), ns => ns.length === 1 ? ns : [(0, util_1.stringify)(ns)])])))));
8000
+ (0, source_1.str)(/^[0-9a-z](?=>)/iu), anchor_1.anchor])), ns => ns.length === 1 ? ns : [(0, util_1.stringify)(ns)])]))));
7988
8001
 
7989
8002
  /***/ },
7990
8003
 
@@ -8156,6 +8169,8 @@ exports.unescsource = (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, ({
8156
8169
  case '\r':
8157
8170
  context.resources && ++context.resources.clock;
8158
8171
  return [[], source.slice(1)];
8172
+ case "\u001B" /* Command.Escape */:
8173
+ return [[source.slice(1, 2)], source.slice(2)];
8159
8174
  }
8160
8175
  const b = source[0] !== '\n' && source[0].trimStart() === '';
8161
8176
  const i = b || (0, text_1.isAlphanumeric)(source[0]) ? source.search(b ? text_1.nonWhitespace : text_1.nonAlphanumeric) || 1 : 1;
@@ -8188,9 +8203,11 @@ const dom_1 = __webpack_require__(394);
8188
8203
  // cid: YYYY-MMDD-HHMM-SSmmm
8189
8204
  // 内部表現はUnixTimeに統一する(時系列順)
8190
8205
  // 外部表現は投稿ごとに投稿者の投稿時のタイムゾーンに統一する(非時系列順)
8191
- exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('>>', (0, combinator_1.fmap)((0, combinator_1.constraint)(1 /* State.shortcut */, false, (0, combinator_1.focus)(/^>>(?:[a-z][0-9a-z]*(?:-[0-9a-z]+)*\/)?[0-9a-z]+(?:-[0-9a-z]+)*(?![0-9a-z@#:])/i, (0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `/@${source.slice(2).replace('/', '/timeline?at=')}` : `?at=${source.slice(2)}`} }`, (0, combinator_1.union)([link_1.unsafelink])))), ([el]) => [(0, dom_1.define)(el, {
8206
+ exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('>>', (0, combinator_1.focus)(/^>>(?:[a-z][0-9a-z]*(?:-[0-9a-z]+)*\/)?[0-9a-z]+(?:-[0-9a-z]+)*(?![0-9a-z@#:])/i, (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, false, (0, combinator_1.syntax)(0, 1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.includes('/') ? `/@${source.slice(2).replace('/', '/timeline?at=')}` : `?at=${source.slice(2)}`} }`, link_1.unsafelink), ([el]) => [(0, dom_1.define)(el, {
8192
8207
  class: 'anchor'
8193
- })])));
8208
+ })]))), ({
8209
+ source
8210
+ }) => [[source], '']]))));
8194
8211
 
8195
8212
  /***/ },
8196
8213
 
@@ -8438,6 +8455,22 @@ function potision(n) {
8438
8455
 
8439
8456
  /***/ },
8440
8457
 
8458
+ /***/ 8669
8459
+ (__unused_webpack_module, exports) {
8460
+
8461
+ "use strict";
8462
+
8463
+
8464
+ Object.defineProperty(exports, "__esModule", ({
8465
+ value: true
8466
+ }));
8467
+ exports.CmdRegExp = void 0;
8468
+ exports.CmdRegExp = {
8469
+ Escape: /\x1B/g
8470
+ };
8471
+
8472
+ /***/ },
8473
+
8441
8474
  /***/ 8673
8442
8475
  (__unused_webpack_module, exports, __webpack_require__) {
8443
8476
 
@@ -8478,10 +8511,12 @@ const link_1 = __webpack_require__(3628);
8478
8511
  const hashtag_1 = __webpack_require__(5764);
8479
8512
  const source_1 = __webpack_require__(8745);
8480
8513
  const dom_1 = __webpack_require__(394);
8481
- exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.constraint)(1 /* State.shortcut */, false, (0, combinator_1.open)('#', (0, source_1.str)(new RegExp(/^[0-9]{1,9}(?![^\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, {
8514
+ exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, source_1.str)(new RegExp(/^[0-9]{1,9}(?![^\p{C}\p{S}\p{P}\s]|emoji|['_])/u.source.replace(/emoji/, hashtag_1.emoji), 'u'))), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, false, (0, combinator_1.syntax)(0, 1 /* State.autolink */, (0, combinator_1.fmap)((0, combinator_1.convert)(source => `[${source}]{ ${source.slice(1)} }`, link_1.unsafelink), ([el]) => [(0, dom_1.define)(el, {
8482
8515
  class: 'hashnum',
8483
8516
  href: null
8484
- })]));
8517
+ })]))), ({
8518
+ source
8519
+ }) => [[source], '']])));
8485
8520
 
8486
8521
  /***/ },
8487
8522
 
@@ -8677,11 +8712,11 @@ const source_1 = __webpack_require__(8745);
8677
8712
  const memoize_1 = __webpack_require__(6925);
8678
8713
  const array_1 = __webpack_require__(6876);
8679
8714
  const dom_1 = __webpack_require__(394);
8680
- exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[%', (0, combinator_1.creation)(1, 4 /* Recursion.inline */, (0, combinator_1.syntax)(4, 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', {
8715
+ exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[%', (0, combinator_1.creation)(1, 4 /* Recursion.inline */, (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.syntax)(4, 0 /* State.none */, (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', {
8681
8716
  class: 'remark'
8682
8717
  }, [(0, dom_1.html)('input', {
8683
8718
  type: 'checkbox'
8684
- }), (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, {}))))));
8719
+ }), (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, {})))));
8685
8720
 
8686
8721
  /***/ },
8687
8722
 
@@ -8700,7 +8735,7 @@ const inline_1 = __webpack_require__(7973);
8700
8735
  const source_1 = __webpack_require__(8745);
8701
8736
  const visibility_1 = __webpack_require__(6364);
8702
8737
  const dom_1 = __webpack_require__(394);
8703
- exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.surround)('[[', (0, combinator_1.constraint)(128 /* State.reference */, false, (0, combinator_1.syntax)(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], [']', 1]]))]))), ']]', 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], undefined, 1 | 4 /* Backtrack.bracket */)));
8738
+ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (0, combinator_1.surround)('[[', (0, combinator_1.constraint)(64 /* State.reference */, false, (0, combinator_1.syntax)(1, 128 /* State.annotation */ | 64 /* State.reference */ | 4 /* State.media */, (0, combinator_1.subsequence)([abbr, (0, visibility_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, ']', [['\n', 9], [']', 1]]))]))), ']]', false, ([, ns], rest) => (0, visibility_1.trimBlankNodeEnd)(ns).length > 0 ? [[(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, dom_1.defrag)(ns))])], rest] : undefined, undefined, 1 | 4 /* Backtrack.bracket */)));
8704
8739
  // Chicago-Style
8705
8740
  const abbr = (0, combinator_1.creation)(1, 0 /* Recursion.ignore */, (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}`]));
8706
8741
  function attributes(ns) {