securemark 0.278.0 → 0.279.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.279.1
4
+
5
+ - Refactoring.
6
+
7
+ ## 0.279.0
8
+
9
+ - Change media syntax not to be included in inline syntax.
10
+
3
11
  ## 0.278.0
4
12
 
5
13
  - Extend account syntax.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! securemark v0.278.0 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
1
+ /*! securemark v0.279.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"));
@@ -2956,7 +2956,7 @@ function indent(opener, parser, separation = false) {
2956
2956
  if (typeof opener === 'function') return indent(/^([ \t])\1*/, opener, parser);
2957
2957
  return (0, bind_1.bind)((0, block_1.block)((0, match_1.match)(opener, (0, memoize_1.memoize)(([indent]) => (0, some_1.some)((0, line_1.line)((0, surround_1.open)(indent, ({
2958
2958
  source
2959
- }) => [[source], '']))), ([indent]) => indent.length * 2 + +(indent[0] === ' '), [])), separation), (lines, rest, context) => {
2959
+ }) => [[source], '']))), ([indent]) => indent.length * 2 + +(indent[0] === ' '), {})), separation), (lines, rest, context) => {
2960
2960
  context.offset ??= 0;
2961
2961
  context.offset += rest.length;
2962
2962
  const result = parser({
@@ -4350,6 +4350,7 @@ const mathblock_1 = __webpack_require__(3754);
4350
4350
  const extension_1 = __webpack_require__(4751);
4351
4351
  const sidefence_1 = __webpack_require__(4078);
4352
4352
  const blockquote_1 = __webpack_require__(7859);
4353
+ const mediablock_1 = __webpack_require__(785);
4353
4354
  const reply_1 = __webpack_require__(9978);
4354
4355
  const paragraph_1 = __webpack_require__(6457);
4355
4356
  const random_1 = __webpack_require__(7325);
@@ -4359,7 +4360,7 @@ exports.block = (0, combinator_1.creation)(1, false, error((0, combinator_1.rese
4359
4360
  clock: 50 * 1000,
4360
4361
  recursion: 20
4361
4362
  }
4362
- }, (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, reply_1.reply, paragraph_1.paragraph]))));
4363
+ }, (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]))));
4363
4364
  function error(parser) {
4364
4365
  return (0, combinator_1.recover)((0, combinator_1.fallback)((0, combinator_1.open)('\x07', ({
4365
4366
  source
@@ -4735,8 +4736,8 @@ const memoize_1 = __webpack_require__(1808);
4735
4736
  const dom_1 = __webpack_require__(3252);
4736
4737
  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)([
4737
4738
  // All parsers which can include closing terms.
4738
- (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, [])));
4739
- 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, combinator_1.state)(8 /* State.media */, (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', {
4739
+ (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, {})));
4740
+ 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', {
4740
4741
  class: 'figindex'
4741
4742
  }), (0, dom_1.html)('span', {
4742
4743
  class: 'figtext'
@@ -4857,6 +4858,7 @@ const codeblock_1 = __webpack_require__(1849);
4857
4858
  const mathblock_1 = __webpack_require__(3754);
4858
4859
  const sidefence_1 = __webpack_require__(4078);
4859
4860
  const blockquote_1 = __webpack_require__(7859);
4861
+ const mediablock_1 = __webpack_require__(785);
4860
4862
  const paragraph_1 = __webpack_require__(6457);
4861
4863
  const array_1 = __webpack_require__(8112);
4862
4864
  const dom_1 = __webpack_require__(3252);
@@ -4903,7 +4905,7 @@ function title(type) {
4903
4905
  }
4904
4906
  }
4905
4907
  // Must not have indexed blocks.
4906
- const content = (0, combinator_1.union)([source_1.emptyline, ulist_1.ulist, olist_1.olist, ilist_1.ilist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, sidefence_1.sidefence, blockquote_1.blockquote, paragraph_1.paragraph]);
4908
+ const content = (0, combinator_1.union)([source_1.emptyline, ulist_1.ulist, olist_1.olist, ilist_1.ilist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, sidefence_1.sidefence, blockquote_1.blockquote, mediablock_1.mediablock, paragraph_1.paragraph]);
4907
4909
 
4908
4910
  /***/ }),
4909
4911
 
@@ -4985,8 +4987,8 @@ const row = (0, combinator_1.lazy)(() => (0, combinator_1.dup)((0, combinator_1.
4985
4987
  const alignment = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)/;
4986
4988
  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(''))));
4987
4989
  const delimiter = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|^[#:](?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/;
4988
- const head = (0, combinator_1.creation)(1, false, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.open)(/^(?:\s*\n|\s)/, (0, visibility_1.visualize)((0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline])))), true)), true), ns => [(0, dom_1.html)('th', attributes(ns.shift()), (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]), false));
4989
- const data = (0, combinator_1.creation)(1, false, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.open)(/^(?:\s*\n|\s)/, (0, visibility_1.visualize)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))), true)), true), ns => [(0, dom_1.html)('td', attributes(ns.shift()), (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]), false));
4990
+ const head = (0, combinator_1.creation)(1, false, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.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));
4991
+ const data = (0, combinator_1.creation)(1, false, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.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, 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));
4990
4992
  const dataline = (0, combinator_1.creation)(1, false, (0, combinator_1.line)((0, combinator_1.rewrite)(source_1.contentline, (0, combinator_1.union)([(0, combinator_1.validate)(/^!+\s/, (0, combinator_1.convert)(source => `:${source}`, data)), (0, combinator_1.convert)(source => `: ${source}`, data)]))));
4991
4993
  function attributes(source) {
4992
4994
  let [, rowspan = undefined, colspan = undefined, highlight = undefined, extension = undefined] = source.match(/^[#:](?:(\d+)?:(\d+)?)?(?:(!+)([+]?))?$/) ?? [];
@@ -5237,8 +5239,8 @@ const ulist_1 = __webpack_require__(5425);
5237
5239
  const olist_1 = __webpack_require__(7471);
5238
5240
  const inline_1 = __webpack_require__(1160);
5239
5241
  const dom_1 = __webpack_require__(3252);
5240
- exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^[-+*](?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.state)(8 /* State.media */, exports.ilist_))));
5241
- exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^[-+*](?:$|\s)/, (0, combinator_1.some)((0, combinator_1.creation)(1, false, (0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/^[-+*](?:$|\s)/, (0, combinator_1.some)(inline_1.inline), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), olist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])])))), es => [(0, dom_1.html)('ul', {
5242
+ exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^[-+*](?=[^\S\n]|\n[^\S\n]*\S)/, exports.ilist_)));
5243
+ exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^[-+*](?:$|\s)/, (0, combinator_1.some)((0, combinator_1.creation)(1, false, (0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/^[-+*](?:$|\s)/, (0, combinator_1.some)(inline_1.inline), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), ulist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])])))), es => [(0, dom_1.html)('ul', {
5242
5244
  class: 'invalid',
5243
5245
  'data-invalid-syntax': 'list',
5244
5246
  'data-invalid-type': 'syntax',
@@ -5281,6 +5283,31 @@ exports.mathblock = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0,
5281
5283
 
5282
5284
  /***/ }),
5283
5285
 
5286
+ /***/ 785:
5287
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5288
+
5289
+ "use strict";
5290
+
5291
+
5292
+ Object.defineProperty(exports, "__esModule", ({
5293
+ value: true
5294
+ }));
5295
+ exports.mediablock = void 0;
5296
+ const combinator_1 = __webpack_require__(2087);
5297
+ const inline_1 = __webpack_require__(1160);
5298
+ const dom_1 = __webpack_require__(3252);
5299
+ exports.mediablock = (0, combinator_1.block)((0, combinator_1.validate)(['[!', '!'], (0, combinator_1.fmap)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.shortmedia])), (0, combinator_1.some)((0, combinator_1.line)((0, combinator_1.fallback)((0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.shortmedia]), ({
5300
+ source
5301
+ }) => [[(0, dom_1.html)('div', [(0, dom_1.html)('span', attrs, source.replace('\n', ''))])], ''])))]), ns => [(0, dom_1.html)('div', ns)])));
5302
+ const attrs = {
5303
+ class: 'invalid',
5304
+ 'data-invalid-syntax': 'mediablock',
5305
+ 'data-invalid-type': 'syntax',
5306
+ 'data-invalid-message': 'Not media syntax'
5307
+ };
5308
+
5309
+ /***/ }),
5310
+
5284
5311
  /***/ 7471:
5285
5312
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5286
5313
 
@@ -5290,13 +5317,12 @@ exports.mathblock = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0,
5290
5317
  Object.defineProperty(exports, "__esModule", ({
5291
5318
  value: true
5292
5319
  }));
5293
- exports.invalid = exports.olist_ = exports.olist = void 0;
5320
+ exports.olist_ = exports.olist = void 0;
5294
5321
  const combinator_1 = __webpack_require__(2087);
5295
5322
  const ulist_1 = __webpack_require__(5425);
5296
5323
  const ilist_1 = __webpack_require__(238);
5297
5324
  const inline_1 = __webpack_require__(1160);
5298
5325
  const index_1 = __webpack_require__(4479);
5299
- const source_1 = __webpack_require__(6743);
5300
5326
  const visibility_1 = __webpack_require__(7618);
5301
5327
  const memoize_1 = __webpack_require__(1808);
5302
5328
  const dom_1 = __webpack_require__(3252);
@@ -5304,12 +5330,12 @@ const openers = {
5304
5330
  '.': /^([0-9]+|[a-z]+|[A-Z]+)(?:-(?!-)[0-9]*)*(?![^\S\n])\.?(?:$|\s)/,
5305
5331
  '(': /^\(([0-9]*|[a-z]*)(?![^)\n])\)?(?:-(?!-)[0-9]*)*(?:$|\s)/
5306
5332
  };
5307
- exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(new RegExp([/^([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*\.(?=[^\S\n]|\n[^\S\n]*\S)/.source, /^\(([0-9]+|[a-z]+)\)(?:-[0-9]+)*(?=[^\S\n]|\n[^\S\n]*\S)/.source].join('|')), (0, combinator_1.state)(8 /* State.media */, exports.olist_))));
5333
+ exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(new RegExp([/^([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*\.(?=[^\S\n]|\n[^\S\n]*\S)/.source, /^\(([0-9]+|[a-z]+)\)(?:-[0-9]+)*(?=[^\S\n]|\n[^\S\n]*\S)/.source].join('|')), exports.olist_)));
5308
5334
  exports.olist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.match)(openers['.'], (0, memoize_1.memoize)(ms => list(type(ms[1]), '.'), ms => idx(ms[1]), [])), (0, combinator_1.match)(openers['('], (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => idx(ms[1]), []))])));
5309
5335
  const list = (type, form) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)(1, false, (0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(heads[form], (0, combinator_1.subsequence)([ulist_1.checkbox, (0, combinator_1.trim)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.close)((0, combinator_1.union)([index_1.index]), /^$/), ([el]) => [(0, dom_1.define)(el, {
5310
5336
  class: void el.classList.add('indexer'),
5311
5337
  'data-index': ''
5312
- })]), (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.indent)((0, combinator_1.union)([ulist_1.ulist_, exports.olist_, ilist_1.ilist_]))]), exports.invalid), ns => [(0, dom_1.html)('li', {
5338
+ })]), (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.indent)((0, combinator_1.union)([ulist_1.ulist_, exports.olist_, ilist_1.ilist_]))]), ulist_1.invalid), ns => [(0, dom_1.html)('li', {
5313
5339
  'data-marker': ns.shift() || undefined
5314
5340
  }, (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))]), true)]))), es => [format((0, dom_1.html)('ol', es), type, form)]);
5315
5341
  const heads = {
@@ -5320,16 +5346,6 @@ const heads = {
5320
5346
  source
5321
5347
  }) => [[source.trimEnd().replace(/^\($/, '(1)').replace(/^\((\w+)$/, '($1)')], ''])
5322
5348
  };
5323
- exports.invalid = (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.contentline, (0, combinator_1.indent)(({
5324
- source
5325
- }) => [[source], ''])]), ({
5326
- source
5327
- }) => [['', (0, dom_1.html)('span', {
5328
- class: 'invalid',
5329
- 'data-invalid-syntax': 'list',
5330
- 'data-invalid-type': 'syntax',
5331
- 'data-invalid-message': 'Fix the indent or the head of the list item'
5332
- }, source.replace('\n', ''))], '']);
5333
5349
  function idx(value) {
5334
5350
  switch (value) {
5335
5351
  case 'i':
@@ -5638,7 +5654,7 @@ const row = (parser, optional) => (0, combinator_1.creation)(1, false, (0, combi
5638
5654
  'data-invalid-message': 'Missing the start symbol of the table row'
5639
5655
  }, [(0, dom_1.html)('td', source.replace('\n', ''))])], ''])));
5640
5656
  const align = (0, combinator_1.creation)(1, false, (0, combinator_1.fmap)((0, combinator_1.open)('|', (0, combinator_1.union)([(0, combinator_1.focus)(/^:-+:/, () => [['center'], '']), (0, combinator_1.focus)(/^:-+/, () => [['start'], '']), (0, combinator_1.focus)(/^-+:/, () => [['end'], '']), (0, combinator_1.focus)(/^-+/, () => [[''], ''])])), ns => [(0, dom_1.html)('td', (0, dom_1.defrag)(ns))]));
5641
- const cell = (0, combinator_1.surround)(/^\|\s*(?=\S)/, (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /^\|/, [[/^[|\\]?\s*$/, 9]])), /^[^|]*/, true);
5657
+ 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);
5642
5658
  const head = (0, combinator_1.creation)(1, false, (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('th', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]));
5643
5659
  const data = (0, combinator_1.creation)(1, false, (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('td', (0, visibility_1.trimNodeEnd)((0, dom_1.defrag)(ns)))]));
5644
5660
  function format(rows) {
@@ -5666,25 +5682,36 @@ function format(rows) {
5666
5682
  Object.defineProperty(exports, "__esModule", ({
5667
5683
  value: true
5668
5684
  }));
5669
- exports.fillFirstLine = exports.checkbox = exports.ulist_ = exports.ulist = void 0;
5685
+ exports.fillFirstLine = exports.invalid = exports.checkbox = exports.ulist_ = exports.ulist = void 0;
5670
5686
  const combinator_1 = __webpack_require__(2087);
5671
5687
  const olist_1 = __webpack_require__(7471);
5672
5688
  const ilist_1 = __webpack_require__(238);
5673
5689
  const inline_1 = __webpack_require__(1160);
5674
5690
  const index_1 = __webpack_require__(4479);
5691
+ const source_1 = __webpack_require__(6743);
5675
5692
  const visibility_1 = __webpack_require__(7618);
5676
5693
  const array_1 = __webpack_require__(8112);
5677
5694
  const dom_1 = __webpack_require__(3252);
5678
- exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^-(?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.state)(8 /* State.media */, exports.ulist_))));
5695
+ exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^-(?=[^\S\n]|\n[^\S\n]*\S)/, exports.ulist_)));
5679
5696
  exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^-(?=$|\s)/, (0, combinator_1.some)((0, combinator_1.creation)(1, false, (0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/^-(?:$|\s)/, (0, combinator_1.subsequence)([exports.checkbox, (0, combinator_1.trim)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.close)((0, combinator_1.union)([index_1.index]), /^$/), ([el]) => [(0, dom_1.define)(el, {
5680
5697
  class: void el.classList.add('indexer'),
5681
5698
  'data-index': ''
5682
- })]), (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.indent)((0, combinator_1.union)([exports.ulist_, olist_1.olist_, ilist_1.ilist_]))]), olist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)(fillFirstLine(ns)))]), true)])))), es => [format((0, dom_1.html)('ul', es))])));
5699
+ })]), (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.indent)((0, combinator_1.union)([exports.ulist_, olist_1.olist_, ilist_1.ilist_]))]), exports.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)(fillFirstLine(ns)))]), true)])))), es => [format((0, dom_1.html)('ul', es))])));
5683
5700
  exports.checkbox = (0, combinator_1.creation)(1, false, (0, combinator_1.focus)(/^\[[xX ]\](?=$|\s)/, ({
5684
5701
  source
5685
5702
  }) => [[(0, dom_1.html)('span', {
5686
5703
  class: 'checkbox'
5687
5704
  }, source[1].trimStart() ? '☑' : '☐')], '']));
5705
+ exports.invalid = (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.contentline, (0, combinator_1.indent)(({
5706
+ source
5707
+ }) => [[source], ''])]), ({
5708
+ source
5709
+ }) => [['', (0, dom_1.html)('span', {
5710
+ class: 'invalid',
5711
+ 'data-invalid-syntax': 'list',
5712
+ 'data-invalid-type': 'syntax',
5713
+ 'data-invalid-message': 'Fix the indent or the head of the list item'
5714
+ }, source.replace('\n', ''))], '']);
5688
5715
  function fillFirstLine(ns) {
5689
5716
  return ns.length === 1 && typeof ns[0] === 'object' && ['UL', 'OL'].includes(ns[0].tagName) ? (0, array_1.unshift)([(0, dom_1.html)('br')], ns) : ns;
5690
5717
  }
@@ -5756,7 +5783,7 @@ const field = (0, combinator_1.line)(({
5756
5783
  Object.defineProperty(exports, "__esModule", ({
5757
5784
  value: true
5758
5785
  }));
5759
- exports.shortmedia = exports.media = exports.indexer = exports.indexee = exports.inline = void 0;
5786
+ exports.shortmedia = exports.media = exports.medialink = exports.indexer = exports.indexee = exports.inline = void 0;
5760
5787
  const combinator_1 = __webpack_require__(2087);
5761
5788
  const annotation_1 = __webpack_require__(2736);
5762
5789
  const reference_1 = __webpack_require__(3555);
@@ -5774,13 +5801,11 @@ const emstrong_1 = __webpack_require__(6132);
5774
5801
  const emphasis_1 = __webpack_require__(3867);
5775
5802
  const strong_1 = __webpack_require__(6578);
5776
5803
  const code_1 = __webpack_require__(5771);
5777
- const media_1 = __webpack_require__(1303);
5778
5804
  const htmlentity_1 = __webpack_require__(1562);
5779
- const shortmedia_1 = __webpack_require__(4189);
5780
5805
  const autolink_1 = __webpack_require__(6051);
5781
5806
  const bracket_1 = __webpack_require__(5196);
5782
5807
  const source_1 = __webpack_require__(6743);
5783
- exports.inline = (0, combinator_1.lazy)(() => (0, combinator_1.union)([annotation_1.annotation, reference_1.reference, template_1.template, remark_1.remark, math_1.math, extension_1.extension, ruby_1.ruby, link_1.textlink, link_1.linemedialink, media_1.linemedia, html_1.html, insertion_1.insertion, deletion_1.deletion, mark_1.mark, emstrong_1.emstrong, strong_1.strong, emphasis_1.emphasis, code_1.code, htmlentity_1.htmlentity, shortmedia_1.lineshortmedia, autolink_1.autolink, bracket_1.bracket, source_1.text]));
5808
+ exports.inline = (0, combinator_1.lazy)(() => (0, combinator_1.union)([annotation_1.annotation, reference_1.reference, template_1.template, remark_1.remark, math_1.math, extension_1.extension, ruby_1.ruby, link_1.textlink, html_1.html, insertion_1.insertion, deletion_1.deletion, mark_1.mark, emstrong_1.emstrong, strong_1.strong, emphasis_1.emphasis, code_1.code, htmlentity_1.htmlentity, autolink_1.autolink, bracket_1.bracket, source_1.text]));
5784
5809
  var indexee_1 = __webpack_require__(1269);
5785
5810
  Object.defineProperty(exports, "indexee", ({
5786
5811
  enumerable: true,
@@ -5795,18 +5820,25 @@ Object.defineProperty(exports, "indexer", ({
5795
5820
  return indexer_1.indexer;
5796
5821
  }
5797
5822
  }));
5798
- var media_2 = __webpack_require__(1303);
5823
+ var link_2 = __webpack_require__(9628);
5824
+ Object.defineProperty(exports, "medialink", ({
5825
+ enumerable: true,
5826
+ get: function () {
5827
+ return link_2.medialink;
5828
+ }
5829
+ }));
5830
+ var media_1 = __webpack_require__(1303);
5799
5831
  Object.defineProperty(exports, "media", ({
5800
5832
  enumerable: true,
5801
5833
  get: function () {
5802
- return media_2.media;
5834
+ return media_1.media;
5803
5835
  }
5804
5836
  }));
5805
- var shortmedia_2 = __webpack_require__(4189);
5837
+ var shortmedia_1 = __webpack_require__(4189);
5806
5838
  Object.defineProperty(exports, "shortmedia", ({
5807
5839
  enumerable: true,
5808
5840
  get: function () {
5809
- return shortmedia_2.shortmedia;
5841
+ return shortmedia_1.shortmedia;
5810
5842
  }
5811
5843
  }));
5812
5844
 
@@ -6047,9 +6079,9 @@ const dom_1 = __webpack_require__(3252);
6047
6079
  const index = /^[0-9A-Za-z]+(?:(?:[.-]|, )[0-9A-Za-z]+)*/;
6048
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', {
6049
6081
  class: 'paren'
6050
- }, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)([''], (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', {
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', {
6051
6083
  class: 'paren'
6052
- }, (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)([''], (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]),
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]),
6053
6085
  // Control media blinking in editing rather than control confusion of pairs of quote marks.
6054
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])]));
6055
6087
 
@@ -6331,10 +6363,10 @@ exports.indexer = void 0;
6331
6363
  const combinator_1 = __webpack_require__(2087);
6332
6364
  const index_1 = __webpack_require__(4479);
6333
6365
  const dom_1 = __webpack_require__(3252);
6334
- exports.indexer = (0, combinator_1.surround)(/^\s+\[(?=\|\S)/, (0, combinator_1.state)(64 /* State.index */, false, (0, combinator_1.union)([index_1.signature, (0, combinator_1.creation)((0, combinator_1.focus)(/^\|(?=\])/, () => [[(0, dom_1.html)('span', {
6366
+ exports.indexer = (0, combinator_1.surround)(/^\s+\[(?=\|\S)/, (0, combinator_1.union)([index_1.signature, (0, combinator_1.creation)((0, combinator_1.focus)(/^\|(?=\])/, () => [[(0, dom_1.html)('span', {
6335
6367
  class: 'indexer',
6336
6368
  'data-index': ''
6337
- })], '']))])), /^\]\s*$/);
6369
+ })], '']))]), /^\]\s*$/);
6338
6370
 
6339
6371
  /***/ }),
6340
6372
 
@@ -6432,7 +6464,7 @@ Object.setPrototypeOf(attrspecs, null);
6432
6464
  Object.values(attrspecs).forEach(o => Object.setPrototypeOf(o, null));
6433
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)(
6434
6466
  // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
6435
- (0, source_1.str)(/^<(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)(?=[^\S\n]|>)/i), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, source_1.str)(/^[^\S\n]*>/), true, ([as, bs = [], cs], rest) => [[elem(as[0].slice(1), (0, array_1.push)((0, array_1.unshift)(as, bs), cs), [], [])], rest]), (0, combinator_1.match)(new RegExp(String.raw`^<(${TAGS.join('|')})(?=[^\S\n]|>)`), (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${tag}`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^[^\S\n]*>/), true), (0, combinator_1.subsequence)([(0, combinator_1.focus)(/^[^\S\n]*\n/, (0, combinator_1.some)(inline_1.inline)), (0, combinator_1.some)((0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', `</${tag}>`), [[(0, visibility_1.blankWith)('\n', `</${tag}>`), 5]]), true))]), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], rest) => [[elem(tag, as, bs, cs)], rest], ([as, bs = []], rest) => [[elem(tag, as, bs, [])], rest]), ([, tag]) => TAGS.indexOf(tag), [])), (0, combinator_1.match)(/^<([a-z]+)(?=[^\S\n]|>)/i, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${tag}`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^[^\S\n]*>/), true), (0, combinator_1.subsequence)([(0, combinator_1.focus)(/^[^\S\n]*\n/, (0, combinator_1.some)(inline_1.inline)), (0, combinator_1.some)(inline_1.inline, `</${tag}>`, [[`</${tag}>`, 5]])]), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], rest) => [[elem(tag, as, bs, cs)], rest], ([as, bs = []], rest) => [[elem(tag, as, bs, [])], rest]), ([, tag]) => tag, new clock_1.Clock(10000)))])))));
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)))])))));
6436
6468
  exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="[^"\n]*")?(?=[^\S\n]|>)/i)]);
6437
6469
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
6438
6470
  // [...document.querySelectorAll('tbody > tr > td:first-child')].map(el => el.textContent.slice(1, -1))
@@ -6857,7 +6889,7 @@ exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[%', (
6857
6889
  class: 'remark'
6858
6890
  }, [(0, dom_1.html)('input', {
6859
6891
  type: 'checkbox'
6860
- }), (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, [])))));
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, {})))));
6861
6893
 
6862
6894
  /***/ }),
6863
6895
 
@@ -7128,7 +7160,6 @@ function* figure(target, notes, opts = {}) {
7128
7160
  }
7129
7161
  yield ref;
7130
7162
  }
7131
- return;
7132
7163
  }
7133
7164
  exports.figure = figure;
7134
7165
  const messages = {
@@ -7172,7 +7203,6 @@ const dom_1 = __webpack_require__(3252);
7172
7203
  function* note(target, notes, opts = {}, bottom = null) {
7173
7204
  yield* (0, exports.annotation)(target, notes?.annotations, opts, bottom);
7174
7205
  yield* (0, exports.reference)(target, notes?.references, opts, bottom);
7175
- return;
7176
7206
  }
7177
7207
  exports.note = note;
7178
7208
  exports.annotation = build('annotation', n => `*${n}`, 'h1, h2, h3, h4, h5, h6, aside.aside, hr');
@@ -7291,7 +7321,6 @@ function build(syntax, marker, splitter = '') {
7291
7321
  el.remove();
7292
7322
  }
7293
7323
  }
7294
- return;
7295
7324
  };
7296
7325
  function* proc(defs, note) {
7297
7326
  const {
@@ -7318,7 +7347,6 @@ function build(syntax, marker, splitter = '') {
7318
7347
  yield note.removeChild(children[size]);
7319
7348
  --length;
7320
7349
  }
7321
- return;
7322
7350
  }
7323
7351
  }
7324
7352
  function equal(a, b) {
@@ -7739,21 +7767,21 @@ var blank;
7739
7767
  blank.start = new RegExp(/^(?:\\?[^\S\n]|&IHN;|<wbr[^\S\n]*>)+/.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`));
7740
7768
  })(blank || (exports.blank = blank = {}));
7741
7769
  function visualize(parser) {
7742
- 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, context) => !rest && hasVisible(ns, context))), (0, combinator_1.some)((0, combinator_1.union)([source_1.linebreak, source_1.unescsource]))]);
7770
+ 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]))]);
7743
7771
  }
7744
7772
  exports.visualize = visualize;
7745
- function hasVisible(nodes, {
7746
- state = 0
7747
- } = {}) {
7773
+ function hasVisible(nodes) {
7748
7774
  for (let i = 0; i < nodes.length; ++i) {
7749
7775
  const node = nodes[i];
7750
7776
  if (typeof node === 'string') {
7751
7777
  if (node && node.trimStart()) return true;
7752
7778
  } else {
7753
7779
  if (node.innerText.trimStart()) return true;
7754
- if (state & 8 /* State.media */ ^ 8 /* State.media */ && (node.classList.contains('media') || node.getElementsByClassName('media')[0])) return true;
7780
+ //if (state & State.media ^ State.media &&
7781
+ // (node.classList.contains('media') || node.getElementsByClassName('media')[0])) return true;
7755
7782
  }
7756
7783
  }
7784
+
7757
7785
  return false;
7758
7786
  }
7759
7787
  function blankWith(starting, delimiter) {
@@ -8098,7 +8126,7 @@ function image(source, url, cache) {
8098
8126
  src: source.getAttribute('data-src'),
8099
8127
  loading: 'lazy'
8100
8128
  });
8101
- cache?.set(url.href, (0, dom_1.define)(source.cloneNode(true), Object.fromEntries([...source.attributes].filter(attr => !['class', 'data-type', 'data-src', 'src', 'loading'].includes(attr.name)).map(attr => [attr.name, null]))));
8129
+ cache?.set(url.href, (0, dom_1.define)(source.cloneNode(true), Object.fromEntries([...source.attributes].filter(attr => !['class', 'data-type', 'data-src', 'src', 'loading'].includes(attr.name)).map(attr => [attr.name, attr.name === 'alt' ? '' : null]))));
8102
8130
  return source;
8103
8131
  }
8104
8132
  exports.image = image;
@@ -8528,7 +8556,7 @@ function unlink(h) {
8528
8556
  /***/ 3252:
8529
8557
  /***/ (function(module) {
8530
8558
 
8531
- /*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
8559
+ /*! typed-dom v0.0.336 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
8532
8560
  (function webpackUniversalModuleDefinition(root, factory) {
8533
8561
  if(true)
8534
8562
  module.exports = factory();
@@ -8864,7 +8892,7 @@ exports.defrag = defrag;
8864
8892
  /***/ 6120:
8865
8893
  /***/ (function(module) {
8866
8894
 
8867
- /*! typed-dom v0.0.335 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
8895
+ /*! typed-dom v0.0.336 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
8868
8896
  (function webpackUniversalModuleDefinition(root, factory) {
8869
8897
  if(true)
8870
8898
  module.exports = factory();
package/markdown.d.ts CHANGED
@@ -71,6 +71,7 @@ export namespace MarkdownParser {
71
71
  BlockParser.ExtensionParser,
72
72
  BlockParser.SidefenceParser,
73
73
  BlockParser.BlockquoteParser,
74
+ BlockParser.MediaBlockParser,
74
75
  BlockParser.ReplyParser,
75
76
  BlockParser.ParagraphParser,
76
77
  ]> {
@@ -270,12 +271,18 @@ export namespace MarkdownParser {
270
271
  export interface HeadParser extends
271
272
  Block<'table/cell/head'>,
272
273
  Parser<HTMLTableCellElement, Context, [
274
+ InlineParser.LinkParser.MediaLinkParser,
275
+ InlineParser.MediaParser,
276
+ InlineParser.ShortMediaParser,
273
277
  InlineParser,
274
278
  ]> {
275
279
  }
276
280
  export interface DataParser extends
277
281
  Block<'table/cell/data'>,
278
282
  Parser<HTMLTableCellElement, Context, [
283
+ InlineParser.LinkParser.MediaLinkParser,
284
+ InlineParser.MediaParser,
285
+ InlineParser.ShortMediaParser,
279
286
  InlineParser,
280
287
  ]> {
281
288
  }
@@ -457,12 +464,18 @@ export namespace MarkdownParser {
457
464
  export interface HeadParser extends
458
465
  Block<'extension/table/cell/head'>,
459
466
  Parser<HTMLTableCellElement, Context, [
467
+ InlineParser.LinkParser.MediaLinkParser,
468
+ InlineParser.MediaParser,
469
+ InlineParser.ShortMediaParser,
460
470
  InlineParser,
461
471
  ]> {
462
472
  }
463
473
  export interface DataParser extends
464
474
  Block<'extension/table/cell/data'>,
465
475
  Parser<HTMLTableCellElement, Context, [
476
+ InlineParser.LinkParser.MediaLinkParser,
477
+ InlineParser.MediaParser,
478
+ InlineParser.ShortMediaParser,
466
479
  InlineParser,
467
480
  ]> {
468
481
  }
@@ -497,6 +510,7 @@ export namespace MarkdownParser {
497
510
  BlockParser.MathBlockParser,
498
511
  BlockParser.SidefenceParser,
499
512
  BlockParser.BlockquoteParser,
513
+ BlockParser.MediaBlockParser,
500
514
  BlockParser.ParagraphParser,
501
515
  ]> {
502
516
  }
@@ -562,6 +576,22 @@ export namespace MarkdownParser {
562
576
  ]> {
563
577
  }
564
578
  }
579
+ export interface MediaBlockParser extends
580
+ // abc
581
+ Block<'mediablock'>,
582
+ Parser<HTMLDivElement, Context, [
583
+ Parser<HTMLElement, Context, [
584
+ InlineParser.LinkParser.MediaLinkParser,
585
+ InlineParser.MediaParser,
586
+ InlineParser.ShortMediaParser,
587
+ ]>,
588
+ Parser<HTMLElement, Context, [
589
+ InlineParser.LinkParser.MediaLinkParser,
590
+ InlineParser.MediaParser,
591
+ InlineParser.ShortMediaParser,
592
+ ]>,
593
+ ]> {
594
+ }
565
595
  export interface ReplyParser extends
566
596
  // >>1
567
597
  // > text
@@ -641,8 +671,6 @@ export namespace MarkdownParser {
641
671
  InlineParser.ExtensionParser,
642
672
  InlineParser.RubyParser,
643
673
  InlineParser.LinkParser.TextLinkParser,
644
- InlineParser.LinkParser.LineMediaLinkParser,
645
- InlineParser.MediaParser.LineMediaParser,
646
674
  InlineParser.HTMLParser,
647
675
  InlineParser.InsertionParser,
648
676
  InlineParser.DeletionParser,
@@ -652,7 +680,6 @@ export namespace MarkdownParser {
652
680
  InlineParser.EmphasisParser,
653
681
  InlineParser.CodeParser,
654
682
  InlineParser.HTMLEntityParser,
655
- InlineParser.ShortMediaParser.LineShortMediaParser,
656
683
  InlineParser.AutolinkParser,
657
684
  InlineParser.BracketParser,
658
685
  SourceParser.TextParser,
@@ -730,7 +757,7 @@ export namespace MarkdownParser {
730
757
  MathParser.BracketParser,
731
758
  Parser<string, Context, [
732
759
  MathParser.BracketParser,
733
- SourceParser.StrParser,
760
+ SourceParser.UnescapableSourceParser,
734
761
  ]>,
735
762
  ]> {
736
763
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "securemark",
3
- "version": "0.278.0",
3
+ "version": "0.279.1",
4
4
  "description": "Secure markdown renderer working on browsers for user input data.",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/falsandtru/securemark",
@@ -34,14 +34,14 @@
34
34
  "@types/mocha": "10.0.1",
35
35
  "@types/power-assert": "1.5.8",
36
36
  "@types/prismjs": "1.26.0",
37
- "@typescript-eslint/parser": "^5.59.8",
37
+ "@typescript-eslint/parser": "^5.59.9",
38
38
  "babel-loader": "^9.1.2",
39
39
  "babel-plugin-unassert": "^3.2.0",
40
40
  "concurrently": "^8.1.0",
41
41
  "eslint": "^8.42.0",
42
42
  "eslint-plugin-redos": "^4.4.5",
43
43
  "eslint-webpack-plugin": "^4.0.1",
44
- "glob": "^10.2.6",
44
+ "glob": "^10.2.7",
45
45
  "karma": "^6.4.2",
46
46
  "karma-chrome-launcher": "^3.2.0",
47
47
  "karma-coverage": "^2.2.0",
@@ -51,11 +51,11 @@
51
51
  "mocha": "^10.2.0",
52
52
  "npm-check-updates": "^16.10.12",
53
53
  "semver": "^7.5.1",
54
- "spica": "0.0.731",
54
+ "spica": "0.0.732",
55
55
  "ts-loader": "^9.4.3",
56
- "typed-dom": "0.0.335",
56
+ "typed-dom": "0.0.336",
57
57
  "typescript": "5.1.3",
58
- "webpack": "^5.85.0",
58
+ "webpack": "^5.85.1",
59
59
  "webpack-cli": "^5.1.3",
60
60
  "webpack-merge": "^5.9.0"
61
61
  },
@@ -17,7 +17,7 @@ export function indent<T>(opener: RegExp | Parser<T>, parser?: Parser<T> | boole
17
17
  memoize(
18
18
  ([indent]) =>
19
19
  some(line(open(indent, ({ source }) => [[source], '']))),
20
- ([indent]) => indent.length * 2 + +(indent[0] === ' '), [])), separation),
20
+ ([indent]) => indent.length * 2 + +(indent[0] === ' '), {})), separation),
21
21
  (lines, rest, context) => {
22
22
  assert(parser = parser as Parser<T>);
23
23
  context.offset ??= 0;
package/src/debug.test.ts CHANGED
@@ -4,8 +4,8 @@ import { querySelectorWith, querySelectorAllWith } from 'typed-dom/query';
4
4
 
5
5
  export function inspect(result: Result<HTMLElement | string>, until: number | string = Infinity): Result<string> {
6
6
  return result && [
7
- eval(result).map((node, i, nodes) => {
8
- assert(node || node === '' && '([{'.includes(nodes[i + 1][0]));
7
+ eval(result).map(node => {
8
+ assert(node);
9
9
  if (typeof node === 'string') return node;
10
10
  node = node.cloneNode(true);
11
11
  assert(!querySelectorWith(node, '.invalid[data-invalid-message$="."]'));
@@ -132,9 +132,9 @@ describe('Unit: parser/api/parse', () => {
132
132
  '<p><a class="url" href="https://source/a" target="_blank">../a</a></p>',
133
133
  '<p><a class="url" href="https://source/a" target="_blank">../../a</a></p>',
134
134
  '<p><a class="url" href="//domain/a" target="_blank">//domain/a</a></p>',
135
- '<p><a href="https://source/x/a" target="_blank"><img class="media" data-src="https://source/x/a" alt=""></a></p>',
136
- '<p><a href="/z/a" target="_blank"><img class="media" data-src="/z/a" alt=""></a></p>',
137
- '<p><a href="https://source/a" target="_blank"><img class="media" data-src="https://source/a" alt=""></a></p>',
135
+ '<div><a href="https://source/x/a" target="_blank"><img class="media" data-src="https://source/x/a" alt=""></a></div>',
136
+ '<div><a href="/z/a" target="_blank"><img class="media" data-src="/z/a" alt=""></a></div>',
137
+ '<div><a href="https://source/a" target="_blank"><img class="media" data-src="https://source/a" alt=""></a></div>',
138
138
  '<ol class="annotations"><li id="annotation::def:a:1" data-marker="*1"><span>a</span><sup><a href="#annotation::ref:a:1">^1</a></sup></li></ol>',
139
139
  ]);
140
140
  assert.deepStrictEqual(