securemark 0.230.0 → 0.230.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 +4 -0
- package/dist/securemark.js +24 -26
- package/markdown.d.ts +0 -2
- package/package-lock.json +24 -24
- package/package.json +1 -1
- package/src/parser/autolink.test.ts +3 -3
- package/src/parser/block/codeblock.ts +1 -1
- package/src/parser/block/extension/aside.ts +1 -1
- package/src/parser/block/extension/example.ts +1 -1
- package/src/parser/block/extension/message.ts +1 -1
- package/src/parser/block/extension/placeholder.ts +1 -1
- package/src/parser/block/extension/table.ts +1 -1
- package/src/parser/block/mathblock.ts +1 -1
- package/src/parser/block/olist.test.ts +4 -0
- package/src/parser/block/olist.ts +6 -6
- package/src/parser/block/paragraph/mention/quote.ts +1 -1
- package/src/parser/block/ulist.ts +1 -1
- package/src/parser/inline/autolink.ts +4 -7
- package/src/parser/inline.test.ts +3 -3
- package/src/parser/source/text.ts +3 -3
- package/src/parser/source/unescapable.ts +1 -1
package/CHANGELOG.md
CHANGED
package/dist/securemark.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.230.
|
|
1
|
+
/*! securemark v0.230.1 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
|
];
|
|
@@ -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
|
},
|
|
@@ -5636,15 +5636,15 @@ require = function () {
|
|
|
5636
5636
|
'(': /^\((?:[0-9]*|[a-z]*)(?![^)\n])\)?(?:-(?!-)[0-9]*)*(?=$|\s)/
|
|
5637
5637
|
};
|
|
5638
5638
|
exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)([
|
|
5639
|
-
/^(
|
|
5640
|
-
|
|
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
5641
|
], (0, combinator_1.context)({ syntax: { inline: { media: false } } }, exports.olist_))));
|
|
5642
5642
|
exports.olist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.union)([
|
|
5643
5643
|
(0, combinator_1.match)(new RegExp(`^(?=${ openers['.'].source.replace('?:', '') })`), (0, memoize_1.memoize)(ms => list(type(ms[1]), '.'), ms => type(ms[1]))),
|
|
5644
5644
|
(0, combinator_1.match)(new RegExp(`^(?=${ openers['('].source.replace('?:', '') })`), (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => type(ms[1])))
|
|
5645
5645
|
])));
|
|
5646
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)(
|
|
5647
|
+
(0, combinator_1.line)((0, combinator_1.open)(heads[delim], (0, combinator_1.trim)((0, combinator_1.subsequence)([
|
|
5648
5648
|
ulist_1.checkbox,
|
|
5649
5649
|
(0, combinator_1.trimStart)((0, combinator_1.some)(inline_1.inline))
|
|
5650
5650
|
])), true)),
|
|
@@ -5654,13 +5654,13 @@ require = function () {
|
|
|
5654
5654
|
ilist_1.ilist_
|
|
5655
5655
|
]))
|
|
5656
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
|
|
5657
|
+
const heads = {
|
|
5658
5658
|
'.': (0, combinator_1.focus)(openers['.'], source => [
|
|
5659
5659
|
[`${ source.split('.', 1)[0] }.`],
|
|
5660
5660
|
''
|
|
5661
5661
|
]),
|
|
5662
5662
|
'(': (0, combinator_1.focus)(openers['('], source => [
|
|
5663
|
-
[source.
|
|
5663
|
+
[source.replace(/^\($/, '(1)').replace(/^\((\w+)$/, '($1)')],
|
|
5664
5664
|
''
|
|
5665
5665
|
])
|
|
5666
5666
|
};
|
|
@@ -5671,7 +5671,7 @@ require = function () {
|
|
|
5671
5671
|
class: 'invalid',
|
|
5672
5672
|
'data-invalid-syntax': 'listitem',
|
|
5673
5673
|
'data-invalid-type': 'syntax',
|
|
5674
|
-
'data-invalid-description': 'Fix the indent or the head of list
|
|
5674
|
+
'data-invalid-description': 'Fix the indent or the head of the list item.'
|
|
5675
5675
|
}, source.replace('\n', ''))
|
|
5676
5676
|
],
|
|
5677
5677
|
''
|
|
@@ -5854,7 +5854,7 @@ require = function () {
|
|
|
5854
5854
|
class: 'quote invalid',
|
|
5855
5855
|
'data-invalid-syntax': 'quote',
|
|
5856
5856
|
'data-invalid-type': 'syntax',
|
|
5857
|
-
'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] }".`
|
|
5858
5858
|
}, ns),
|
|
5859
5859
|
(0, typed_dom_1.html)('br')
|
|
5860
5860
|
]), false)));
|
|
@@ -6009,7 +6009,7 @@ require = function () {
|
|
|
6009
6009
|
class: 'invalid',
|
|
6010
6010
|
'data-invalid-syntax': 'listitem',
|
|
6011
6011
|
'data-invalid-type': 'syntax',
|
|
6012
|
-
'data-invalid-description': 'Fix the indent or the head of list
|
|
6012
|
+
'data-invalid-description': 'Fix the indent or the head of the list item.'
|
|
6013
6013
|
}, source.replace('\n', ''))],
|
|
6014
6014
|
''
|
|
6015
6015
|
]);
|
|
@@ -6247,22 +6247,20 @@ require = function () {
|
|
|
6247
6247
|
const anchor_1 = _dereq_('./autolink/anchor');
|
|
6248
6248
|
const source_1 = _dereq_('../source');
|
|
6249
6249
|
const util_1 = _dereq_('../util');
|
|
6250
|
-
exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]
|
|
6250
|
+
exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]|\S#)/, (0, combinator_1.guard)(context => {
|
|
6251
6251
|
var _a, _b, _c;
|
|
6252
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;
|
|
6253
6253
|
}, (0, combinator_1.some)((0, combinator_1.union)([
|
|
6254
6254
|
url_1.url,
|
|
6255
6255
|
email_1.email,
|
|
6256
6256
|
(0, source_1.str)(/^[0-9A-Za-z]+(?:[.+_-][0-9A-Za-z]+)*(?:@(?:[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?)+/),
|
|
6257
|
-
(0, source_1.str)(/^@+(?![0-9A-Za-z]|[^\x00-\x7F\s])/),
|
|
6258
|
-
(0, source_1.str)(/^#+(?![0-9A-Za-z'_]|[^\x00-\x7F\s])/),
|
|
6259
6257
|
channel_1.channel,
|
|
6260
6258
|
account_1.account,
|
|
6261
|
-
(0, source_1.str)(
|
|
6262
|
-
(0, source_1.str)(/^[0-9A-Za-z]
|
|
6259
|
+
(0, source_1.str)(/^@+[0-9A-Za-z]*(?:-[0-9A-Za-z]+)*/),
|
|
6260
|
+
(0, source_1.str)(/^(?:[0-9A-Za-z]|[^\x00-\x7F\s])(?=#)/u),
|
|
6263
6261
|
hashtag_1.hashtag,
|
|
6264
6262
|
hashnum_1.hashnum,
|
|
6265
|
-
(0, source_1.str)(
|
|
6263
|
+
(0, source_1.str)(/^#+(?:[0-9A-Za-z'_]|[^\x00-\x7F\s])*/),
|
|
6266
6264
|
anchor_1.anchor
|
|
6267
6265
|
])))), ns => ns.length === 1 ? ns : [(0, util_1.stringify)(ns)]);
|
|
6268
6266
|
},
|
|
@@ -8469,9 +8467,9 @@ require = function () {
|
|
|
8469
8467
|
const combinator_1 = _dereq_('../../combinator');
|
|
8470
8468
|
const str_1 = _dereq_('./str');
|
|
8471
8469
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
8472
|
-
exports.separator = /[\s\x00-\x7F]
|
|
8470
|
+
exports.separator = /[\s\x00-\x7F]|\S#|[、。!?][^\S\n]*(?=\\\n)/;
|
|
8473
8471
|
exports.nonWhitespace = /[\S\n]|$/;
|
|
8474
|
-
exports.nonAlphanumeric = /[^0-9A-Za-z]
|
|
8472
|
+
exports.nonAlphanumeric = /[^0-9A-Za-z]|\S#|$/;
|
|
8475
8473
|
const repeat = (0, str_1.str)(/^(.)\1*/);
|
|
8476
8474
|
exports.text = (0, combinator_1.creator)((source, context) => {
|
|
8477
8475
|
if (source === '')
|
|
@@ -8545,7 +8543,7 @@ require = function () {
|
|
|
8545
8543
|
];
|
|
8546
8544
|
default:
|
|
8547
8545
|
const b = source[0].trimStart() === '';
|
|
8548
|
-
const i = b || isAlphanumeric(source[0]) ? source.search(b ? exports.nonWhitespace : exports.nonAlphanumeric) : 1;
|
|
8546
|
+
const i = b || isAlphanumeric(source[0]) ? source.search(b ? exports.nonWhitespace : exports.nonAlphanumeric) || 1 : 1;
|
|
8549
8547
|
return b && i === source.length || b && source[i] === '\n' || b && source[i] === '\\' && source[i + 1] === '\n' ? [
|
|
8550
8548
|
[],
|
|
8551
8549
|
source.slice(i)
|
|
@@ -8596,7 +8594,7 @@ require = function () {
|
|
|
8596
8594
|
];
|
|
8597
8595
|
case 0: {
|
|
8598
8596
|
const b = source[0] !== '\n' && source[0].trimStart() === '';
|
|
8599
|
-
const i = b || (0, text_1.isAlphanumeric)(source[0]) ? source.search(b ? text_1.nonWhitespace : text_1.nonAlphanumeric) : 1;
|
|
8597
|
+
const i = b || (0, text_1.isAlphanumeric)(source[0]) ? source.search(b ? text_1.nonWhitespace : text_1.nonAlphanumeric) || 1 : 1;
|
|
8600
8598
|
return [
|
|
8601
8599
|
[source.slice(0, i)],
|
|
8602
8600
|
source.slice(i)
|
package/markdown.d.ts
CHANGED
|
@@ -1050,8 +1050,6 @@ export namespace MarkdownParser {
|
|
|
1050
1050
|
AutolinkParser.UrlParser,
|
|
1051
1051
|
AutolinkParser.EmailParser,
|
|
1052
1052
|
SourceParser.StrParser,
|
|
1053
|
-
SourceParser.StrParser,
|
|
1054
|
-
SourceParser.StrParser,
|
|
1055
1053
|
AutolinkParser.ChannelParser,
|
|
1056
1054
|
AutolinkParser.AccountParser,
|
|
1057
1055
|
SourceParser.StrParser,
|
package/package-lock.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "securemark",
|
|
3
|
-
"version": "0.230.
|
|
3
|
+
"version": "0.230.1",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -503,15 +503,15 @@
|
|
|
503
503
|
}
|
|
504
504
|
},
|
|
505
505
|
"@npmcli/run-script": {
|
|
506
|
-
"version": "
|
|
507
|
-
"resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-
|
|
508
|
-
"integrity": "sha512-
|
|
506
|
+
"version": "3.0.0",
|
|
507
|
+
"resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-3.0.0.tgz",
|
|
508
|
+
"integrity": "sha512-jIdmUepw+kVP2WEE/+XrBIvrSF5miDutdGBrQ8May6uHVAvpAb0m3NRHcJ0lKWbQ1BxsRFsmTrjkdY99qTTVIw==",
|
|
509
509
|
"dev": true,
|
|
510
510
|
"requires": {
|
|
511
|
-
"@npmcli/node-gyp": "^1.0.
|
|
511
|
+
"@npmcli/node-gyp": "^1.0.3",
|
|
512
512
|
"@npmcli/promise-spawn": "^1.3.2",
|
|
513
|
-
"node-gyp": "^8.
|
|
514
|
-
"read-package-json-fast": "^2.0.
|
|
513
|
+
"node-gyp": "^8.4.1",
|
|
514
|
+
"read-package-json-fast": "^2.0.3"
|
|
515
515
|
}
|
|
516
516
|
},
|
|
517
517
|
"@sindresorhus/is": {
|
|
@@ -606,9 +606,9 @@
|
|
|
606
606
|
"dev": true
|
|
607
607
|
},
|
|
608
608
|
"@types/node": {
|
|
609
|
-
"version": "17.0.
|
|
610
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.
|
|
611
|
-
"integrity": "sha512-
|
|
609
|
+
"version": "17.0.21",
|
|
610
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz",
|
|
611
|
+
"integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==",
|
|
612
612
|
"dev": true
|
|
613
613
|
},
|
|
614
614
|
"@types/power-assert": {
|
|
@@ -2927,9 +2927,9 @@
|
|
|
2927
2927
|
"dev": true
|
|
2928
2928
|
},
|
|
2929
2929
|
"electron-to-chromium": {
|
|
2930
|
-
"version": "1.4.
|
|
2931
|
-
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.
|
|
2932
|
-
"integrity": "sha512-
|
|
2930
|
+
"version": "1.4.73",
|
|
2931
|
+
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.73.tgz",
|
|
2932
|
+
"integrity": "sha512-RlCffXkE/LliqfA5m29+dVDPB2r72y2D2egMMfIy3Le8ODrxjuZNVo4NIC2yPL01N4xb4nZQLwzi6Z5tGIGLnA==",
|
|
2933
2933
|
"dev": true
|
|
2934
2934
|
},
|
|
2935
2935
|
"elliptic": {
|
|
@@ -3036,9 +3036,9 @@
|
|
|
3036
3036
|
}
|
|
3037
3037
|
},
|
|
3038
3038
|
"engine.io": {
|
|
3039
|
-
"version": "6.1.
|
|
3040
|
-
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.
|
|
3041
|
-
"integrity": "sha512-
|
|
3039
|
+
"version": "6.1.3",
|
|
3040
|
+
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.3.tgz",
|
|
3041
|
+
"integrity": "sha512-rqs60YwkvWTLLnfazqgZqLa/aKo+9cueVfEi/dZ8PyGyaf8TLOxj++4QMIgeG3Gn0AhrWiFXvghsoY9L9h25GA==",
|
|
3042
3042
|
"dev": true,
|
|
3043
3043
|
"requires": {
|
|
3044
3044
|
"@types/cookie": "^0.4.1",
|
|
@@ -3049,7 +3049,7 @@
|
|
|
3049
3049
|
"cookie": "~0.4.1",
|
|
3050
3050
|
"cors": "~2.8.5",
|
|
3051
3051
|
"debug": "~4.3.1",
|
|
3052
|
-
"engine.io-parser": "~5.0.
|
|
3052
|
+
"engine.io-parser": "~5.0.3",
|
|
3053
3053
|
"ws": "~8.2.3"
|
|
3054
3054
|
},
|
|
3055
3055
|
"dependencies": {
|
|
@@ -7530,9 +7530,9 @@
|
|
|
7530
7530
|
}
|
|
7531
7531
|
},
|
|
7532
7532
|
"minimatch": {
|
|
7533
|
-
"version": "5.0.
|
|
7534
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.
|
|
7535
|
-
"integrity": "sha512-
|
|
7533
|
+
"version": "5.0.1",
|
|
7534
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
|
|
7535
|
+
"integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
|
|
7536
7536
|
"dev": true,
|
|
7537
7537
|
"requires": {
|
|
7538
7538
|
"brace-expansion": "^2.0.1"
|
|
@@ -7985,15 +7985,15 @@
|
|
|
7985
7985
|
}
|
|
7986
7986
|
},
|
|
7987
7987
|
"pacote": {
|
|
7988
|
-
"version": "13.0.
|
|
7989
|
-
"resolved": "https://registry.npmjs.org/pacote/-/pacote-13.0.
|
|
7990
|
-
"integrity": "sha512-
|
|
7988
|
+
"version": "13.0.3",
|
|
7989
|
+
"resolved": "https://registry.npmjs.org/pacote/-/pacote-13.0.3.tgz",
|
|
7990
|
+
"integrity": "sha512-8thQ06YoO01O1k5rvSpHS/XPJZucw2DPiiT1jI+ys8QaTN6ifAyxfyoABHBa8nIt/4wPdzly4GEPqshctHFoYA==",
|
|
7991
7991
|
"dev": true,
|
|
7992
7992
|
"requires": {
|
|
7993
7993
|
"@npmcli/git": "^3.0.0",
|
|
7994
7994
|
"@npmcli/installed-package-contents": "^1.0.7",
|
|
7995
7995
|
"@npmcli/promise-spawn": "^1.2.0",
|
|
7996
|
-
"@npmcli/run-script": "^
|
|
7996
|
+
"@npmcli/run-script": "^3.0.0",
|
|
7997
7997
|
"cacache": "^15.3.0",
|
|
7998
7998
|
"chownr": "^2.0.0",
|
|
7999
7999
|
"fs-minipass": "^2.1.0",
|
package/package.json
CHANGED
|
@@ -13,11 +13,11 @@ describe('Unit: parser/autolink', () => {
|
|
|
13
13
|
assert.deepStrictEqual(inspect(parser('@a#b')), [['<a href="/@a?ch=b" class="channel">@a#b</a>'], '']);
|
|
14
14
|
assert.deepStrictEqual(inspect(parser('\\\n')), [['\\', '<br>'], '']);
|
|
15
15
|
assert.deepStrictEqual(inspect(parser('a#b')), [['a#b'], '']);
|
|
16
|
-
assert.deepStrictEqual(inspect(parser('0a#b')), [['
|
|
16
|
+
assert.deepStrictEqual(inspect(parser('0a#b')), [['0', 'a#b'], '']);
|
|
17
17
|
assert.deepStrictEqual(inspect(parser('あ#b')), [['あ#b'], '']);
|
|
18
|
-
assert.deepStrictEqual(inspect(parser('あい#b')), [['
|
|
18
|
+
assert.deepStrictEqual(inspect(parser('あい#b')), [['あ', 'い#b'], '']);
|
|
19
19
|
assert.deepStrictEqual(inspect(parser('0aあ#b')), [['0a', 'あ#b'], '']);
|
|
20
|
-
assert.deepStrictEqual(inspect(parser('0aあい#b')), [['0a', '
|
|
20
|
+
assert.deepStrictEqual(inspect(parser('0aあい#b')), [['0a', 'あ', 'い#b'], '']);
|
|
21
21
|
assert.deepStrictEqual(inspect(parser('a\n#b')), [['a', '<br>', '<a href="/hashtags/b" class="hashtag">#b</a>'], '']);
|
|
22
22
|
assert.deepStrictEqual(inspect(parser('a\\\n#b')), [['a', '\\', '<br>', '<a href="/hashtags/b" class="hashtag">#b</a>'], '']);
|
|
23
23
|
});
|
|
@@ -30,7 +30,7 @@ export const codeblock: CodeBlockParser = block(validate('```', fmap(
|
|
|
30
30
|
translate: 'no',
|
|
31
31
|
'data-invalid-syntax': 'codeblock',
|
|
32
32
|
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
33
|
-
'data-invalid-description': !closer ? `Missing the closing delimiter ${delim}.` : 'Invalid argument.',
|
|
33
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter "${delim}".` : 'Invalid argument.',
|
|
34
34
|
}, `${opener}${body}${closer}`)];
|
|
35
35
|
const file = path.split('/').pop() ?? '';
|
|
36
36
|
const ext = file && file.includes('.', 1)
|
|
@@ -13,7 +13,7 @@ export const aside: ExtensionParser.AsideParser = creator(100, block(validate('~
|
|
|
13
13
|
translate: 'no',
|
|
14
14
|
'data-invalid-syntax': 'aside',
|
|
15
15
|
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
16
|
-
'data-invalid-description': !closer ? `Missing the closing delimiter ${delim}.` : 'Invalid argument.',
|
|
16
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter "${delim}".` : 'Invalid argument.',
|
|
17
17
|
}, `${opener}${body}${closer}`)];
|
|
18
18
|
const annotations = html('ol', { class: 'annotations' });
|
|
19
19
|
const references = html('ol', { class: 'references' });
|
|
@@ -16,7 +16,7 @@ export const example: ExtensionParser.ExampleParser = creator(100, block(validat
|
|
|
16
16
|
translate: 'no',
|
|
17
17
|
'data-invalid-syntax': 'example',
|
|
18
18
|
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
19
|
-
'data-invalid-description': !closer ? `Missing the closing delimiter ${delim}.` : 'Invalid argument.',
|
|
19
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter "${delim}".` : 'Invalid argument.',
|
|
20
20
|
}, `${opener}${body}${closer}`)];
|
|
21
21
|
switch (type) {
|
|
22
22
|
case 'markdown': {
|
|
@@ -25,7 +25,7 @@ export const message: MessageParser = block(validate('~~~', fmap(
|
|
|
25
25
|
translate: 'no',
|
|
26
26
|
'data-invalid-syntax': 'message',
|
|
27
27
|
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
28
|
-
'data-invalid-description': !closer ? `Missing the closing delimiter ${delim}.` : 'Invalid argument.',
|
|
28
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter "${delim}".` : 'Invalid argument.',
|
|
29
29
|
}, `${opener}${body}${closer}`)];
|
|
30
30
|
switch (type) {
|
|
31
31
|
case 'note':
|
|
@@ -18,6 +18,6 @@ export const placeholder: ExtensionParser.PlaceholderParser = block(validate('~~
|
|
|
18
18
|
translate: 'no',
|
|
19
19
|
'data-invalid-syntax': 'extension',
|
|
20
20
|
'data-invalid-type': !closer ? 'closer' : 'syntax',
|
|
21
|
-
'data-invalid-description': !closer ? `Missing the closing delimiter ${delim}.` : 'Invalid syntax.',
|
|
21
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter "${delim}".` : 'Invalid syntax.',
|
|
22
22
|
}, `${opener}${body}${closer}`)
|
|
23
23
|
])));
|
|
@@ -32,7 +32,7 @@ export const table: TableParser = block(validate('~~~', recover(bind(
|
|
|
32
32
|
translate: 'no',
|
|
33
33
|
'data-invalid-syntax': 'table',
|
|
34
34
|
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
35
|
-
'data-invalid-description': !closer ? `Missing the closing delimiter ${delim}.` : 'Invalid argument.',
|
|
35
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter "${delim}".` : 'Invalid argument.',
|
|
36
36
|
}, `${opener}${body}${closer}`)], ''];
|
|
37
37
|
return parser(body, context) ?? [[html('table')], ''];
|
|
38
38
|
}),
|
|
@@ -23,6 +23,6 @@ export const mathblock: MathBlockParser = block(validate('$$', fmap(
|
|
|
23
23
|
translate: 'no',
|
|
24
24
|
'data-invalid-syntax': 'mathblock',
|
|
25
25
|
'data-invalid-type': delim.length > 2 ? 'syntax' : !closer ? 'closer' : 'argument',
|
|
26
|
-
'data-invalid-description': delim.length > 2 ? 'Invalid syntax' : !closer ? `Missing the closing delimiter ${delim}.` : 'Invalid argument.',
|
|
26
|
+
'data-invalid-description': delim.length > 2 ? 'Invalid syntax' : !closer ? `Missing the closing delimiter "${delim}".` : 'Invalid argument.',
|
|
27
27
|
}, `${opener}${body}${closer}`),
|
|
28
28
|
])));
|
|
@@ -50,6 +50,7 @@ describe('Unit: parser/block/olist', () => {
|
|
|
50
50
|
it('multiple', () => {
|
|
51
51
|
// pending
|
|
52
52
|
assert.deepStrictEqual(inspect(parser('0.\n0')), [['<ol><li></li><li></li></ol>'], '']);
|
|
53
|
+
assert.deepStrictEqual(inspect(parser('0.\n0\n')), [['<ol><li></li><li></li></ol>'], '']);
|
|
53
54
|
assert.deepStrictEqual(inspect(parser('0.\n0.')), [['<ol><li></li><li></li></ol>'], '']);
|
|
54
55
|
assert.deepStrictEqual(inspect(parser('0.\n0. ')), [['<ol><li></li><li></li></ol>'], '']);
|
|
55
56
|
assert.deepStrictEqual(inspect(parser('0.\n0.\n')), [['<ol><li></li><li></li></ol>'], '']);
|
|
@@ -58,8 +59,11 @@ describe('Unit: parser/block/olist', () => {
|
|
|
58
59
|
assert.deepStrictEqual(inspect(parser('0. 1\n0. 2\n0. 3')), [['<ol><li>1</li><li>2</li><li>3</li></ol>'], '']);
|
|
59
60
|
// pending
|
|
60
61
|
assert.deepStrictEqual(inspect(parser('(1) \n(')), [['<ol data-format="paren"><li></li><li></li></ol>'], '']);
|
|
62
|
+
assert.deepStrictEqual(inspect(parser('(1) \n(\n')), [['<ol data-format="paren"><li></li><li></li></ol>'], '']);
|
|
61
63
|
assert.deepStrictEqual(inspect(parser('(1) \n(1')), [['<ol data-format="paren"><li></li><li></li></ol>'], '']);
|
|
64
|
+
assert.deepStrictEqual(inspect(parser('(1) \n(1\n')), [['<ol data-format="paren"><li></li><li></li></ol>'], '']);
|
|
62
65
|
assert.deepStrictEqual(inspect(parser('(1) \n(1)')), [['<ol data-format="paren"><li></li><li></li></ol>'], '']);
|
|
66
|
+
assert.deepStrictEqual(inspect(parser('(1) \n(1)\n')), [['<ol data-format="paren"><li></li><li></li></ol>'], '']);
|
|
63
67
|
// filled
|
|
64
68
|
assert.deepStrictEqual(inspect(parser('(1) \n(1) ')), [['<ol data-format="paren"><li></li><li></li></ol>'], '']);
|
|
65
69
|
// invalid
|
|
@@ -16,8 +16,8 @@ const openers = {
|
|
|
16
16
|
|
|
17
17
|
export const olist: OListParser = lazy(() => block(validate(
|
|
18
18
|
[
|
|
19
|
-
/^(
|
|
20
|
-
|
|
19
|
+
/^([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*\.(?=[^\S\n]|\n[^\S\n]*\S)/,
|
|
20
|
+
/^\(([0-9]+|[a-z]+)\)(?:-[0-9]+)*(?=[^\S\n]|\n[^\S\n]*\S)/,
|
|
21
21
|
],
|
|
22
22
|
context({ syntax: { inline: { media: false } } },
|
|
23
23
|
olist_))));
|
|
@@ -35,7 +35,7 @@ const list = (type: string, delim: string): OListParser.ListParser => fmap(
|
|
|
35
35
|
some(creator(union([
|
|
36
36
|
fmap(fallback(
|
|
37
37
|
inits([
|
|
38
|
-
line(open(
|
|
38
|
+
line(open(heads[delim], trim(subsequence([checkbox, trimStart(some(inline))])), true)),
|
|
39
39
|
indent(union([ulist_, olist_, ilist_])),
|
|
40
40
|
]),
|
|
41
41
|
iitem),
|
|
@@ -43,13 +43,13 @@ const list = (type: string, delim: string): OListParser.ListParser => fmap(
|
|
|
43
43
|
]))),
|
|
44
44
|
es => [format(html('ol', es), type, delim)]);
|
|
45
45
|
|
|
46
|
-
const
|
|
46
|
+
const heads = {
|
|
47
47
|
'.': focus(
|
|
48
48
|
openers['.'],
|
|
49
49
|
(source: string) => [[`${source.split('.', 1)[0]}.`], '']),
|
|
50
50
|
'(': focus(
|
|
51
51
|
openers['('],
|
|
52
|
-
(source: string) => [[source.
|
|
52
|
+
(source: string) => [[source.replace(/^\($/, '(1)').replace(/^\((\w+)$/, '($1)')], '']),
|
|
53
53
|
} as const;
|
|
54
54
|
|
|
55
55
|
const iitem = rewrite(contentline, source => [[
|
|
@@ -58,7 +58,7 @@ const iitem = rewrite(contentline, source => [[
|
|
|
58
58
|
class: 'invalid',
|
|
59
59
|
'data-invalid-syntax': 'listitem',
|
|
60
60
|
'data-invalid-type': 'syntax',
|
|
61
|
-
'data-invalid-description': 'Fix the indent or the head of list
|
|
61
|
+
'data-invalid-description': 'Fix the indent or the head of the list item.',
|
|
62
62
|
}, source.replace('\n', ''))
|
|
63
63
|
], '']);
|
|
64
64
|
|
|
@@ -26,7 +26,7 @@ export const quote: ParagraphParser.MentionParser.QuoteParser = lazy(() => creat
|
|
|
26
26
|
class: 'quote invalid',
|
|
27
27
|
'data-invalid-syntax': 'quote',
|
|
28
28
|
'data-invalid-type': 'syntax',
|
|
29
|
-
'data-invalid-description': `Missing the whitespace after ${ns[0].split(/[^>]/, 1)[0]}.`,
|
|
29
|
+
'data-invalid-description': `Missing the whitespace after "${ns[0].split(/[^>]/, 1)[0]}".`,
|
|
30
30
|
},
|
|
31
31
|
ns),
|
|
32
32
|
html('br'),
|
|
@@ -36,7 +36,7 @@ const iitem = rewrite(contentline, source => [[
|
|
|
36
36
|
class: 'invalid',
|
|
37
37
|
'data-invalid-syntax': 'listitem',
|
|
38
38
|
'data-invalid-type': 'syntax',
|
|
39
|
-
'data-invalid-description': 'Fix the indent or the head of list
|
|
39
|
+
'data-invalid-description': 'Fix the indent or the head of the list item.',
|
|
40
40
|
}, source.replace('\n', ''))
|
|
41
41
|
], '']);
|
|
42
42
|
|
|
@@ -11,26 +11,23 @@ import { str } from '../source';
|
|
|
11
11
|
import { stringify } from '../util';
|
|
12
12
|
|
|
13
13
|
export const autolink: AutolinkParser = fmap(
|
|
14
|
-
validate(/^(?:[@#>0-9A-Za-z]
|
|
14
|
+
validate(/^(?:[@#>0-9A-Za-z]|\S#)/,
|
|
15
15
|
guard(context => context.syntax?.inline?.autolink ?? true,
|
|
16
16
|
some(union([
|
|
17
17
|
url,
|
|
18
18
|
email,
|
|
19
19
|
// Escape unmatched email-like strings.
|
|
20
20
|
str(/^[0-9A-Za-z]+(?:[.+_-][0-9A-Za-z]+)*(?:@(?:[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?)+/),
|
|
21
|
-
// Escape repeated symbols.
|
|
22
|
-
str(/^@+(?![0-9A-Za-z]|[^\x00-\x7F\s])/),
|
|
23
|
-
str(/^#+(?![0-9A-Za-z'_]|[^\x00-\x7F\s])/),
|
|
24
21
|
channel,
|
|
25
22
|
account,
|
|
26
23
|
// Escape unmatched account-like strings.
|
|
27
|
-
str(
|
|
24
|
+
str(/^@+[0-9A-Za-z]*(?:-[0-9A-Za-z]+)*/),
|
|
28
25
|
// Escape invalid leading characters.
|
|
29
|
-
str(/^[0-9A-Za-z]
|
|
26
|
+
str(/^(?:[0-9A-Za-z]|[^\x00-\x7F\s])(?=#)/u),
|
|
30
27
|
hashtag,
|
|
31
28
|
hashnum,
|
|
32
29
|
// Escape unmatched hashtag-like strings.
|
|
33
|
-
str(
|
|
30
|
+
str(/^#+(?:[0-9A-Za-z'_]|[^\x00-\x7F\s])*/),
|
|
34
31
|
anchor,
|
|
35
32
|
])))),
|
|
36
33
|
ns => ns.length === 1 ? ns : [stringify(ns)]);
|
|
@@ -168,11 +168,11 @@ describe('Unit: parser/inline', () => {
|
|
|
168
168
|
assert.deepStrictEqual(inspect(parser('#a\nb\n#c\n[#d]')), [['<a href="/hashtags/a" class="hashtag">#a</a>', '<br>', 'b', '<br>', '<a href="/hashtags/c" class="hashtag">#c</a>', '<br>', '<a class="index" href="#index:d">d</a>'], '']);
|
|
169
169
|
assert.deepStrictEqual(inspect(parser('##a')), [['##a'], '']);
|
|
170
170
|
assert.deepStrictEqual(inspect(parser('a#b')), [['a#b'], '']);
|
|
171
|
-
assert.deepStrictEqual(inspect(parser('0a#b')), [['
|
|
171
|
+
assert.deepStrictEqual(inspect(parser('0a#b')), [['0', 'a#b'], '']);
|
|
172
172
|
assert.deepStrictEqual(inspect(parser('あ#b')), [['あ#b'], '']);
|
|
173
|
-
assert.deepStrictEqual(inspect(parser('あい#b')), [['
|
|
173
|
+
assert.deepStrictEqual(inspect(parser('あい#b')), [['あ', 'い#b'], '']);
|
|
174
174
|
assert.deepStrictEqual(inspect(parser('0aあ#b')), [['0a', 'あ#b'], '']);
|
|
175
|
-
assert.deepStrictEqual(inspect(parser('0aあい#b')), [['0a', '
|
|
175
|
+
assert.deepStrictEqual(inspect(parser('0aあい#b')), [['0a', 'あ', 'い#b'], '']);
|
|
176
176
|
assert.deepStrictEqual(inspect(parser('a\n#b')), [['a', '<br>', '<a href="/hashtags/b" class="hashtag">#b</a>'], '']);
|
|
177
177
|
assert.deepStrictEqual(inspect(parser('a\\\n#b')), [['a', '<span class="linebreak"> </span>', '<a href="/hashtags/b" class="hashtag">#b</a>'], '']);
|
|
178
178
|
assert.deepStrictEqual(inspect(parser('*a*#b')), [['<em>a</em>', '<a href="/hashtags/b" class="hashtag">#b</a>'], '']);
|
|
@@ -4,9 +4,9 @@ import { union, focus, creator } from '../../combinator';
|
|
|
4
4
|
import { str } from './str';
|
|
5
5
|
import { html } from 'typed-dom';
|
|
6
6
|
|
|
7
|
-
export const separator = /[\s\x00-\x7F]
|
|
7
|
+
export const separator = /[\s\x00-\x7F]|\S#|[、。!?][^\S\n]*(?=\\\n)/;
|
|
8
8
|
export const nonWhitespace = /[\S\n]|$/;
|
|
9
|
-
export const nonAlphanumeric = /[^0-9A-Za-z]
|
|
9
|
+
export const nonAlphanumeric = /[^0-9A-Za-z]|\S#|$/;
|
|
10
10
|
const repeat = str(/^(.)\1*/);
|
|
11
11
|
|
|
12
12
|
export const text: TextParser = creator((source, context) => {
|
|
@@ -59,7 +59,7 @@ export const text: TextParser = creator((source, context) => {
|
|
|
59
59
|
assert(source[0] !== '\n');
|
|
60
60
|
const b = source[0].trimStart() === '';
|
|
61
61
|
const i = b || isAlphanumeric(source[0])
|
|
62
|
-
? source.search(b ? nonWhitespace : nonAlphanumeric)
|
|
62
|
+
? source.search(b ? nonWhitespace : nonAlphanumeric) || 1
|
|
63
63
|
: 1;
|
|
64
64
|
assert(i > 0);
|
|
65
65
|
assert(!['\\', '\n'].includes(source[0]));
|
|
@@ -12,7 +12,7 @@ export const unescsource: UnescapableSourceParser = creator(source => {
|
|
|
12
12
|
case 0: {
|
|
13
13
|
const b = source[0] !== '\n' && source[0].trimStart() === '';
|
|
14
14
|
const i = b || isAlphanumeric(source[0])
|
|
15
|
-
? source.search(b ? nonWhitespace : nonAlphanumeric)
|
|
15
|
+
? source.search(b ? nonWhitespace : nonAlphanumeric) || 1
|
|
16
16
|
: 1;
|
|
17
17
|
assert(i > 0);
|
|
18
18
|
return [[source.slice(0, i)], source.slice(i)];
|