securemark 0.239.0 → 0.240.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 +12 -0
- package/design.md +2 -2
- package/dist/securemark.js +126 -59
- package/gulpfile.js +1 -1
- package/markdown.d.ts +3 -3
- package/package-lock.json +201 -142
- package/package.json +6 -6
- package/src/combinator/data/parser/some.ts +28 -6
- package/src/combinator/data/parser/subsequence.ts +1 -1
- package/src/combinator/data/parser.ts +21 -16
- package/src/parser/api/header.test.ts +1 -1
- package/src/parser/api/header.ts +3 -3
- package/src/parser/api/parse.test.ts +13 -7
- package/src/parser/block/blockquote.test.ts +1 -1
- package/src/parser/block/extension/aside.test.ts +1 -1
- package/src/parser/block/extension/example.test.ts +2 -2
- package/src/parser/block/extension/fig.test.ts +21 -21
- package/src/parser/block/extension/figure.test.ts +37 -33
- package/src/parser/block/extension/figure.ts +36 -6
- package/src/parser/block/olist.ts +2 -2
- package/src/parser/header.test.ts +4 -4
- package/src/parser/header.ts +7 -5
- package/src/parser/inline/annotation.ts +1 -1
- package/src/parser/inline/bracket.test.ts +5 -1
- package/src/parser/inline/bracket.ts +2 -2
- package/src/parser/inline/comment.ts +1 -1
- package/src/parser/inline/reference.test.ts +7 -7
- package/src/parser/inline/reference.ts +2 -2
- package/src/parser/inline.test.ts +4 -0
- package/src/parser/processor/figure.test.ts +79 -79
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.240.2
|
|
4
|
+
|
|
5
|
+
- Refactoring.
|
|
6
|
+
|
|
7
|
+
## 0.240.1
|
|
8
|
+
|
|
9
|
+
- Refactoring.
|
|
10
|
+
|
|
11
|
+
## 0.240.0
|
|
12
|
+
|
|
13
|
+
- Extend reference syntax not to require leading whitespace after abbr syntax.
|
|
14
|
+
|
|
3
15
|
## 0.239.0
|
|
4
16
|
|
|
5
17
|
- Extend indexer syntax to make its own index optional.
|
package/design.md
CHANGED
|
@@ -102,14 +102,14 @@
|
|
|
102
102
|
##### インプットサイズ
|
|
103
103
|
|
|
104
104
|
パーサーは上限を超えるサイズの入力をパースしない。
|
|
105
|
-
|
|
105
|
+
また上限を超えない入力は1秒以下でセグメントに分割され非同期での逐次パースが可能である。
|
|
106
106
|
|
|
107
107
|
ゆえに入力はパーサーの実行環境を応答不能にすることはない。
|
|
108
108
|
|
|
109
109
|
##### セグメントサイズ
|
|
110
110
|
|
|
111
111
|
パーサーは上限を超えるサイズのセグメントをパースしない。
|
|
112
|
-
|
|
112
|
+
また上限を超えないセグメントのパースも規定のパースコストの上限を超えない。
|
|
113
113
|
|
|
114
114
|
ゆえに入力はパーサーの実行環境を応答不能にすることはない。
|
|
115
115
|
なお1セグメントは1ブロックに対応する。
|
package/dist/securemark.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.
|
|
1
|
+
/*! securemark v0.240.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) {
|
|
@@ -500,7 +500,7 @@ require = function () {
|
|
|
500
500
|
case LFU.length > this.capacity * this.ratio / 100:
|
|
501
501
|
target = LFU.last !== skip ? LFU.last : LFU.length >= 2 ? LFU.last.prev : skip;
|
|
502
502
|
if (target !== skip) {
|
|
503
|
-
if (this.ratio
|
|
503
|
+
if (this.ratio >= 50)
|
|
504
504
|
break;
|
|
505
505
|
LRU.unshiftNode(target);
|
|
506
506
|
LRU.head.value.node = LRU.head;
|
|
@@ -697,17 +697,16 @@ require = function () {
|
|
|
697
697
|
const global_1 = _dereq_('./global');
|
|
698
698
|
const alias_1 = _dereq_('./alias');
|
|
699
699
|
const exception_1 = _dereq_('./exception');
|
|
700
|
-
let
|
|
700
|
+
let mem;
|
|
701
701
|
let count = 0;
|
|
702
|
-
function now() {
|
|
703
|
-
if (
|
|
704
|
-
tick(() =>
|
|
705
|
-
} else {
|
|
706
|
-
|
|
707
|
-
return now_;
|
|
708
|
-
count = 0;
|
|
702
|
+
function now(nocache = false) {
|
|
703
|
+
if (mem === void 0) {
|
|
704
|
+
tick(() => mem = void 0);
|
|
705
|
+
} else if (!nocache && ++count !== 100) {
|
|
706
|
+
return mem;
|
|
709
707
|
}
|
|
710
|
-
|
|
708
|
+
count = 0;
|
|
709
|
+
return mem = global_1.Date.now();
|
|
711
710
|
}
|
|
712
711
|
exports.now = now;
|
|
713
712
|
exports.clock = Promise.resolve(void 0);
|
|
@@ -1112,12 +1111,29 @@ require = function () {
|
|
|
1112
1111
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1113
1112
|
exports.reduce = exports.memoize = void 0;
|
|
1114
1113
|
const global_1 = _dereq_('./global');
|
|
1114
|
+
const alias_1 = _dereq_('./alias');
|
|
1115
1115
|
const compare_1 = _dereq_('./compare');
|
|
1116
1116
|
function memoize(f, identify = (...as) => as[0], memory) {
|
|
1117
1117
|
if (typeof identify === 'object')
|
|
1118
1118
|
return memoize(f, void 0, identify);
|
|
1119
1119
|
if (memory === void 0)
|
|
1120
1120
|
return memoize(f, identify, new global_1.Map());
|
|
1121
|
+
if ((0, alias_1.isArray)(memory))
|
|
1122
|
+
return memoize(f, identify, {
|
|
1123
|
+
has(key) {
|
|
1124
|
+
return memory[key] !== void 0;
|
|
1125
|
+
},
|
|
1126
|
+
get(key) {
|
|
1127
|
+
return memory[key];
|
|
1128
|
+
},
|
|
1129
|
+
set(key, value) {
|
|
1130
|
+
memory[key] = value;
|
|
1131
|
+
return this;
|
|
1132
|
+
},
|
|
1133
|
+
delete() {
|
|
1134
|
+
throw 0;
|
|
1135
|
+
}
|
|
1136
|
+
});
|
|
1121
1137
|
let nullish = false;
|
|
1122
1138
|
return (...as) => {
|
|
1123
1139
|
const b = identify(...as);
|
|
@@ -1146,6 +1162,7 @@ require = function () {
|
|
|
1146
1162
|
exports.reduce = reduce;
|
|
1147
1163
|
},
|
|
1148
1164
|
{
|
|
1165
|
+
'./alias': 5,
|
|
1149
1166
|
'./compare': 12,
|
|
1150
1167
|
'./global': 15
|
|
1151
1168
|
}
|
|
@@ -1196,12 +1213,14 @@ require = function () {
|
|
|
1196
1213
|
function (_dereq_, module, exports) {
|
|
1197
1214
|
'use strict';
|
|
1198
1215
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1199
|
-
exports.unique = exports.rnd0Z = exports.rnd0z = exports.rnd0f = exports.rnd64 = exports.rnd62 = exports.rnd36 = exports.rnd32 = exports.rnd16 = void 0;
|
|
1216
|
+
exports.unique = exports.rnd0_ = exports.rnd0Z = exports.rnd0z = exports.rnd0f = exports.rnd64 = exports.rnd62 = exports.rnd36 = exports.rnd32 = exports.rnd16 = void 0;
|
|
1200
1217
|
const global_1 = _dereq_('./global');
|
|
1201
1218
|
const bases = [...Array(7)].map((_, i) => 1 << i);
|
|
1202
1219
|
const dict = [
|
|
1203
1220
|
...[...Array(36)].map((_, i) => i.toString(36)),
|
|
1204
|
-
...[...Array(36)].map((_, i) => i.toString(36).toUpperCase()).slice(-26)
|
|
1221
|
+
...[...Array(36)].map((_, i) => i.toString(36).toUpperCase()).slice(-26),
|
|
1222
|
+
'-',
|
|
1223
|
+
'_'
|
|
1205
1224
|
];
|
|
1206
1225
|
exports.rnd16 = cons(16);
|
|
1207
1226
|
exports.rnd32 = cons(32);
|
|
@@ -1211,6 +1230,7 @@ require = function () {
|
|
|
1211
1230
|
exports.rnd0f = conv(exports.rnd16);
|
|
1212
1231
|
exports.rnd0z = conv(exports.rnd36);
|
|
1213
1232
|
exports.rnd0Z = conv(exports.rnd62);
|
|
1233
|
+
exports.rnd0_ = conv(exports.rnd64);
|
|
1214
1234
|
function unique(rnd, len, mem) {
|
|
1215
1235
|
const clear = !mem;
|
|
1216
1236
|
mem !== null && mem !== void 0 ? mem : mem = new global_1.Set();
|
|
@@ -3830,29 +3850,30 @@ require = function () {
|
|
|
3830
3850
|
exports.check = exports.exec = exports.eval = exports.Delimiters = void 0;
|
|
3831
3851
|
class Delimiters {
|
|
3832
3852
|
constructor() {
|
|
3833
|
-
this.
|
|
3834
|
-
this.
|
|
3853
|
+
this.matchers = [];
|
|
3854
|
+
this.record = {};
|
|
3835
3855
|
}
|
|
3836
3856
|
push(delimiter) {
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3857
|
+
const {signature, matcher, escape} = delimiter;
|
|
3858
|
+
if (this.record[signature] === !escape) {
|
|
3859
|
+
this.matchers.unshift(() => undefined);
|
|
3860
|
+
} else {
|
|
3861
|
+
this.matchers.unshift(matcher);
|
|
3862
|
+
this.record[signature] = !escape;
|
|
3863
|
+
}
|
|
3842
3864
|
}
|
|
3843
3865
|
pop() {
|
|
3844
|
-
this.
|
|
3866
|
+
this.matchers.shift();
|
|
3845
3867
|
}
|
|
3846
3868
|
match(source) {
|
|
3847
|
-
const {
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
if (sig in log)
|
|
3852
|
-
continue;
|
|
3853
|
-
if (matchers[sig](source))
|
|
3869
|
+
const {matchers} = this;
|
|
3870
|
+
for (let i = 0; i < matchers.length; ++i) {
|
|
3871
|
+
switch (matchers[i](source)) {
|
|
3872
|
+
case true:
|
|
3854
3873
|
return true;
|
|
3855
|
-
|
|
3874
|
+
case false:
|
|
3875
|
+
return false;
|
|
3876
|
+
}
|
|
3856
3877
|
}
|
|
3857
3878
|
return false;
|
|
3858
3879
|
}
|
|
@@ -3953,7 +3974,7 @@ require = function () {
|
|
|
3953
3974
|
function (_dereq_, module, exports) {
|
|
3954
3975
|
'use strict';
|
|
3955
3976
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3956
|
-
exports.some = void 0;
|
|
3977
|
+
exports.escape = exports.some = void 0;
|
|
3957
3978
|
const global_1 = _dereq_('spica/global');
|
|
3958
3979
|
const parser_1 = _dereq_('../parser');
|
|
3959
3980
|
const memoize_1 = _dereq_('spica/memoize');
|
|
@@ -3971,11 +3992,11 @@ require = function () {
|
|
|
3971
3992
|
const matcher = (0, memoize_1.memoize)(pattern => {
|
|
3972
3993
|
switch (typeof pattern) {
|
|
3973
3994
|
case 'undefined':
|
|
3974
|
-
return () =>
|
|
3995
|
+
return () => global_1.undefined;
|
|
3975
3996
|
case 'string':
|
|
3976
|
-
return source => source.slice(0, pattern.length) === pattern;
|
|
3997
|
+
return source => source.slice(0, pattern.length) === pattern || global_1.undefined;
|
|
3977
3998
|
case 'object':
|
|
3978
|
-
return (0, memoize_1.reduce)(source => pattern.test(source));
|
|
3999
|
+
return (0, memoize_1.reduce)(source => pattern.test(source) || global_1.undefined);
|
|
3979
4000
|
}
|
|
3980
4001
|
}, signature);
|
|
3981
4002
|
function some(parser, until, deep, limit = -1) {
|
|
@@ -4021,6 +4042,28 @@ require = function () {
|
|
|
4021
4042
|
};
|
|
4022
4043
|
}
|
|
4023
4044
|
exports.some = some;
|
|
4045
|
+
function escape(parser, delim) {
|
|
4046
|
+
const delimiter = {
|
|
4047
|
+
signature: signature(delim),
|
|
4048
|
+
matcher: source => source.slice(0, delim.length) !== delim && global_1.undefined,
|
|
4049
|
+
escape: true
|
|
4050
|
+
};
|
|
4051
|
+
return (source, context) => {
|
|
4052
|
+
var _a;
|
|
4053
|
+
if (source === '')
|
|
4054
|
+
return;
|
|
4055
|
+
if (context) {
|
|
4056
|
+
(_a = context.delimiters) !== null && _a !== void 0 ? _a : context.delimiters = new parser_1.Delimiters();
|
|
4057
|
+
context.delimiters.push(delimiter);
|
|
4058
|
+
}
|
|
4059
|
+
const result = parser(source, context);
|
|
4060
|
+
if (context.delimiters) {
|
|
4061
|
+
context.delimiters.pop();
|
|
4062
|
+
}
|
|
4063
|
+
return result;
|
|
4064
|
+
};
|
|
4065
|
+
}
|
|
4066
|
+
exports.escape = escape;
|
|
4024
4067
|
},
|
|
4025
4068
|
{
|
|
4026
4069
|
'../parser': 47,
|
|
@@ -4037,7 +4080,7 @@ require = function () {
|
|
|
4037
4080
|
const union_1 = _dereq_('./union');
|
|
4038
4081
|
const inits_1 = _dereq_('./inits');
|
|
4039
4082
|
function subsequence(parsers) {
|
|
4040
|
-
return (0, union_1.union)(parsers.map((_, i) => i < parsers.length
|
|
4083
|
+
return (0, union_1.union)(parsers.map((_, i) => i + 1 < parsers.length ? (0, inits_1.inits)([
|
|
4041
4084
|
parsers[i],
|
|
4042
4085
|
subsequence(parsers.slice(i + 1))
|
|
4043
4086
|
]) : parsers[i]));
|
|
@@ -4415,13 +4458,13 @@ require = function () {
|
|
|
4415
4458
|
function headers(source) {
|
|
4416
4459
|
var _a;
|
|
4417
4460
|
const [el] = parse(source);
|
|
4418
|
-
return (_a = el === null || el === void 0 ? void 0 : el.textContent.trimEnd().slice(el.firstChild.textContent.length).split('\n')) !== null && _a !== void 0 ? _a : [];
|
|
4461
|
+
return (_a = el === null || el === void 0 ? void 0 : el.textContent.trimEnd().slice(el.firstChild.firstChild.textContent.length).split('\n')) !== null && _a !== void 0 ? _a : [];
|
|
4419
4462
|
}
|
|
4420
4463
|
exports.headers = headers;
|
|
4421
4464
|
function parse(source) {
|
|
4422
4465
|
const result = (0, header_1.header)(source, {});
|
|
4423
4466
|
const [el] = (0, parser_1.eval)(result, []);
|
|
4424
|
-
return el
|
|
4467
|
+
return (el === null || el === void 0 ? void 0 : el.tagName) === 'ASIDE' ? [
|
|
4425
4468
|
el,
|
|
4426
4469
|
(0, parser_1.exec)(result)
|
|
4427
4470
|
] : [];
|
|
@@ -5124,7 +5167,7 @@ require = function () {
|
|
|
5124
5167
|
(0, combinator_1.some)(source_1.contentline, closer)
|
|
5125
5168
|
])
|
|
5126
5169
|
])
|
|
5127
|
-
]), closer), ([, fence]) => fence.length)));
|
|
5170
|
+
]), closer), ([, fence]) => fence.length, [])));
|
|
5128
5171
|
exports.figure = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.search(/[[$]/), source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([
|
|
5129
5172
|
(0, combinator_1.line)((0, combinator_1.sequence)([
|
|
5130
5173
|
label_1.label,
|
|
@@ -5148,8 +5191,8 @@ require = function () {
|
|
|
5148
5191
|
(0, combinator_1.block)((0, locale_1.localize)((0, combinator_1.context)({ syntax: { inline: { media: false } } }, (0, combinator_1.trim)((0, util_1.visualize)((0, combinator_1.some)(inline_1.inline))))))
|
|
5149
5192
|
])
|
|
5150
5193
|
])), ([label, param, content, ...caption]) => [(0, typed_dom_1.html)('figure', attributes(label.getAttribute('data-label'), param, content, caption), [
|
|
5151
|
-
(0, typed_dom_1.html)('
|
|
5152
|
-
(0, typed_dom_1.html)('
|
|
5194
|
+
(0, typed_dom_1.html)('figcaption', (0, array_1.unshift)([(0, typed_dom_1.html)('span', { class: 'figindex' })], (0, typed_dom_1.defrag)(caption))),
|
|
5195
|
+
(0, typed_dom_1.html)('div', [content])
|
|
5153
5196
|
])])));
|
|
5154
5197
|
function attributes(label, param, content, caption) {
|
|
5155
5198
|
const group = label.split('-', 1)[0];
|
|
@@ -5157,6 +5200,7 @@ require = function () {
|
|
|
5157
5200
|
switch (type || content.tagName) {
|
|
5158
5201
|
case 'UL':
|
|
5159
5202
|
case 'OL':
|
|
5203
|
+
case 'checklist':
|
|
5160
5204
|
type = 'list';
|
|
5161
5205
|
break;
|
|
5162
5206
|
case 'TABLE':
|
|
@@ -5182,15 +5226,39 @@ require = function () {
|
|
|
5182
5226
|
} || param.trimStart() !== '' && {
|
|
5183
5227
|
'data-invalid-type': 'argument',
|
|
5184
5228
|
'data-invalid-message': 'Invalid argument'
|
|
5185
|
-
} || group === '$' && (
|
|
5186
|
-
'data-invalid-type': '
|
|
5187
|
-
'data-invalid-message': '
|
|
5229
|
+
} || group === '$' && (type !== 'math' || caption.length > 0) && {
|
|
5230
|
+
'data-invalid-type': 'label',
|
|
5231
|
+
'data-invalid-message': '"$" label group must be used to math formulas with no caption'
|
|
5232
|
+
} || type === 'media' && {} || [
|
|
5233
|
+
'fig',
|
|
5234
|
+
'figure'
|
|
5235
|
+
].includes(group) && {
|
|
5236
|
+
'data-invalid-type': 'label',
|
|
5237
|
+
'data-invalid-message': '"fig" and "figure" label groups must be used to media'
|
|
5238
|
+
} || group === 'table' && type !== group && {
|
|
5239
|
+
'data-invalid-type': 'label',
|
|
5240
|
+
'data-invalid-message': '"table" label group must be used to tables'
|
|
5241
|
+
} || group === 'list' && type !== group && {
|
|
5242
|
+
'data-invalid-type': 'label',
|
|
5243
|
+
'data-invalid-message': '"list" label group must be used to lists'
|
|
5244
|
+
} || group === 'quote' && type !== group && {
|
|
5245
|
+
'data-invalid-type': 'label',
|
|
5246
|
+
'data-invalid-message': '"quote" label group must be used to blockquotes'
|
|
5247
|
+
} || group === 'text' && type !== group && {
|
|
5248
|
+
'data-invalid-type': 'label',
|
|
5249
|
+
'data-invalid-message': '"text" label group must be used to codeblocks with no language'
|
|
5250
|
+
} || group === 'code' && type !== group && {
|
|
5251
|
+
'data-invalid-type': 'label',
|
|
5252
|
+
'data-invalid-message': '"code" label group must be used to codeblocks with any language'
|
|
5253
|
+
} || group === 'example' && type !== group && {
|
|
5254
|
+
'data-invalid-type': 'label',
|
|
5255
|
+
'data-invalid-message': '"example" label group must be used to examples'
|
|
5188
5256
|
} || global_1.undefined;
|
|
5189
5257
|
return {
|
|
5190
5258
|
'data-type': type,
|
|
5191
5259
|
'data-label': label,
|
|
5192
5260
|
'data-group': group,
|
|
5193
|
-
...invalid && {
|
|
5261
|
+
...(invalid === null || invalid === void 0 ? void 0 : invalid['data-invalid-type']) && {
|
|
5194
5262
|
class: 'invalid',
|
|
5195
5263
|
'data-invalid-syntax': 'figure',
|
|
5196
5264
|
...invalid
|
|
@@ -5755,8 +5823,8 @@ require = function () {
|
|
|
5755
5823
|
/^\(([0-9]+|[a-z]+)\)(?:-[0-9]+)*(?=[^\S\n]|\n[^\S\n]*\S)/
|
|
5756
5824
|
], (0, combinator_1.context)({ syntax: { inline: { media: false } } }, exports.olist_))));
|
|
5757
5825
|
exports.olist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.union)([
|
|
5758
|
-
(0, combinator_1.match)(new RegExp(`^(?=${ openers['.'].source.replace('?:', '') })`), (0, memoize_1.memoize)(ms => list(type(ms[1]), '.'), ms => type(ms[1]))),
|
|
5759
|
-
(0, combinator_1.match)(new RegExp(`^(?=${ openers['('].source.replace('?:', '') })`), (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => type(ms[1])))
|
|
5826
|
+
(0, combinator_1.match)(new RegExp(`^(?=${ openers['.'].source.replace('?:', '') })`), (0, memoize_1.memoize)(ms => list(type(ms[1]), '.'), ms => type(ms[1]).charCodeAt(0) || 0, [])),
|
|
5827
|
+
(0, combinator_1.match)(new RegExp(`^(?=${ openers['('].source.replace('?:', '') })`), (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => type(ms[1]).charCodeAt(0) || 0, []))
|
|
5760
5828
|
])));
|
|
5761
5829
|
const list = (type, delim) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([
|
|
5762
5830
|
(0, combinator_1.line)((0, combinator_1.open)(heads[delim], (0, combinator_1.trim)((0, combinator_1.subsequence)([
|
|
@@ -6195,13 +6263,10 @@ require = function () {
|
|
|
6195
6263
|
(0, combinator_1.guard)(context => {
|
|
6196
6264
|
var _a;
|
|
6197
6265
|
return (_a = context.header) !== null && _a !== void 0 ? _a : true;
|
|
6198
|
-
}, (0, combinator_1.focus)(/^---[^\S\v\f\r\n]*\r?\n(?:[A-Za-z][0-9A-Za-z]*(?:-[A-Za-z][0-9A-Za-z]*)*:[ \t]+\S[^\v\f\r\n]*\r?\n){1,100}---[^\S\v\f\r\n]*(?:$|\r?\n)/, (0, combinator_1.convert)(source => (0, normalize_1.normalize)(source.slice(source.indexOf('\n') + 1, source.trimEnd().lastIndexOf('\n'))).replace(/(\S)\s+$/mg, '$1'), (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([field])), es => [(0, typed_dom_1.html)('details', {
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
(0, typed_dom_1.html)('summary', 'Header'),
|
|
6203
|
-
...es
|
|
6204
|
-
]))])))),
|
|
6266
|
+
}, (0, combinator_1.focus)(/^---[^\S\v\f\r\n]*\r?\n(?:[A-Za-z][0-9A-Za-z]*(?:-[A-Za-z][0-9A-Za-z]*)*:[ \t]+\S[^\v\f\r\n]*\r?\n){1,100}---[^\S\v\f\r\n]*(?:$|\r?\n)/, (0, combinator_1.convert)(source => (0, normalize_1.normalize)(source.slice(source.indexOf('\n') + 1, source.trimEnd().lastIndexOf('\n'))).replace(/(\S)\s+$/mg, '$1'), (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([field])), es => [(0, typed_dom_1.html)('aside', { class: 'header' }, [(0, typed_dom_1.html)('details', { open: '' }, (0, typed_dom_1.defrag)([
|
|
6267
|
+
(0, typed_dom_1.html)('summary', 'Header'),
|
|
6268
|
+
...es
|
|
6269
|
+
]))])])))),
|
|
6205
6270
|
source => [
|
|
6206
6271
|
[(0, typed_dom_1.html)('pre', {
|
|
6207
6272
|
class: 'invalid',
|
|
@@ -6221,7 +6286,7 @@ require = function () {
|
|
|
6221
6286
|
return [
|
|
6222
6287
|
[(0, typed_dom_1.html)('span', {
|
|
6223
6288
|
class: 'field',
|
|
6224
|
-
'data-name': name,
|
|
6289
|
+
'data-name': name.toLowerCase(),
|
|
6225
6290
|
'data-value': value
|
|
6226
6291
|
}, [
|
|
6227
6292
|
(0, typed_dom_1.html)('span', { class: 'field-name' }, name),
|
|
@@ -6373,7 +6438,8 @@ require = function () {
|
|
|
6373
6438
|
media: false
|
|
6374
6439
|
}
|
|
6375
6440
|
},
|
|
6376
|
-
state: global_1.undefined
|
|
6441
|
+
state: global_1.undefined,
|
|
6442
|
+
delimiters: global_1.undefined
|
|
6377
6443
|
}, (0, util_1.trimSpaceStart)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, ')', /^\\?\n/)]))))), '))'), ns => [(0, typed_dom_1.html)('sup', { class: 'annotation' }, (0, util_1.trimNodeEnd)((0, typed_dom_1.defrag)(ns)))]))));
|
|
6378
6444
|
},
|
|
6379
6445
|
{
|
|
@@ -6651,7 +6717,7 @@ require = function () {
|
|
|
6651
6717
|
const source_1 = _dereq_('../source');
|
|
6652
6718
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
6653
6719
|
const array_1 = _dereq_('spica/array');
|
|
6654
|
-
const index = /^(?:[0-9]+(
|
|
6720
|
+
const index = /^(?:[0-9]+(?:(?:[.-]|, )[0-9]+)*|[A-Za-z])/;
|
|
6655
6721
|
exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.union)([
|
|
6656
6722
|
(0, combinator_1.surround)((0, source_1.str)('('), (0, source_1.str)(index), (0, source_1.str)(')')),
|
|
6657
6723
|
(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)(inline_1.inline, ')'), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [
|
|
@@ -6661,7 +6727,7 @@ require = function () {
|
|
|
6661
6727
|
(0, array_1.unshift)(as, bs),
|
|
6662
6728
|
rest
|
|
6663
6729
|
]),
|
|
6664
|
-
(0, combinator_1.surround)((0, source_1.str)('\uFF08'), (0, source_1.str)(new RegExp(index.source.replace(/[09AZaz
|
|
6730
|
+
(0, combinator_1.surround)((0, source_1.str)('\uFF08'), (0, source_1.str)(new RegExp(index.source.replace(/[09AZaz., ]|\-(?!\w)/g, c => c.trimStart() && String.fromCharCode(c.charCodeAt(0) + 65248)))), (0, source_1.str)('\uFF09')),
|
|
6665
6731
|
(0, combinator_1.surround)((0, source_1.str)('\uFF08'), (0, combinator_1.some)(inline_1.inline, '\uFF09'), (0, source_1.str)('\uFF09'), true, ([as, bs = [], cs], rest) => [
|
|
6666
6732
|
[(0, typed_dom_1.html)('span', { class: 'paren' }, (0, typed_dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))],
|
|
6667
6733
|
rest
|
|
@@ -6732,7 +6798,7 @@ require = function () {
|
|
|
6732
6798
|
], ([as, bs = []], rest) => [
|
|
6733
6799
|
(0, array_1.unshift)(as, bs),
|
|
6734
6800
|
rest
|
|
6735
|
-
]), ([, fence]) => fence.length)))));
|
|
6801
|
+
]), ([, fence]) => fence.length, [])))));
|
|
6736
6802
|
},
|
|
6737
6803
|
{
|
|
6738
6804
|
'../../combinator': 27,
|
|
@@ -7824,7 +7890,8 @@ require = function () {
|
|
|
7824
7890
|
media: false
|
|
7825
7891
|
}
|
|
7826
7892
|
},
|
|
7827
|
-
state: global_1.undefined
|
|
7893
|
+
state: global_1.undefined,
|
|
7894
|
+
delimiters: global_1.undefined
|
|
7828
7895
|
}, (0, combinator_1.subsequence)([
|
|
7829
7896
|
abbr,
|
|
7830
7897
|
(0, combinator_1.focus)(/^\^[^\S\n]*/, source => [
|
|
@@ -7836,7 +7903,7 @@ require = function () {
|
|
|
7836
7903
|
]),
|
|
7837
7904
|
(0, util_1.trimSpaceStart)((0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/))
|
|
7838
7905
|
])))), ']]'), ns => [(0, typed_dom_1.html)('sup', attributes(ns), (0, util_1.trimNodeEnd)((0, typed_dom_1.defrag)(ns)))]))));
|
|
7839
|
-
const abbr = (0, combinator_1.creator)((0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.surround)('^', (0, combinator_1.union)([(0, source_1.str)(/^(?![0-9]+\s?[|\]])[0-9A-Za-z]+(?:(?:-|(?=\W)(?!'\d)'?(?!\.\d)\.?(?!,\S),? ?)[0-9A-Za-z]+)*(?:-|'?\.?,? ?)?/)]), /^\|?(?=]])|^\|[^\S\n]
|
|
7906
|
+
const abbr = (0, combinator_1.creator)((0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.surround)('^', (0, combinator_1.union)([(0, source_1.str)(/^(?![0-9]+\s?[|\]])[0-9A-Za-z]+(?:(?:-|(?=\W)(?!'\d)'?(?!\.\d)\.?(?!,\S),? ?)[0-9A-Za-z]+)*(?:-|'?\.?,? ?)?/)]), /^\|?(?=]])|^\|[^\S\n]*/), (_, rest, context) => (0, util_1.isStartLoose)(rest, context)), ([source]) => [(0, typed_dom_1.html)('abbr', source)]));
|
|
7840
7907
|
function attributes(ns) {
|
|
7841
7908
|
return typeof ns[0] === 'object' && ns[0].tagName === 'ABBR' ? {
|
|
7842
7909
|
class: 'reference',
|
package/gulpfile.js
CHANGED
|
@@ -128,7 +128,7 @@ gulp.task('ts:dist', () =>
|
|
|
128
128
|
.pipe(gulp.dest(config.ts.dist.dest)));
|
|
129
129
|
|
|
130
130
|
gulp.task('ts:view', () =>
|
|
131
|
-
gulp.watch(config.ts.
|
|
131
|
+
gulp.watch(config.ts.test.src, { ignoreInitial: false }, () =>
|
|
132
132
|
compile(config.ts.dist.src, true)
|
|
133
133
|
.pipe($.unassert())
|
|
134
134
|
.pipe($.header(config.banner))
|
package/markdown.d.ts
CHANGED
|
@@ -56,9 +56,9 @@ export namespace MarkdownParser {
|
|
|
56
56
|
// url: https://host/path
|
|
57
57
|
// ---
|
|
58
58
|
Markdown<'header'>,
|
|
59
|
-
Parser<
|
|
60
|
-
Parser<
|
|
61
|
-
Parser<
|
|
59
|
+
Parser<HTMLElement | HTMLPreElement, Context, [
|
|
60
|
+
Parser<HTMLElement | HTMLPreElement, Context, [
|
|
61
|
+
Parser<HTMLElement, Context, [
|
|
62
62
|
HeaderParser.FieldParser,
|
|
63
63
|
]>,
|
|
64
64
|
Parser<HTMLPreElement, Context, []>,
|