securemark 0.225.1 → 0.226.2
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 +16 -0
- package/design.md +8 -6
- package/dist/securemark.js +92 -61
- package/markdown.d.ts +14 -5
- package/package-lock.json +72 -92
- package/package.json +1 -1
- package/src/combinator/control/manipulation/scope.ts +1 -0
- package/src/parser/api/normalize.ts +2 -2
- package/src/parser/block/codeblock.ts +2 -2
- package/src/parser/block/extension/aside.ts +2 -2
- package/src/parser/block/extension/example.ts +2 -2
- package/src/parser/block/extension/message.ts +2 -2
- package/src/parser/block/extension/placeholder.ts +2 -2
- package/src/parser/block/extension/table.ts +2 -2
- package/src/parser/block/mathblock.test.ts +4 -3
- package/src/parser/block/mathblock.ts +6 -6
- package/src/parser/inline/bracket.ts +3 -3
- package/src/parser/inline/code.ts +1 -1
- package/src/parser/inline/emphasis.test.ts +4 -1
- package/src/parser/inline/extension/index.test.ts +1 -1
- package/src/parser/inline/extension/label.ts +2 -2
- package/src/parser/inline/html.ts +1 -1
- package/src/parser/inline/htmlentity.test.ts +1 -0
- package/src/parser/inline/htmlentity.ts +19 -4
- package/src/parser/inline/link.test.ts +1 -1
- package/src/parser/inline/mark.test.ts +2 -0
- package/src/parser/inline/math.test.ts +38 -32
- package/src/parser/inline/math.ts +6 -8
- package/src/parser/inline/media.ts +6 -6
- package/src/parser/inline/ruby.ts +14 -10
- package/src/parser/inline/strong.test.ts +5 -3
- package/src/parser/inline.ts +1 -0
- package/src/parser/processor/footnote.ts +11 -0
- package/src/parser/source/escapable.test.ts +9 -1
- package/src/parser/source/escapable.ts +7 -1
- package/src/parser/source/text.test.ts +2 -3
- package/src/parser/source/text.ts +1 -0
- package/src/parser/source/unescapable.test.ts +9 -0
- package/src/parser/util.ts +13 -9
package/CHANGELOG.md
CHANGED
package/design.md
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
### 自己完結性
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
ドキュメントはすべて初期(共通)構成の閲覧環境で閲覧できなければならない。
|
|
73
73
|
よって閲覧に拡張機能等の追加が必要となってはならない
|
|
74
74
|
|
|
75
75
|
ゆえにドキュメントはサードパーティツールなど自己完結性を損なうツールの使用をサポートしない。
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
|
|
140
140
|
オートリンクは原則としてコピー&ペーストによる引用等を経た際にその解釈が変わってはならない。
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
ゆえにハッシュタグ構文は構文が表示文字列と一致する構文であるオートリンク構文としてのみ構文化され、表示文字列からの構文の範囲の特定が不可能となる通常の構文を持たない。
|
|
143
143
|
|
|
144
144
|
### 自動附番
|
|
145
145
|
|
|
@@ -152,7 +152,9 @@
|
|
|
152
152
|
|
|
153
153
|
構文はその使用のために羅列的知識を求めてはならない。
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
ゆえにバックスラッシュエスケープの特殊処理の対象は改行文字のみに限られる。
|
|
156
|
+
またURL構文はHTMLエンティティの参照の有効性を検査しない。
|
|
157
|
+
HTMLEntity構文はエンティティ追加時の互換性確保のため不正なエンティティを検出する。
|
|
156
158
|
|
|
157
159
|
### テンプレート対応
|
|
158
160
|
|
|
@@ -277,7 +279,7 @@ CodeMirrorが素では速いがVimModeでは数万文字程度でも耐え難く
|
|
|
277
279
|
### バックトラック
|
|
278
280
|
|
|
279
281
|
SecuremarkのAnnotation構文に典型的であるようにスコープの生成規則を変える構文が存在する場合文脈の相違から解析結果を再利用不能な(`αA'β | αAB`)バックトラックが再帰的に生じ、このような言語を線形時間で解析することは基本的に不可能であり直ちに文脈を確定する任意の構文または記号の前に文脈の差異が生じない(`αAβ | αAB`)場合のみ再利用可能なバックトラックにより線形時間で解析できると思われる。
|
|
280
|
-
このため線形時間で解析可能な文法に制約されるCommonMark
|
|
282
|
+
このため線形時間で解析可能な文法に制約されるCommonMarkがこの制約を破らずこのような文脈不確定文法を導入することは不可能であるという拡張性の限界が存在する。
|
|
281
283
|
|
|
282
284
|
### 標準化
|
|
283
285
|
|
|
@@ -285,8 +287,8 @@ Markdownのように自然言語と自身の文法を分離する汎用構造が
|
|
|
285
287
|
このためCommonMarkは拡張構文を標準化した次期標準仕様との互換性を確保する役には立たずその有用性は構文の拡張を考慮しない範囲での効率的な実装方法の例示およびテストケースの集積による個別実装の支援ならびにその結果としての限定的互換性にとどまる。
|
|
286
288
|
さらにCommonMarkは前述の解析時間の制約から拡張性が低く、高度な構文や機能の実装可能性を考慮していないことから拡張仕様において準拠すべき技術的正当性もない。
|
|
287
289
|
|
|
288
|
-
よってMarkdown
|
|
289
|
-
MarkdownはGFM
|
|
290
|
+
よってMarkdownの標準化は後方互換性確保が不可能であることから発展性がなくスナップショット以上の技術的意味を持たない。
|
|
291
|
+
MarkdownはGFMのように最初から高機能で完成度の高い拡張不要な独自実装のほうが標準としての互換性を確保でき、構文に曖昧さがない形式言語と異なりまず最小限の標準仕様を策定しのちに拡張していく通常の標準化方法が適さない特殊な言語である。
|
|
290
292
|
|
|
291
293
|
### トランスクルージョン
|
|
292
294
|
|
package/dist/securemark.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.
|
|
1
|
+
/*! securemark v0.226.2 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) {
|
|
@@ -4760,7 +4760,7 @@ require = function () {
|
|
|
4760
4760
|
'InvisibleComma',
|
|
4761
4761
|
'ic'
|
|
4762
4762
|
];
|
|
4763
|
-
const unreadableEscapableCharacters = unreadableHTMLEntityNames.flatMap(name => (0, parser_1.eval)((0, htmlentity_1.
|
|
4763
|
+
const unreadableEscapableCharacters = unreadableHTMLEntityNames.flatMap(name => (0, parser_1.eval)((0, htmlentity_1.unsafehtmlentity)(`&${ name };`, {}), []));
|
|
4764
4764
|
const unreadableEscapableCharacter = new RegExp(`[${ [...new Set(unreadableEscapableCharacters)].join('') }]`, 'g');
|
|
4765
4765
|
const unreadableSpecialCharacters = [
|
|
4766
4766
|
'\u2006',
|
|
@@ -5038,8 +5038,8 @@ require = function () {
|
|
|
5038
5038
|
class: 'invalid',
|
|
5039
5039
|
translate: 'no',
|
|
5040
5040
|
'data-invalid-syntax': 'codeblock',
|
|
5041
|
-
'data-invalid-type': closer ? '
|
|
5042
|
-
'data-invalid-description': closer ?
|
|
5041
|
+
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
5042
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
|
|
5043
5043
|
}, `${ opener }${ body }${ closer }`)];
|
|
5044
5044
|
const file = (_a = path.split('/').pop()) !== null && _a !== void 0 ? _a : '';
|
|
5045
5045
|
const ext = file && file.includes('.', 1) ? file.split('.').pop() : '';
|
|
@@ -5176,8 +5176,8 @@ require = function () {
|
|
|
5176
5176
|
class: 'invalid',
|
|
5177
5177
|
translate: 'no',
|
|
5178
5178
|
'data-invalid-syntax': 'aside',
|
|
5179
|
-
'data-invalid-type': closer ? '
|
|
5180
|
-
'data-invalid-description': closer ?
|
|
5179
|
+
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
5180
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
|
|
5181
5181
|
}, `${ opener }${ body }${ closer }`)];
|
|
5182
5182
|
const annotations = (0, typed_dom_1.html)('ol', { class: 'annotations' });
|
|
5183
5183
|
const references = (0, typed_dom_1.html)('ol', { class: 'references' });
|
|
@@ -5231,8 +5231,8 @@ require = function () {
|
|
|
5231
5231
|
class: 'invalid',
|
|
5232
5232
|
translate: 'no',
|
|
5233
5233
|
'data-invalid-syntax': 'example',
|
|
5234
|
-
'data-invalid-type': closer ? '
|
|
5235
|
-
'data-invalid-description': closer ?
|
|
5234
|
+
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
5235
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
|
|
5236
5236
|
}, `${ opener }${ body }${ closer }`)];
|
|
5237
5237
|
switch (type) {
|
|
5238
5238
|
case 'markdown': {
|
|
@@ -5488,8 +5488,8 @@ require = function () {
|
|
|
5488
5488
|
class: 'invalid',
|
|
5489
5489
|
translate: 'no',
|
|
5490
5490
|
'data-invalid-syntax': 'message',
|
|
5491
|
-
'data-invalid-type': closer ? '
|
|
5492
|
-
'data-invalid-description': closer ?
|
|
5491
|
+
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
5492
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
|
|
5493
5493
|
}, `${ opener }${ body }${ closer }`)];
|
|
5494
5494
|
switch (type) {
|
|
5495
5495
|
case 'note':
|
|
@@ -5559,8 +5559,8 @@ require = function () {
|
|
|
5559
5559
|
class: 'invalid',
|
|
5560
5560
|
translate: 'no',
|
|
5561
5561
|
'data-invalid-syntax': 'extension',
|
|
5562
|
-
'data-invalid-type': closer ? '
|
|
5563
|
-
'data-invalid-description': closer ?
|
|
5562
|
+
'data-invalid-type': !closer ? 'closer' : 'syntax',
|
|
5563
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid syntax.'
|
|
5564
5564
|
}, `${ opener }${ body }${ closer }`)])));
|
|
5565
5565
|
},
|
|
5566
5566
|
{
|
|
@@ -5593,8 +5593,8 @@ require = function () {
|
|
|
5593
5593
|
class: 'invalid',
|
|
5594
5594
|
translate: 'no',
|
|
5595
5595
|
'data-invalid-syntax': 'table',
|
|
5596
|
-
'data-invalid-type': closer ? '
|
|
5597
|
-
'data-invalid-description': closer ?
|
|
5596
|
+
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
5597
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
|
|
5598
5598
|
}, `${ opener }${ body }${ closer }`)],
|
|
5599
5599
|
''
|
|
5600
5600
|
];
|
|
@@ -5957,7 +5957,7 @@ require = function () {
|
|
|
5957
5957
|
const global_1 = _dereq_('spica/global');
|
|
5958
5958
|
const combinator_1 = _dereq_('../../combinator');
|
|
5959
5959
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
5960
|
-
const opener = /^(
|
|
5960
|
+
const opener = /^(\${2,})(?!\$)([^\n]*)(?:$|\n)/;
|
|
5961
5961
|
exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 100))));
|
|
5962
5962
|
exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 100, false))), false);
|
|
5963
5963
|
exports.mathblock = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0, combinator_1.fmap)((0, combinator_1.fence)(opener, 100), ([body, closer, opener, delim, param], _, {
|
|
@@ -5966,15 +5966,15 @@ require = function () {
|
|
|
5966
5966
|
} = {}
|
|
5967
5967
|
}) => {
|
|
5968
5968
|
var _a;
|
|
5969
|
-
return [closer && param.trimStart() === '' ? ((_a = cache === null || cache === void 0 ? void 0 : cache.get(
|
|
5969
|
+
return [delim.length === 2 && closer && param.trimStart() === '' ? ((_a = cache === null || cache === void 0 ? void 0 : cache.get(`\n${ body }`)) === null || _a === void 0 ? void 0 : _a.cloneNode(true)) || (0, typed_dom_1.html)('div', {
|
|
5970
5970
|
class: 'math',
|
|
5971
5971
|
translate: 'no'
|
|
5972
|
-
},
|
|
5972
|
+
}, `${ delim }\n${ body }${ delim }`) : (0, typed_dom_1.html)('pre', {
|
|
5973
5973
|
class: 'invalid',
|
|
5974
5974
|
translate: 'no',
|
|
5975
5975
|
'data-invalid-syntax': 'mathblock',
|
|
5976
|
-
'data-invalid-type':
|
|
5977
|
-
'data-invalid-description':
|
|
5976
|
+
'data-invalid-type': delim.length > 2 ? 'syntax' : !closer ? 'closer' : 'argument',
|
|
5977
|
+
'data-invalid-description': delim.length > 2 ? 'Invalid syntax' : !closer ? `Missing the closing delimiter ${ delim }.` : 'Invalid argument.'
|
|
5978
5978
|
}, `${ opener }${ body }${ closer }`)];
|
|
5979
5979
|
})));
|
|
5980
5980
|
},
|
|
@@ -6844,13 +6844,7 @@ require = function () {
|
|
|
6844
6844
|
/[0-9]{1,4}|[A-Za-z]/
|
|
6845
6845
|
].map(r => r.source).join('|') })`);
|
|
6846
6846
|
const indexFW = new RegExp(index.source.replace(/[019AZaz](?!,)/g, c => String.fromCharCode(c.charCodeAt(0) + 65248)));
|
|
6847
|
-
exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6848
|
-
'(',
|
|
6849
|
-
'\uFF08',
|
|
6850
|
-
'[',
|
|
6851
|
-
'{',
|
|
6852
|
-
'"'
|
|
6853
|
-
], (0, combinator_1.union)([
|
|
6847
|
+
exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([
|
|
6854
6848
|
(0, combinator_1.surround)((0, source_1.str)('('), (0, source_1.str)(index), (0, source_1.str)(')'), false, ([as, bs = [], cs], rest) => [
|
|
6855
6849
|
(0, typed_dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)),
|
|
6856
6850
|
rest
|
|
@@ -6885,7 +6879,7 @@ require = function () {
|
|
|
6885
6879
|
(0, array_1.unshift)(as, bs),
|
|
6886
6880
|
rest
|
|
6887
6881
|
])
|
|
6888
|
-
]))
|
|
6882
|
+
]));
|
|
6889
6883
|
},
|
|
6890
6884
|
{
|
|
6891
6885
|
'../../combinator': 30,
|
|
@@ -6903,7 +6897,7 @@ require = function () {
|
|
|
6903
6897
|
exports.code = void 0;
|
|
6904
6898
|
const combinator_1 = _dereq_('../../combinator');
|
|
6905
6899
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
6906
|
-
exports.code = (0, combinator_1.creator)((0, combinator_1.validate)('`',
|
|
6900
|
+
exports.code = (0, combinator_1.creator)((0, combinator_1.validate)('`', (0, combinator_1.match)(/^(`+)(?!`)([^\n]*?[^`\n])\1(?!`)/, ([whole, , body]) => rest => [
|
|
6907
6901
|
[(0, typed_dom_1.html)('code', { 'data-src': whole }, format(body))],
|
|
6908
6902
|
rest
|
|
6909
6903
|
])));
|
|
@@ -7301,14 +7295,14 @@ require = function () {
|
|
|
7301
7295
|
exports.segment = (0, combinator_1.clear)((0, combinator_1.validate)([
|
|
7302
7296
|
'[$',
|
|
7303
7297
|
'$'
|
|
7304
|
-
],
|
|
7298
|
+
], (0, combinator_1.union)([
|
|
7305
7299
|
(0, combinator_1.surround)('[', body, ']'),
|
|
7306
7300
|
body
|
|
7307
7301
|
])));
|
|
7308
7302
|
exports.label = (0, combinator_1.creator)((0, combinator_1.validate)([
|
|
7309
7303
|
'[$',
|
|
7310
7304
|
'$'
|
|
7311
|
-
],
|
|
7305
|
+
], (0, combinator_1.fmap)((0, combinator_1.guard)(context => {
|
|
7312
7306
|
var _a, _b, _c;
|
|
7313
7307
|
return (_c = (_b = (_a = context.syntax) === null || _a === void 0 ? void 0 : _a.inline) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : true;
|
|
7314
7308
|
}, (0, combinator_1.union)([
|
|
@@ -7413,7 +7407,7 @@ require = function () {
|
|
|
7413
7407
|
};
|
|
7414
7408
|
(0, alias_1.ObjectSetPrototypeOf)(attrspec, null);
|
|
7415
7409
|
(0, alias_1.ObjectValues)(attrspec).forEach(o => (0, alias_1.ObjectSetPrototypeOf)(o, null));
|
|
7416
|
-
exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.validate)('<',
|
|
7410
|
+
exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.validate)('<', (0, combinator_1.validate)(/^<[a-z]+(?=[^\S\n]|>)/, (0, combinator_1.union)([
|
|
7417
7411
|
(0, combinator_1.match)(/^(?=<(wbr)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)((0, source_1.str)(`<${ tag }`), (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), (0, source_1.str)('>'), true, ([, as = []], rest) => [
|
|
7418
7412
|
[(0, typed_dom_1.html)(tag, attributes('html', [], attrspec[tag], as))],
|
|
7419
7413
|
rest
|
|
@@ -7535,14 +7529,26 @@ require = function () {
|
|
|
7535
7529
|
function (_dereq_, module, exports) {
|
|
7536
7530
|
'use strict';
|
|
7537
7531
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7538
|
-
exports.htmlentity = void 0;
|
|
7532
|
+
exports.htmlentity = exports.unsafehtmlentity = void 0;
|
|
7539
7533
|
const combinator_1 = _dereq_('../../combinator');
|
|
7540
7534
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
7541
7535
|
const parser = (0, typed_dom_1.html)('textarea');
|
|
7542
|
-
exports.
|
|
7536
|
+
exports.unsafehtmlentity = (0, combinator_1.creator)((0, combinator_1.validate)('&', (0, combinator_1.verify)((0, combinator_1.focus)(/^&[0-9A-Za-z]+;/, entity => [
|
|
7543
7537
|
[(parser.innerHTML = entity, parser.value)],
|
|
7544
7538
|
''
|
|
7545
|
-
])));
|
|
7539
|
+
]), ([str]) => str[0] !== '&' || str.length < 3)));
|
|
7540
|
+
exports.htmlentity = (0, combinator_1.creator)((0, combinator_1.validate)('&', (0, combinator_1.focus)(/^&[0-9A-Za-z]+;/, (0, combinator_1.union)([
|
|
7541
|
+
exports.unsafehtmlentity,
|
|
7542
|
+
str => [
|
|
7543
|
+
[(0, typed_dom_1.html)('span', {
|
|
7544
|
+
class: 'invalid',
|
|
7545
|
+
'data-invalid-syntax': 'htmlentity',
|
|
7546
|
+
'data-invalid-type': 'syntax',
|
|
7547
|
+
'data-invalid-description': 'Invalid HTML entity.'
|
|
7548
|
+
}, str)],
|
|
7549
|
+
''
|
|
7550
|
+
]
|
|
7551
|
+
]))));
|
|
7546
7552
|
},
|
|
7547
7553
|
{
|
|
7548
7554
|
'../../combinator': 30,
|
|
@@ -7762,9 +7768,9 @@ require = function () {
|
|
|
7762
7768
|
const util_1 = _dereq_('../util');
|
|
7763
7769
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
7764
7770
|
const disallowedCommand = /\\(?:begin|tiny|huge|large)(?![0-9a-z])/i;
|
|
7765
|
-
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.validate)('$',
|
|
7766
|
-
(0, combinator_1.surround)('$',
|
|
7767
|
-
(0, combinator_1.surround)('$',
|
|
7771
|
+
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.validate)('$', (0, combinator_1.rewrite)((0, combinator_1.union)([
|
|
7772
|
+
(0, combinator_1.surround)('$', (0, combinator_1.verify)((0, source_1.str)(/^(?![\s{}#$%&]|\d+(?:[,.]\d+)*[^-+*/=<>^_~\\$]|-[\da-z]|[a-z]+-)(?:\\\$|[\x20-\x23\x25-\x7E])+/i), util_1.isEndTightNodes), /^\$(?![0-9a-z])/i),
|
|
7773
|
+
(0, combinator_1.surround)('$', bracket, '$')
|
|
7768
7774
|
]), (source, {
|
|
7769
7775
|
caches: {math: cache} = {}
|
|
7770
7776
|
}) => {
|
|
@@ -7786,7 +7792,7 @@ require = function () {
|
|
|
7786
7792
|
}))));
|
|
7787
7793
|
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)('{', (0, combinator_1.some)((0, combinator_1.union)([
|
|
7788
7794
|
bracket,
|
|
7789
|
-
(0, combinator_1.some)(source_1.escsource, /^[{}]/)
|
|
7795
|
+
(0, combinator_1.some)(source_1.escsource, /^(?:[{}]|\\?\n)/)
|
|
7790
7796
|
])), '}', true)));
|
|
7791
7797
|
},
|
|
7792
7798
|
{
|
|
@@ -7826,7 +7832,7 @@ require = function () {
|
|
|
7826
7832
|
return (_c = (_b = (_a = context.syntax) === null || _a === void 0 ? void 0 : _a.inline) === null || _b === void 0 ? void 0 : _b.media) !== null && _c !== void 0 ? _c : true;
|
|
7827
7833
|
}, (0, combinator_1.tails)([
|
|
7828
7834
|
(0, combinator_1.dup)((0, combinator_1.surround)(/^\[(?!\s*\\\s)/, (0, combinator_1.some)((0, combinator_1.union)([
|
|
7829
|
-
htmlentity_1.
|
|
7835
|
+
htmlentity_1.unsafehtmlentity,
|
|
7830
7836
|
bracket,
|
|
7831
7837
|
source_1.txt
|
|
7832
7838
|
]), ']', /^\\?\n/), ']', true)),
|
|
@@ -7866,7 +7872,7 @@ require = function () {
|
|
|
7866
7872
|
})));
|
|
7867
7873
|
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([
|
|
7868
7874
|
(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([
|
|
7869
|
-
htmlentity_1.
|
|
7875
|
+
htmlentity_1.unsafehtmlentity,
|
|
7870
7876
|
bracket,
|
|
7871
7877
|
source_1.txt
|
|
7872
7878
|
]), ')'), (0, source_1.str)(')'), true, global_1.undefined, ([as, bs = []], rest) => [
|
|
@@ -7874,7 +7880,7 @@ require = function () {
|
|
|
7874
7880
|
rest
|
|
7875
7881
|
]),
|
|
7876
7882
|
(0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([
|
|
7877
|
-
htmlentity_1.
|
|
7883
|
+
htmlentity_1.unsafehtmlentity,
|
|
7878
7884
|
bracket,
|
|
7879
7885
|
source_1.txt
|
|
7880
7886
|
]), ']'), (0, source_1.str)(']'), true, global_1.undefined, ([as, bs = []], rest) => [
|
|
@@ -7882,7 +7888,7 @@ require = function () {
|
|
|
7882
7888
|
rest
|
|
7883
7889
|
]),
|
|
7884
7890
|
(0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([
|
|
7885
|
-
htmlentity_1.
|
|
7891
|
+
htmlentity_1.unsafehtmlentity,
|
|
7886
7892
|
bracket,
|
|
7887
7893
|
source_1.txt
|
|
7888
7894
|
]), '}'), (0, source_1.str)('}'), true, global_1.undefined, ([as, bs = []], rest) => [
|
|
@@ -7890,7 +7896,7 @@ require = function () {
|
|
|
7890
7896
|
rest
|
|
7891
7897
|
]),
|
|
7892
7898
|
(0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.some)((0, combinator_1.union)([
|
|
7893
|
-
htmlentity_1.
|
|
7899
|
+
htmlentity_1.unsafehtmlentity,
|
|
7894
7900
|
source_1.txt
|
|
7895
7901
|
]), '"'), (0, source_1.str)('"'), true)
|
|
7896
7902
|
]));
|
|
@@ -8051,18 +8057,20 @@ require = function () {
|
|
|
8051
8057
|
const acc = [''];
|
|
8052
8058
|
while (source !== '') {
|
|
8053
8059
|
switch (source[0]) {
|
|
8054
|
-
case ' ':
|
|
8055
|
-
case '\u3000':
|
|
8056
|
-
acc.push('');
|
|
8057
|
-
source = source.slice(1);
|
|
8058
|
-
continue;
|
|
8059
8060
|
case '&': {
|
|
8060
|
-
const result = (0, htmlentity_1.
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8061
|
+
const result = (0, htmlentity_1.unsafehtmlentity)(source, context);
|
|
8062
|
+
if (result) {
|
|
8063
|
+
acc[acc.length - 1] += (0, parser_1.eval)(result, [source[0]])[0];
|
|
8064
|
+
source = (0, parser_1.exec)(result, source.slice(1));
|
|
8065
|
+
continue;
|
|
8066
|
+
}
|
|
8064
8067
|
}
|
|
8065
8068
|
default: {
|
|
8069
|
+
if (source[0].trimStart() === '') {
|
|
8070
|
+
acc.push('');
|
|
8071
|
+
source = source.slice(1);
|
|
8072
|
+
continue;
|
|
8073
|
+
}
|
|
8066
8074
|
const result = (0, source_1.text)(source, context);
|
|
8067
8075
|
acc[acc.length - 1] += (_a = (0, parser_1.eval)(result)[0]) !== null && _a !== void 0 ? _a : source.slice(0, source.length - (0, parser_1.exec)(result).length);
|
|
8068
8076
|
source = (0, parser_1.exec)(result);
|
|
@@ -8417,6 +8425,7 @@ require = function () {
|
|
|
8417
8425
|
const buffer = new multimap_1.MultiMap();
|
|
8418
8426
|
const titles = new global_1.Map();
|
|
8419
8427
|
const check = footnotes.some(el => target.contains(el));
|
|
8428
|
+
let style;
|
|
8420
8429
|
for (let refs = target.querySelectorAll(`sup.${ syntax }:not(.disabled)`), i = 0, len = refs.length; i < len; ++i) {
|
|
8421
8430
|
yield;
|
|
8422
8431
|
const ref = refs[i];
|
|
@@ -8425,6 +8434,15 @@ require = function () {
|
|
|
8425
8434
|
const identifier = identify(ref);
|
|
8426
8435
|
const abbr = ref.getAttribute('data-abbr') || global_1.undefined;
|
|
8427
8436
|
const content = contentify(ref);
|
|
8437
|
+
style !== null && style !== void 0 ? style : style = abbr ? 'abbr' : 'count';
|
|
8438
|
+
if (style === 'count' ? abbr : !abbr) {
|
|
8439
|
+
(0, typed_dom_1.define)(ref, {
|
|
8440
|
+
class: `${ ref.className } invalid`,
|
|
8441
|
+
'data-invalid-syntax': syntax,
|
|
8442
|
+
'data-invalid-type': 'style',
|
|
8443
|
+
'data-invalid-description': `${ syntax[0].toUpperCase() + syntax.slice(1) } style must be consistent.`
|
|
8444
|
+
});
|
|
8445
|
+
}
|
|
8428
8446
|
if (((_a = ref.firstElementChild) === null || _a === void 0 ? void 0 : _a.getAttribute('hidden')) !== '') {
|
|
8429
8447
|
ref.replaceChildren((0, typed_dom_1.html)('span', { hidden: '' }, ref.childNodes));
|
|
8430
8448
|
} else {
|
|
@@ -8442,6 +8460,8 @@ require = function () {
|
|
|
8442
8460
|
if (title && !blank && def.childNodes.length === 1) {
|
|
8443
8461
|
def.insertBefore(content.cloneNode(true), def.lastChild);
|
|
8444
8462
|
for (const ref of buffer.take(identifier, global_1.Infinity)) {
|
|
8463
|
+
if (ref.getAttribute('data-invalid-type') !== 'content')
|
|
8464
|
+
continue;
|
|
8445
8465
|
(0, typed_dom_1.define)(ref, {
|
|
8446
8466
|
title,
|
|
8447
8467
|
class: void ref.classList.remove('invalid'),
|
|
@@ -8642,6 +8662,7 @@ require = function () {
|
|
|
8642
8662
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8643
8663
|
exports.escsource = void 0;
|
|
8644
8664
|
const combinator_1 = _dereq_('../../combinator');
|
|
8665
|
+
const text_1 = _dereq_('./text');
|
|
8645
8666
|
const separator = /[\s\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]/;
|
|
8646
8667
|
exports.escsource = (0, combinator_1.creator)(source => {
|
|
8647
8668
|
if (source === '')
|
|
@@ -8661,9 +8682,11 @@ require = function () {
|
|
|
8661
8682
|
source.slice(2)
|
|
8662
8683
|
];
|
|
8663
8684
|
default:
|
|
8685
|
+
const b = source[0] !== '\n' && source[0].trimStart() === '';
|
|
8686
|
+
const i = b ? source.search(text_1.nonWhitespace) : 1;
|
|
8664
8687
|
return [
|
|
8665
|
-
[source.slice(0,
|
|
8666
|
-
source.slice(
|
|
8688
|
+
[source.slice(0, i)],
|
|
8689
|
+
source.slice(i)
|
|
8667
8690
|
];
|
|
8668
8691
|
}
|
|
8669
8692
|
default:
|
|
@@ -8674,7 +8697,10 @@ require = function () {
|
|
|
8674
8697
|
}
|
|
8675
8698
|
});
|
|
8676
8699
|
},
|
|
8677
|
-
{
|
|
8700
|
+
{
|
|
8701
|
+
'../../combinator': 30,
|
|
8702
|
+
'./text': 135
|
|
8703
|
+
}
|
|
8678
8704
|
],
|
|
8679
8705
|
133: [
|
|
8680
8706
|
function (_dereq_, module, exports) {
|
|
@@ -8991,7 +9017,7 @@ require = function () {
|
|
|
8991
9017
|
return ((_a = source[1]) === null || _a === void 0 ? void 0 : _a.trimStart()) !== '';
|
|
8992
9018
|
case '&':
|
|
8993
9019
|
switch (true) {
|
|
8994
|
-
case source.length > 2 && source[1] !== ' ' && ((_b = (0, parser_1.eval)((0, htmlentity_1.
|
|
9020
|
+
case source.length > 2 && source[1] !== ' ' && ((_b = (0, parser_1.eval)((0, htmlentity_1.unsafehtmlentity)(source, context))) === null || _b === void 0 ? void 0 : _b[0].trimStart()) === '':
|
|
8995
9021
|
return false;
|
|
8996
9022
|
}
|
|
8997
9023
|
return true;
|
|
@@ -9020,16 +9046,21 @@ require = function () {
|
|
|
9020
9046
|
function isEndTightNodes(nodes) {
|
|
9021
9047
|
if (nodes.length === 0)
|
|
9022
9048
|
return true;
|
|
9023
|
-
|
|
9049
|
+
for (let i = nodes.length; i--;) {
|
|
9050
|
+
const node = nodes[i];
|
|
9051
|
+
if (typeof node === 'object' && node.className === 'comment')
|
|
9052
|
+
continue;
|
|
9053
|
+
return isVisible(node, -1);
|
|
9054
|
+
}
|
|
9055
|
+
return false;
|
|
9024
9056
|
}
|
|
9025
9057
|
exports.isEndTightNodes = isEndTightNodes;
|
|
9026
|
-
function isVisible(node,
|
|
9027
|
-
if (!node)
|
|
9028
|
-
return false;
|
|
9058
|
+
function isVisible(node, strpos) {
|
|
9029
9059
|
switch (typeof node) {
|
|
9030
9060
|
case 'string':
|
|
9031
|
-
const char =
|
|
9061
|
+
const char = node && strpos !== global_1.undefined ? node[strpos >= 0 ? strpos : node.length + strpos] : node;
|
|
9032
9062
|
switch (char) {
|
|
9063
|
+
case '':
|
|
9033
9064
|
case ' ':
|
|
9034
9065
|
case '\t':
|
|
9035
9066
|
case '\n':
|
package/markdown.d.ts
CHANGED
|
@@ -844,7 +844,7 @@ export namespace MarkdownParser {
|
|
|
844
844
|
export interface TextParser extends
|
|
845
845
|
Inline<'media/text'>,
|
|
846
846
|
Parser<string[], Context, [
|
|
847
|
-
|
|
847
|
+
UnsafeHTMLEntityParser,
|
|
848
848
|
TextParser.BracketParser,
|
|
849
849
|
SourceParser.TxtParser,
|
|
850
850
|
]> {
|
|
@@ -854,22 +854,22 @@ export namespace MarkdownParser {
|
|
|
854
854
|
Inline<'media/text/bracket'>,
|
|
855
855
|
Parser<string, Context, [
|
|
856
856
|
Parser<string, Context, [
|
|
857
|
-
|
|
857
|
+
UnsafeHTMLEntityParser,
|
|
858
858
|
BracketParser,
|
|
859
859
|
SourceParser.TxtParser,
|
|
860
860
|
]>,
|
|
861
861
|
Parser<string, Context, [
|
|
862
|
-
|
|
862
|
+
UnsafeHTMLEntityParser,
|
|
863
863
|
BracketParser,
|
|
864
864
|
SourceParser.TxtParser,
|
|
865
865
|
]>,
|
|
866
866
|
Parser<string, Context, [
|
|
867
|
-
|
|
867
|
+
UnsafeHTMLEntityParser,
|
|
868
868
|
BracketParser,
|
|
869
869
|
SourceParser.TxtParser,
|
|
870
870
|
]>,
|
|
871
871
|
Parser<string, Context, [
|
|
872
|
-
|
|
872
|
+
UnsafeHTMLEntityParser,
|
|
873
873
|
SourceParser.TxtParser,
|
|
874
874
|
]>,
|
|
875
875
|
]> {
|
|
@@ -988,6 +988,7 @@ export namespace MarkdownParser {
|
|
|
988
988
|
Inline<'math'>,
|
|
989
989
|
Parser<HTMLElement, Context, [
|
|
990
990
|
SourceParser.StrParser,
|
|
991
|
+
MathParser.BracketParser,
|
|
991
992
|
]> {
|
|
992
993
|
}
|
|
993
994
|
export namespace MathParser {
|
|
@@ -1002,6 +1003,14 @@ export namespace MarkdownParser {
|
|
|
1002
1003
|
export interface HTMLEntityParser extends
|
|
1003
1004
|
// ©
|
|
1004
1005
|
Inline<'htmlentity'>,
|
|
1006
|
+
Parser<HTMLSpanElement | string, Context, [
|
|
1007
|
+
UnsafeHTMLEntityParser,
|
|
1008
|
+
Parser<HTMLSpanElement, Context, []>,
|
|
1009
|
+
]> {
|
|
1010
|
+
}
|
|
1011
|
+
export interface UnsafeHTMLEntityParser extends
|
|
1012
|
+
// ©
|
|
1013
|
+
Inline<'unsafehtmlentity'>,
|
|
1005
1014
|
Parser<string, Context, []> {
|
|
1006
1015
|
}
|
|
1007
1016
|
export interface ShortmediaParser extends
|