securemark 0.229.0 → 0.231.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.231.0
4
+
5
+ - Refine hashtag syntax.
6
+
7
+ ## 0.230.1
8
+
9
+ - Refactoring.
10
+
11
+ ## 0.230.0
12
+
13
+ - Change table syntax's cell syntax not to depend on trailing whitespace.
14
+
3
15
  ## 0.229.0
4
16
 
5
17
  - Change table syntax's alignment syntax to remove cell type declaration.
@@ -1,4 +1,4 @@
1
- /*! securemark v0.229.0 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED */
1
+ /*! securemark v0.231.0 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED */
2
2
  require = function () {
3
3
  function r(e, n, t) {
4
4
  function o(i, f) {
@@ -4676,7 +4676,7 @@ require = function () {
4676
4676
  translate: 'no',
4677
4677
  'data-invalid-syntax': 'codeblock',
4678
4678
  'data-invalid-type': !closer ? 'closer' : 'argument',
4679
- 'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
4679
+ 'data-invalid-description': !closer ? `Missing the closing delimiter "${ delim }".` : 'Invalid argument.'
4680
4680
  }, `${ opener }${ body }${ closer }`)];
4681
4681
  const file = (_a = path.split('/').pop()) !== null && _a !== void 0 ? _a : '';
4682
4682
  const ext = file && file.includes('.', 1) ? file.split('.').pop() : '';
@@ -4814,7 +4814,7 @@ require = function () {
4814
4814
  translate: 'no',
4815
4815
  'data-invalid-syntax': 'aside',
4816
4816
  'data-invalid-type': !closer ? 'closer' : 'argument',
4817
- 'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
4817
+ 'data-invalid-description': !closer ? `Missing the closing delimiter "${ delim }".` : 'Invalid argument.'
4818
4818
  }, `${ opener }${ body }${ closer }`)];
4819
4819
  const annotations = (0, typed_dom_1.html)('ol', { class: 'annotations' });
4820
4820
  const references = (0, typed_dom_1.html)('ol', { class: 'references' });
@@ -4869,7 +4869,7 @@ require = function () {
4869
4869
  translate: 'no',
4870
4870
  'data-invalid-syntax': 'example',
4871
4871
  'data-invalid-type': !closer ? 'closer' : 'argument',
4872
- 'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
4872
+ 'data-invalid-description': !closer ? `Missing the closing delimiter "${ delim }".` : 'Invalid argument.'
4873
4873
  }, `${ opener }${ body }${ closer }`)];
4874
4874
  switch (type) {
4875
4875
  case 'markdown': {
@@ -5126,7 +5126,7 @@ require = function () {
5126
5126
  translate: 'no',
5127
5127
  'data-invalid-syntax': 'message',
5128
5128
  'data-invalid-type': !closer ? 'closer' : 'argument',
5129
- 'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
5129
+ 'data-invalid-description': !closer ? `Missing the closing delimiter "${ delim }".` : 'Invalid argument.'
5130
5130
  }, `${ opener }${ body }${ closer }`)];
5131
5131
  switch (type) {
5132
5132
  case 'note':
@@ -5197,7 +5197,7 @@ require = function () {
5197
5197
  translate: 'no',
5198
5198
  'data-invalid-syntax': 'extension',
5199
5199
  'data-invalid-type': !closer ? 'closer' : 'syntax',
5200
- 'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid syntax.'
5200
+ 'data-invalid-description': !closer ? `Missing the closing delimiter "${ delim }".` : 'Invalid syntax.'
5201
5201
  }, `${ opener }${ body }${ closer }`)])));
5202
5202
  },
5203
5203
  {
@@ -5231,7 +5231,7 @@ require = function () {
5231
5231
  translate: 'no',
5232
5232
  'data-invalid-syntax': 'table',
5233
5233
  'data-invalid-type': !closer ? 'closer' : 'argument',
5234
- 'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
5234
+ 'data-invalid-description': !closer ? `Missing the closing delimiter "${ delim }".` : 'Invalid argument.'
5235
5235
  }, `${ opener }${ body }${ closer }`)],
5236
5236
  ''
5237
5237
  ];
@@ -5263,17 +5263,17 @@ require = function () {
5263
5263
  ]), ns => !(0, alias_1.isArray)(ns[0]) ? (0, array_1.unshift)([[[]]], ns) : ns)));
5264
5264
  const alignment = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)/;
5265
5265
  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(''))));
5266
- const delimiter = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|^[#:](?:(?!:\D|0)\d*:(?!0)\d*)?!*(?=[^\S\n])/;
5267
- const head = (0, combinator_1.creator)((0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^#(?:(?!:\D|0)\d*:(?!0)\d*)?!*(?=[^\S\n])/), (0, combinator_1.rewrite)((0, combinator_1.inits)([
5266
+ const delimiter = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|^[#:](?:(?!:\D|0)\d*:(?!0)\d*)?!*(?=\s)/;
5267
+ const head = (0, combinator_1.creator)((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)([
5268
5268
  source_1.anyline,
5269
5269
  (0, combinator_1.some)(source_1.contentline, delimiter)
5270
5270
  ]), (0, combinator_1.trim)((0, util_1.visualize)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, typed_dom_1.html)('th', attributes(ns.shift()), (0, typed_dom_1.defrag)(ns))]), false));
5271
- const data = (0, combinator_1.creator)((0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^:(?:(?!:\D|0)\d*:(?!0)\d*)?!*(?=[^\S\n])/), (0, combinator_1.rewrite)((0, combinator_1.inits)([
5271
+ const data = (0, combinator_1.creator)((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)([
5272
5272
  source_1.anyline,
5273
5273
  (0, combinator_1.some)(source_1.contentline, delimiter)
5274
5274
  ]), (0, combinator_1.trim)((0, util_1.visualize)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, typed_dom_1.html)('td', attributes(ns.shift()), (0, typed_dom_1.defrag)(ns))]), false));
5275
5275
  const dataline = (0, combinator_1.creator)((0, combinator_1.line)((0, combinator_1.rewrite)(source_1.contentline, (0, combinator_1.union)([
5276
- (0, combinator_1.validate)(/^!+[^\S\n]/, (0, combinator_1.convert)(source => `:${ source }`, data)),
5276
+ (0, combinator_1.validate)(/^!+\s/, (0, combinator_1.convert)(source => `:${ source }`, data)),
5277
5277
  (0, combinator_1.convert)(source => `: ${ source }`, data)
5278
5278
  ]))));
5279
5279
  function attributes(source) {
@@ -5555,7 +5555,8 @@ require = function () {
5555
5555
  const inline_1 = _dereq_('../inline');
5556
5556
  const source_1 = _dereq_('../source');
5557
5557
  const typed_dom_1 = _dereq_('typed-dom');
5558
- exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^[-+*](?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.context)({ syntax: { inline: { media: false } } }, (0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([
5558
+ exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^[-+*](?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.context)({ syntax: { inline: { media: false } } }, exports.ilist_))));
5559
+ 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.creator)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([
5559
5560
  (0, combinator_1.line)((0, combinator_1.open)(/^[-+*](?:$|\s)/, (0, combinator_1.trim)((0, combinator_1.some)(inline_1.inline)), true)),
5560
5561
  (0, combinator_1.indent)((0, combinator_1.union)([
5561
5562
  ulist_1.ulist_,
@@ -5565,13 +5566,12 @@ require = function () {
5565
5566
  ]), (0, combinator_1.rewrite)(source_1.contentline, source => [
5566
5567
  [(0, typed_dom_1.html)('span', source.replace('\n', ''))],
5567
5568
  ''
5568
- ])), ns => [(0, typed_dom_1.html)('li', (0, typed_dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])]))))), es => [(0, typed_dom_1.html)('ul', {
5569
+ ])), ns => [(0, typed_dom_1.html)('li', (0, typed_dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])])))), es => [(0, typed_dom_1.html)('ul', {
5569
5570
  class: 'invalid',
5570
5571
  'data-invalid-syntax': 'list',
5571
5572
  'data-invalid-type': 'syntax',
5572
5573
  'data-invalid-description': 'Use "-" instead of "+" or "*".'
5573
5574
  }, es)])));
5574
- exports.ilist_ = (0, combinator_1.convert)(source => source.replace(/^[-+*](?=$|\n)/, `$& `), exports.ilist);
5575
5575
  },
5576
5576
  {
5577
5577
  '../../combinator': 27,
@@ -5607,7 +5607,7 @@ require = function () {
5607
5607
  translate: 'no',
5608
5608
  'data-invalid-syntax': 'mathblock',
5609
5609
  'data-invalid-type': delim.length > 2 ? 'syntax' : !closer ? 'closer' : 'argument',
5610
- 'data-invalid-description': delim.length > 2 ? 'Invalid syntax' : !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
5610
+ 'data-invalid-description': delim.length > 2 ? 'Invalid syntax' : !closer ? `Missing the closing delimiter "${ delim }".` : 'Invalid argument.'
5611
5611
  }, `${ opener }${ body }${ closer }`)];
5612
5612
  })));
5613
5613
  },
@@ -5631,9 +5631,20 @@ require = function () {
5631
5631
  const typed_dom_1 = _dereq_('typed-dom');
5632
5632
  const memoize_1 = _dereq_('spica/memoize');
5633
5633
  const array_1 = _dereq_('spica/array');
5634
- exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.match)(/^(?=(?:([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*(\.)|\(([0-9]+|[a-z]+)(\))(?:-[0-9]+)*)(?=[^\S\n]|\n[^\S\n]*\S))/, (0, memoize_1.memoize)(ms => list(type(ms[1] || ms[3]), ms[2] || ms[4]), ms => type(ms[1] || ms[3]) + (ms[2] || ms[4])))));
5635
- const list = (type, delim) => (0, combinator_1.fmap)((0, combinator_1.context)({ syntax: { inline: { media: false } } }, (0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([
5636
- (0, combinator_1.line)((0, combinator_1.open)(items[delim], (0, combinator_1.trim)((0, combinator_1.subsequence)([
5634
+ const openers = {
5635
+ '.': /^(?:[0-9]+|[a-z]+|[A-Z]+)(?:-(?!-)[0-9]*)*(?![^\S\n])\.?(?=$|\s)/,
5636
+ '(': /^\((?:[0-9]*|[a-z]*)(?![^)\n])\)?(?:-(?!-)[0-9]*)*(?=$|\s)/
5637
+ };
5638
+ exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)([
5639
+ /^([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*\.(?=[^\S\n]|\n[^\S\n]*\S)/,
5640
+ /^\(([0-9]+|[a-z]+)\)(?:-[0-9]+)*(?=[^\S\n]|\n[^\S\n]*\S)/
5641
+ ], (0, combinator_1.context)({ syntax: { inline: { media: false } } }, exports.olist_))));
5642
+ exports.olist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.union)([
5643
+ (0, combinator_1.match)(new RegExp(`^(?=${ openers['.'].source.replace('?:', '') })`), (0, memoize_1.memoize)(ms => list(type(ms[1]), '.'), ms => type(ms[1]))),
5644
+ (0, combinator_1.match)(new RegExp(`^(?=${ openers['('].source.replace('?:', '') })`), (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => type(ms[1])))
5645
+ ])));
5646
+ const list = (type, delim) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([
5647
+ (0, combinator_1.line)((0, combinator_1.open)(heads[delim], (0, combinator_1.trim)((0, combinator_1.subsequence)([
5637
5648
  ulist_1.checkbox,
5638
5649
  (0, combinator_1.trimStart)((0, combinator_1.some)(inline_1.inline))
5639
5650
  ])), true)),
@@ -5642,18 +5653,17 @@ require = function () {
5642
5653
  exports.olist_,
5643
5654
  ilist_1.ilist_
5644
5655
  ]))
5645
- ]), iitem), ns => [(0, typed_dom_1.html)('li', { 'data-marker': ns[0] }, (0, typed_dom_1.defrag)((0, ulist_1.fillFirstLine)((0, array_1.shift)(ns)[1])))])])))), es => [format((0, typed_dom_1.html)('ol', es), type, delim)]);
5646
- const items = {
5647
- '.': (0, combinator_1.focus)(/^(?:[0-9]+|[a-z]+|[A-Z]+)(?:-(?!-)[0-9]*)*(?![^\S\n])\.?(?=$|\s)/, source => [
5656
+ ]), iitem), ns => [(0, typed_dom_1.html)('li', { 'data-marker': ns[0] }, (0, typed_dom_1.defrag)((0, ulist_1.fillFirstLine)((0, array_1.shift)(ns)[1])))])]))), es => [format((0, typed_dom_1.html)('ol', es), type, delim)]);
5657
+ const heads = {
5658
+ '.': (0, combinator_1.focus)(openers['.'], source => [
5648
5659
  [`${ source.split('.', 1)[0] }.`],
5649
5660
  ''
5650
5661
  ]),
5651
- ')': (0, combinator_1.focus)(/^\((?:[0-9]*|[a-z]*)(?![^)\n])\)?(?:-(?!-)[0-9]*)*(?=$|\s)/, source => [
5652
- [source.trimEnd().replace(/^\($/, '(1)').replace(/^\((\w+)\)?$/, '($1)')],
5662
+ '(': (0, combinator_1.focus)(openers['('], source => [
5663
+ [source.replace(/^\($/, '(1)').replace(/^\((\w+)$/, '($1)')],
5653
5664
  ''
5654
5665
  ])
5655
5666
  };
5656
- exports.olist_ = (0, combinator_1.convert)(source => source[0] !== '(' ? source.replace(/^((?:[0-9]+|[a-z]+|[A-Z]+)(?:-(?!-)[0-9]*)*)\.?(?=$|\n)/, `$1. `) : source.replace(/^\((?=$|\n)/, `(1) `).replace(/^\(((?:[0-9]+|[a-z]+))\)?((?:-(?!-)[0-9]*)*(?=$|\n))/, `($1)$2 `), exports.olist);
5657
5667
  const iitem = (0, combinator_1.rewrite)(source_1.contentline, source => [
5658
5668
  [
5659
5669
  '',
@@ -5661,7 +5671,7 @@ require = function () {
5661
5671
  class: 'invalid',
5662
5672
  'data-invalid-syntax': 'listitem',
5663
5673
  'data-invalid-type': 'syntax',
5664
- 'data-invalid-description': 'Fix the indent or the head of list items.'
5674
+ 'data-invalid-description': 'Fix the indent or the head of the list item.'
5665
5675
  }, source.replace('\n', ''))
5666
5676
  ],
5667
5677
  ''
@@ -5844,7 +5854,7 @@ require = function () {
5844
5854
  class: 'quote invalid',
5845
5855
  'data-invalid-syntax': 'quote',
5846
5856
  'data-invalid-type': 'syntax',
5847
- 'data-invalid-description': `Missing the whitespace after ${ ns[0].split(/[^>]/, 1)[0] }.`
5857
+ 'data-invalid-description': `Missing the whitespace after "${ ns[0].split(/[^>]/, 1)[0] }".`
5848
5858
  }, ns),
5849
5859
  (0, typed_dom_1.html)('br')
5850
5860
  ]), false)));
@@ -5970,7 +5980,7 @@ require = function () {
5970
5980
  function (_dereq_, module, exports) {
5971
5981
  'use strict';
5972
5982
  Object.defineProperty(exports, '__esModule', { value: true });
5973
- exports.fillFirstLine = exports.ulist_ = exports.checkbox = exports.ulist = void 0;
5983
+ exports.fillFirstLine = exports.checkbox = exports.ulist_ = exports.ulist = void 0;
5974
5984
  const combinator_1 = _dereq_('../../combinator');
5975
5985
  const olist_1 = _dereq_('./olist');
5976
5986
  const ilist_1 = _dereq_('./ilist');
@@ -5978,7 +5988,8 @@ require = function () {
5978
5988
  const typed_dom_1 = _dereq_('typed-dom');
5979
5989
  const array_1 = _dereq_('spica/array');
5980
5990
  const source_1 = _dereq_('../source');
5981
- exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^-(?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.context)({ syntax: { inline: { media: false } } }, (0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([
5991
+ exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^-(?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.context)({ syntax: { inline: { media: false } } }, exports.ulist_))));
5992
+ 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.creator)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([
5982
5993
  (0, combinator_1.line)((0, combinator_1.open)(/^-(?:$|\s)/, (0, combinator_1.trim)((0, combinator_1.subsequence)([
5983
5994
  exports.checkbox,
5984
5995
  (0, combinator_1.trimStart)((0, combinator_1.some)(inline_1.inline))
@@ -5988,18 +5999,17 @@ require = function () {
5988
5999
  olist_1.olist_,
5989
6000
  ilist_1.ilist_
5990
6001
  ]))
5991
- ]), iitem), ns => [(0, typed_dom_1.html)('li', (0, typed_dom_1.defrag)(fillFirstLine(ns)))])]))))), es => [format((0, typed_dom_1.html)('ul', es))])));
6002
+ ]), iitem), ns => [(0, typed_dom_1.html)('li', (0, typed_dom_1.defrag)(fillFirstLine(ns)))])])))), es => [format((0, typed_dom_1.html)('ul', es))])));
5992
6003
  exports.checkbox = (0, combinator_1.focus)(/^\[[xX ]\](?=$|\s)/, source => [
5993
6004
  [(0, typed_dom_1.html)('span', { class: 'checkbox' }, source[1].trimStart() ? '\u2611' : '\u2610')],
5994
6005
  ''
5995
6006
  ]);
5996
- exports.ulist_ = (0, combinator_1.convert)(source => source.replace(/^-(?=$|\n)/, `$& `), exports.ulist);
5997
6007
  const iitem = (0, combinator_1.rewrite)(source_1.contentline, source => [
5998
6008
  [(0, typed_dom_1.html)('span', {
5999
6009
  class: 'invalid',
6000
6010
  'data-invalid-syntax': 'listitem',
6001
6011
  'data-invalid-type': 'syntax',
6002
- 'data-invalid-description': 'Fix the indent or the head of list items.'
6012
+ 'data-invalid-description': 'Fix the indent or the head of the list item.'
6003
6013
  }, source.replace('\n', ''))],
6004
6014
  ''
6005
6015
  ]);
@@ -6237,22 +6247,20 @@ require = function () {
6237
6247
  const anchor_1 = _dereq_('./autolink/anchor');
6238
6248
  const source_1 = _dereq_('../source');
6239
6249
  const util_1 = _dereq_('../util');
6240
- exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]|[^\x00-\x7F\s])/, (0, combinator_1.guard)(context => {
6250
+ exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]|\S#)/, (0, combinator_1.guard)(context => {
6241
6251
  var _a, _b, _c;
6242
6252
  return (_c = (_b = (_a = context.syntax) === null || _a === void 0 ? void 0 : _a.inline) === null || _b === void 0 ? void 0 : _b.autolink) !== null && _c !== void 0 ? _c : true;
6243
6253
  }, (0, combinator_1.some)((0, combinator_1.union)([
6244
6254
  url_1.url,
6245
6255
  email_1.email,
6246
6256
  (0, source_1.str)(/^[0-9A-Za-z]+(?:[.+_-][0-9A-Za-z]+)*(?:@(?:[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?)+/),
6247
- (0, source_1.str)(/^@+(?![0-9A-Za-z]|[^\x00-\x7F\s])/),
6248
- (0, source_1.str)(/^#+(?![0-9A-Za-z'_]|[^\x00-\x7F\s])/),
6249
6257
  channel_1.channel,
6250
6258
  account_1.account,
6251
- (0, source_1.str)(/^@[0-9A-Za-z]+(?:-[0-9A-Za-z]+)*/),
6252
- (0, source_1.str)(/^[0-9A-Za-z]+(?=#)|^[^\x00-\x7F\s]+(?=#)/),
6259
+ (0, source_1.str)(/^@+[0-9A-Za-z]*(?:-[0-9A-Za-z]+)*/),
6260
+ (0, source_1.str)(new RegExp(String.raw`^(?:[^\p{C}\p{S}\p{P}\s]|${ hashtag_1.emoji }|['_])(?=#)`, 'u')),
6253
6261
  hashtag_1.hashtag,
6254
6262
  hashnum_1.hashnum,
6255
- (0, source_1.str)(/^#(?:[0-9A-Za-z'_]|[^\x00-\x7F\s])+/),
6263
+ (0, source_1.str)(new RegExp(String.raw`^#+(?:[^\p{C}\p{S}\p{P}\s]|${ hashtag_1.emoji }|['_])*`, 'u')),
6256
6264
  anchor_1.anchor
6257
6265
  ])))), ns => ns.length === 1 ? ns : [(0, util_1.stringify)(ns)]);
6258
6266
  },
@@ -6279,7 +6287,7 @@ require = function () {
6279
6287
  const source_1 = _dereq_('../../source');
6280
6288
  const typed_dom_1 = _dereq_('typed-dom');
6281
6289
  exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('@', (0, combinator_1.tails)([
6282
- (0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z](?:[0-9A-Za-z-]{0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:[0-9A-Za-z-]{0,61}[0-9A-Za-z])?)*\//), ([source]) => source.length <= 253 + 1),
6290
+ (0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?)*\//), ([source]) => source.length <= 253 + 1),
6283
6291
  (0, combinator_1.verify)((0, source_1.str)(/^[A-Za-z][0-9A-Za-z]*(?:-[0-9A-Za-z]+)*/), ([source]) => source.length <= 64)
6284
6292
  ])), (0, combinator_1.context)({
6285
6293
  syntax: {
@@ -6366,7 +6374,7 @@ require = function () {
6366
6374
  const combinator_1 = _dereq_('../../../combinator');
6367
6375
  const source_1 = _dereq_('../../source');
6368
6376
  const typed_dom_1 = _dereq_('typed-dom');
6369
- exports.email = (0, combinator_1.creator)((0, combinator_1.rewrite)((0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z]+(?:[.+_-][0-9A-Za-z]+)*@[0-9A-Za-z](?:[0-9A-Za-z-]{0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:[0-9A-Za-z-]{0,61}[0-9A-Za-z])?)*/), ([source]) => source.indexOf('@') <= 64 && source.length <= 255), source => [
6377
+ exports.email = (0, combinator_1.creator)((0, combinator_1.rewrite)((0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z]+(?:[.+_-][0-9A-Za-z]+)*@[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?)*(?![0-9A-Za-z])/), ([source]) => source.indexOf('@') <= 64 && source.length <= 255), source => [
6370
6378
  [(0, typed_dom_1.html)('a', {
6371
6379
  class: 'email',
6372
6380
  href: `mailto:${ source }`
@@ -6387,9 +6395,10 @@ require = function () {
6387
6395
  exports.hashnum = void 0;
6388
6396
  const combinator_1 = _dereq_('../../../combinator');
6389
6397
  const link_1 = _dereq_('../link');
6398
+ const hashtag_1 = _dereq_('./hashtag');
6390
6399
  const source_1 = _dereq_('../../source');
6391
6400
  const typed_dom_1 = _dereq_('typed-dom');
6392
- exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, source_1.str)(/^[0-9]{1,16}(?![0-9A-Za-z'_]|[^\x00-\x7F\s])/)), (0, combinator_1.context)({
6401
+ exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, source_1.str)(new RegExp(String.raw`^[0-9]{1,16}(?![^\p{C}\p{S}\p{P}\s]|${ hashtag_1.emoji }|['_])`, 'u'))), (0, combinator_1.context)({
6393
6402
  syntax: {
6394
6403
  inline: {
6395
6404
  link: true,
@@ -6405,6 +6414,7 @@ require = function () {
6405
6414
  '../../../combinator': 27,
6406
6415
  '../../source': 128,
6407
6416
  '../link': 114,
6417
+ './hashtag': 96,
6408
6418
  'typed-dom': 26
6409
6419
  }
6410
6420
  ],
@@ -6412,14 +6422,20 @@ require = function () {
6412
6422
  function (_dereq_, module, exports) {
6413
6423
  'use strict';
6414
6424
  Object.defineProperty(exports, '__esModule', { value: true });
6415
- exports.hashtag = void 0;
6425
+ exports.hashtag = exports.emoji = void 0;
6416
6426
  const combinator_1 = _dereq_('../../../combinator');
6417
6427
  const link_1 = _dereq_('../link');
6418
6428
  const source_1 = _dereq_('../../source');
6419
6429
  const typed_dom_1 = _dereq_('typed-dom');
6430
+ exports.emoji = String.raw`\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F`;
6420
6431
  exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, combinator_1.tails)([
6421
- (0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z](?:[0-9A-Za-z-]{0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:[0-9A-Za-z-]{0,61}[0-9A-Za-z])?)*\//), ([source]) => source.length <= 253 + 1),
6422
- (0, combinator_1.verify)((0, source_1.str)(/^(?=(?:[0-9]{1,127}_?)?(?:[A-Za-z]|[^\x00-\x7F\s]))(?:[0-9A-Za-z]|[^\x00-\x7F\s]|'(?!')|_(?=[0-9A-Za-z]|[^\x00-\x7F\s])){1,128}(?:_?\((?=(?:[0-9]{1,127}_?)?(?:[A-Za-z]|[^\x00-\x7F\s]))(?:[0-9A-Za-z]|[^\x00-\x7F\s]|'(?!')|_(?=[0-9A-Za-z]|[^\x00-\x7F\s])){1,125}\))?(?![0-9A-Za-z'_]|[^\x00-\x7F\s])/), ([source]) => source.length <= 128)
6432
+ (0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?)*\//), ([source]) => source.length <= 253 + 1),
6433
+ (0, combinator_1.verify)((0, source_1.str)(new RegExp([
6434
+ '^',
6435
+ String.raw`(?=[0-9]{0,127}_?(?:[^\d\p{C}\p{S}\p{P}\s]|${ exports.emoji }))`,
6436
+ String.raw`(?:[^\p{C}\p{S}\p{P}\s]|${ exports.emoji }|_(?=[^\p{C}\p{S}\p{P}\s]|${ exports.emoji })){1,128}`,
6437
+ String.raw`(?!_?(?:[^\p{C}\p{S}\p{P}\s]|${ exports.emoji })|')`
6438
+ ].join(''), 'u')), ([source]) => source.length <= 128)
6423
6439
  ])), (0, combinator_1.context)({
6424
6440
  syntax: {
6425
6441
  inline: {
@@ -7314,7 +7330,7 @@ require = function () {
7314
7330
  switch (true) {
7315
7331
  case uri.slice(0, 2) === '^/':
7316
7332
  const last = host.pathname.slice(host.pathname.lastIndexOf('/') + 1);
7317
- return last.includes('.') && /^[0-9]*[a-z][0-9a-z]*$/i.test(last.slice(last.lastIndexOf('.') + 1)) ? `${ host.pathname.slice(0, -last.length) }${ uri.slice(2) }` : `${ host.pathname.replace(/\/?$/, '/') }${ uri.slice(2) }`;
7333
+ return last.includes('.') && /^[0-9]*[A-Za-z][0-9A-Za-z]*$/.test(last.slice(last.lastIndexOf('.') + 1)) ? `${ host.pathname.slice(0, -last.length) }${ uri.slice(2) }` : `${ host.pathname.replace(/\/?$/, '/') }${ uri.slice(2) }`;
7318
7334
  case host.origin === source.origin && host.pathname === source.pathname:
7319
7335
  case uri.slice(0, 2) === '//':
7320
7336
  return uri;
@@ -8459,9 +8475,9 @@ require = function () {
8459
8475
  const combinator_1 = _dereq_('../../combinator');
8460
8476
  const str_1 = _dereq_('./str');
8461
8477
  const typed_dom_1 = _dereq_('typed-dom');
8462
- exports.separator = /[\s\x00-\x7F]|[、。!?][^\S\n]*(?=\\\n)/;
8478
+ exports.separator = /[\s\x00-\x7F]|\S#|[、。!?][^\S\n]*(?=\\\n)/;
8463
8479
  exports.nonWhitespace = /[\S\n]|$/;
8464
- exports.nonAlphanumeric = /[^0-9A-Za-z]|$/;
8480
+ exports.nonAlphanumeric = /[^0-9A-Za-z]|\S#|$/;
8465
8481
  const repeat = (0, str_1.str)(/^(.)\1*/);
8466
8482
  exports.text = (0, combinator_1.creator)((source, context) => {
8467
8483
  if (source === '')
@@ -8535,7 +8551,7 @@ require = function () {
8535
8551
  ];
8536
8552
  default:
8537
8553
  const b = source[0].trimStart() === '';
8538
- const i = b || isAlphanumeric(source[0]) ? source.search(b ? exports.nonWhitespace : exports.nonAlphanumeric) : 1;
8554
+ const i = b || isAlphanumeric(source[0]) ? source.search(b ? exports.nonWhitespace : exports.nonAlphanumeric) || 1 : 1;
8539
8555
  return b && i === source.length || b && source[i] === '\n' || b && source[i] === '\\' && source[i + 1] === '\n' ? [
8540
8556
  [],
8541
8557
  source.slice(i)
@@ -8586,7 +8602,7 @@ require = function () {
8586
8602
  ];
8587
8603
  case 0: {
8588
8604
  const b = source[0] !== '\n' && source[0].trimStart() === '';
8589
- const i = b || (0, text_1.isAlphanumeric)(source[0]) ? source.search(b ? text_1.nonWhitespace : text_1.nonAlphanumeric) : 1;
8605
+ const i = b || (0, text_1.isAlphanumeric)(source[0]) ? source.search(b ? text_1.nonWhitespace : text_1.nonAlphanumeric) || 1 : 1;
8590
8606
  return [
8591
8607
  [source.slice(0, i)],
8592
8608
  source.slice(i)
package/markdown.d.ts CHANGED
@@ -123,12 +123,12 @@ export namespace MarkdownParser {
123
123
  // - item
124
124
  Block<'ulist'>,
125
125
  Parser<HTMLUListElement, Context, [
126
- UListParser.ListItemParser,
126
+ UListParser.ItemParser,
127
127
  ]> {
128
128
  }
129
129
  export namespace UListParser {
130
- export interface ListItemParser extends
131
- Block<'ulist/listitem'>,
130
+ export interface ItemParser extends
131
+ Block<'ulist/item'>,
132
132
  Parser<HTMLLIElement, Context, [
133
133
  Parser<HTMLElement | string, Context, [
134
134
  InlineParser,
@@ -148,12 +148,19 @@ export namespace MarkdownParser {
148
148
  // (a)-1 item
149
149
  Block<'olist'>,
150
150
  Parser<HTMLOListElement, Context, [
151
- OListParser.ListItemParser,
151
+ OListParser.ListParser,
152
+ OListParser.ListParser,
152
153
  ]> {
153
154
  }
154
155
  export namespace OListParser {
155
- export interface ListItemParser extends
156
- Block<'olist/listitem'>,
156
+ export interface ListParser extends
157
+ Block<'olist/list'>,
158
+ Parser<HTMLOListElement, Context, [
159
+ OListParser.ItemParser,
160
+ ]> {
161
+ }
162
+ export interface ItemParser extends
163
+ Block<'olist/item'>,
157
164
  Parser<HTMLLIElement, Context, [
158
165
  Parser<HTMLElement | string, Context, [
159
166
  InlineParser,
@@ -172,12 +179,12 @@ export namespace MarkdownParser {
172
179
  // * item
173
180
  Block<'ilist'>,
174
181
  Parser<HTMLUListElement, Context, [
175
- IListParser.ListItemParser,
182
+ IListParser.ItemParser,
176
183
  ]> {
177
184
  }
178
185
  export namespace IListParser {
179
- export interface ListItemParser extends
180
- Block<'ilist/listitem'>,
186
+ export interface ItemParser extends
187
+ Block<'ilist/item'>,
181
188
  Parser<HTMLLIElement, Context, [
182
189
  InlineParser,
183
190
  Parser<HTMLUListElement | HTMLOListElement, Context, [
@@ -1043,8 +1050,6 @@ export namespace MarkdownParser {
1043
1050
  AutolinkParser.UrlParser,
1044
1051
  AutolinkParser.EmailParser,
1045
1052
  SourceParser.StrParser,
1046
- SourceParser.StrParser,
1047
- SourceParser.StrParser,
1048
1053
  AutolinkParser.ChannelParser,
1049
1054
  AutolinkParser.AccountParser,
1050
1055
  SourceParser.StrParser,