securemark 0.235.0 → 0.235.3
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/dist/securemark.js +197 -177
- package/markdown.d.ts +5 -2
- package/package-lock.json +36 -60
- package/package.json +3 -3
- package/src/combinator/control/manipulation/context.test.ts +4 -4
- package/src/combinator/control/manipulation/resource.ts +6 -3
- package/src/combinator/control/manipulation/surround.ts +3 -4
- package/src/combinator/data/parser/inits.ts +1 -1
- package/src/combinator/data/parser/sequence.ts +1 -1
- package/src/combinator/data/parser/some.ts +23 -25
- package/src/combinator/data/parser.ts +33 -10
- package/src/parser/api/bind.test.ts +3 -3
- package/src/parser/api/parse.test.ts +12 -5
- 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 +20 -20
- package/src/parser/block/extension/figure.test.ts +31 -28
- package/src/parser/block/extension/figure.ts +5 -3
- package/src/parser/block/extension/table.ts +6 -6
- package/src/parser/block/paragraph.test.ts +1 -1
- package/src/parser/block.ts +1 -2
- package/src/parser/inline/annotation.ts +3 -3
- package/src/parser/inline/bracket.test.ts +10 -10
- package/src/parser/inline/bracket.ts +5 -8
- package/src/parser/inline/deletion.test.ts +4 -1
- package/src/parser/inline/deletion.ts +7 -4
- package/src/parser/inline/emphasis.ts +3 -6
- package/src/parser/inline/emstrong.ts +7 -8
- package/src/parser/inline/html.test.ts +25 -17
- package/src/parser/inline/html.ts +39 -15
- package/src/parser/inline/htmlentity.test.ts +1 -1
- package/src/parser/inline/htmlentity.ts +17 -10
- package/src/parser/inline/insertion.test.ts +4 -1
- package/src/parser/inline/insertion.ts +7 -4
- package/src/parser/inline/link.test.ts +3 -0
- package/src/parser/inline/link.ts +6 -7
- package/src/parser/inline/mark.ts +3 -6
- package/src/parser/inline/media.test.ts +3 -0
- package/src/parser/inline/media.ts +1 -1
- package/src/parser/inline/reference.ts +6 -6
- package/src/parser/inline/ruby.ts +1 -1
- package/src/parser/inline/strong.test.ts +1 -1
- package/src/parser/inline/strong.ts +3 -6
- package/src/parser/inline.test.ts +2 -3
- package/src/parser/processor/figure.test.ts +28 -28
- package/src/parser/processor/figure.ts +1 -1
- package/src/parser/util.ts +43 -39
package/dist/securemark.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.235.
|
|
1
|
+
/*! securemark v0.235.3 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) {
|
|
@@ -2344,6 +2344,7 @@ require = function () {
|
|
|
2344
2344
|
'use strict';
|
|
2345
2345
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2346
2346
|
exports.SVG = exports.HTML = exports.Shadow = exports.API = void 0;
|
|
2347
|
+
const global_1 = _dereq_('spica/global');
|
|
2347
2348
|
const alias_1 = _dereq_('spica/alias');
|
|
2348
2349
|
const proxy_1 = _dereq_('./proxy');
|
|
2349
2350
|
const dom_1 = _dereq_('./util/dom');
|
|
@@ -2363,22 +2364,24 @@ require = function () {
|
|
|
2363
2364
|
};
|
|
2364
2365
|
function builder(tag, baseFactory) {
|
|
2365
2366
|
return function build(attrs, children, factory) {
|
|
2366
|
-
if (typeof attrs === 'function')
|
|
2367
|
-
return build(void 0, void 0, attrs);
|
|
2368
2367
|
if (typeof children === 'function')
|
|
2369
2368
|
return build(attrs, void 0, children);
|
|
2370
|
-
if (attrs
|
|
2369
|
+
if (typeof attrs === 'function')
|
|
2370
|
+
return build(void 0, void 0, attrs);
|
|
2371
|
+
if (isElChildren(attrs))
|
|
2371
2372
|
return build(void 0, attrs, factory);
|
|
2372
2373
|
const node = formatter(elem(factory, attrs, children));
|
|
2373
2374
|
return node.nodeType === 1 ? new proxy_1.Elem(node, children) : new proxy_1.Elem(node.host, children, node);
|
|
2374
2375
|
};
|
|
2375
|
-
function isElChildren(
|
|
2376
|
-
if (
|
|
2376
|
+
function isElChildren(param) {
|
|
2377
|
+
if (param === void 0)
|
|
2378
|
+
return false;
|
|
2379
|
+
if (param[global_1.Symbol.iterator])
|
|
2377
2380
|
return true;
|
|
2378
|
-
for (const i in
|
|
2379
|
-
if (!(0, alias_1.hasOwnProperty)(
|
|
2381
|
+
for (const i in param) {
|
|
2382
|
+
if (!(0, alias_1.hasOwnProperty)(param, i))
|
|
2380
2383
|
continue;
|
|
2381
|
-
return typeof
|
|
2384
|
+
return typeof param[i] === 'object' && !!param[i];
|
|
2382
2385
|
}
|
|
2383
2386
|
return true;
|
|
2384
2387
|
}
|
|
@@ -2394,7 +2397,8 @@ require = function () {
|
|
|
2394
2397
|
{
|
|
2395
2398
|
'./proxy': 14,
|
|
2396
2399
|
'./util/dom': 15,
|
|
2397
|
-
'spica/alias': 4
|
|
2400
|
+
'spica/alias': 4,
|
|
2401
|
+
'spica/global': 8
|
|
2398
2402
|
}
|
|
2399
2403
|
],
|
|
2400
2404
|
14: [
|
|
@@ -2808,8 +2812,8 @@ require = function () {
|
|
|
2808
2812
|
node.replaceChildren(...typeof children === 'string' ? [children] : children);
|
|
2809
2813
|
return node;
|
|
2810
2814
|
}
|
|
2811
|
-
function isChildren(
|
|
2812
|
-
return !!(
|
|
2815
|
+
function isChildren(param) {
|
|
2816
|
+
return !!(param === null || param === void 0 ? void 0 : param[global_1.Symbol.iterator]);
|
|
2813
2817
|
}
|
|
2814
2818
|
exports.isChildren = isChildren;
|
|
2815
2819
|
function defrag(nodes) {
|
|
@@ -3578,11 +3582,20 @@ require = function () {
|
|
|
3578
3582
|
if (typeof cost === 'function')
|
|
3579
3583
|
return creator(1, cost);
|
|
3580
3584
|
return (source, context) => {
|
|
3581
|
-
const {
|
|
3582
|
-
|
|
3585
|
+
const {
|
|
3586
|
+
resources = {
|
|
3587
|
+
budget: 1,
|
|
3588
|
+
recursion: 1
|
|
3589
|
+
}
|
|
3590
|
+
} = context;
|
|
3591
|
+
if (resources.budget <= 0)
|
|
3583
3592
|
throw new Error('Too many creations.');
|
|
3593
|
+
if (resources.recursion <= 0)
|
|
3594
|
+
throw new Error('Too much recursion.');
|
|
3595
|
+
--resources.recursion;
|
|
3584
3596
|
const result = parser(source, context);
|
|
3585
|
-
|
|
3597
|
+
++resources.recursion;
|
|
3598
|
+
if (result) {
|
|
3586
3599
|
resources.budget -= cost;
|
|
3587
3600
|
}
|
|
3588
3601
|
return result;
|
|
@@ -3665,7 +3678,6 @@ require = function () {
|
|
|
3665
3678
|
const global_1 = _dereq_('spica/global');
|
|
3666
3679
|
const parser_1 = _dereq_('../../data/parser');
|
|
3667
3680
|
const fmap_1 = _dereq_('../monad/fmap');
|
|
3668
|
-
const resource_1 = _dereq_('./resource');
|
|
3669
3681
|
const array_1 = _dereq_('spica/array');
|
|
3670
3682
|
function surround(opener, parser, closer, optional = false, f, g) {
|
|
3671
3683
|
switch (typeof opener) {
|
|
@@ -3713,18 +3725,18 @@ require = function () {
|
|
|
3713
3725
|
function match(pattern) {
|
|
3714
3726
|
switch (typeof pattern) {
|
|
3715
3727
|
case 'string':
|
|
3716
|
-
return
|
|
3728
|
+
return source => source.slice(0, pattern.length) === pattern ? [
|
|
3717
3729
|
[],
|
|
3718
3730
|
source.slice(pattern.length)
|
|
3719
|
-
] : global_1.undefined
|
|
3731
|
+
] : global_1.undefined;
|
|
3720
3732
|
case 'object':
|
|
3721
|
-
return
|
|
3733
|
+
return source => {
|
|
3722
3734
|
const m = source.match(pattern);
|
|
3723
3735
|
return m ? [
|
|
3724
3736
|
[],
|
|
3725
3737
|
source.slice(m[0].length)
|
|
3726
3738
|
] : global_1.undefined;
|
|
3727
|
-
}
|
|
3739
|
+
};
|
|
3728
3740
|
}
|
|
3729
3741
|
}
|
|
3730
3742
|
function open(opener, parser, optional = false) {
|
|
@@ -3743,7 +3755,6 @@ require = function () {
|
|
|
3743
3755
|
{
|
|
3744
3756
|
'../../data/parser': 47,
|
|
3745
3757
|
'../monad/fmap': 46,
|
|
3746
|
-
'./resource': 40,
|
|
3747
3758
|
'spica/array': 6,
|
|
3748
3759
|
'spica/global': 15
|
|
3749
3760
|
}
|
|
@@ -3816,7 +3827,37 @@ require = function () {
|
|
|
3816
3827
|
function (_dereq_, module, exports) {
|
|
3817
3828
|
'use strict';
|
|
3818
3829
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3819
|
-
exports.check = exports.exec = exports.eval = void 0;
|
|
3830
|
+
exports.check = exports.exec = exports.eval = exports.Delimiters = void 0;
|
|
3831
|
+
class Delimiters {
|
|
3832
|
+
constructor() {
|
|
3833
|
+
this.stack = [];
|
|
3834
|
+
this.matchers = {};
|
|
3835
|
+
}
|
|
3836
|
+
push(delimiter) {
|
|
3837
|
+
var _a;
|
|
3838
|
+
var _b;
|
|
3839
|
+
const {signature, matcher} = delimiter;
|
|
3840
|
+
this.stack.push(signature);
|
|
3841
|
+
(_a = (_b = this.matchers)[signature]) !== null && _a !== void 0 ? _a : _b[signature] = matcher;
|
|
3842
|
+
}
|
|
3843
|
+
pop() {
|
|
3844
|
+
this.stack.pop();
|
|
3845
|
+
}
|
|
3846
|
+
match(source) {
|
|
3847
|
+
const {stack, matchers} = this;
|
|
3848
|
+
const log = {};
|
|
3849
|
+
for (let i = 0; i < stack.length; ++i) {
|
|
3850
|
+
const sig = stack[i];
|
|
3851
|
+
if (sig in log)
|
|
3852
|
+
continue;
|
|
3853
|
+
if (matchers[sig](source))
|
|
3854
|
+
return true;
|
|
3855
|
+
log[sig] = false;
|
|
3856
|
+
}
|
|
3857
|
+
return false;
|
|
3858
|
+
}
|
|
3859
|
+
}
|
|
3860
|
+
exports.Delimiters = Delimiters;
|
|
3820
3861
|
function eval_(result, default_) {
|
|
3821
3862
|
return result ? result[0] : default_;
|
|
3822
3863
|
}
|
|
@@ -3927,7 +3968,7 @@ require = function () {
|
|
|
3927
3968
|
return `r/${ pattern.source }/${ pattern.flags }`;
|
|
3928
3969
|
}
|
|
3929
3970
|
};
|
|
3930
|
-
const
|
|
3971
|
+
const matcher = (0, memoize_1.memoize)(pattern => {
|
|
3931
3972
|
switch (typeof pattern) {
|
|
3932
3973
|
case 'undefined':
|
|
3933
3974
|
return () => false;
|
|
@@ -3936,35 +3977,31 @@ require = function () {
|
|
|
3936
3977
|
case 'object':
|
|
3937
3978
|
return (0, memoize_1.reduce)(source => pattern.test(source));
|
|
3938
3979
|
}
|
|
3939
|
-
}, signature)
|
|
3980
|
+
}, signature);
|
|
3940
3981
|
function some(parser, until, deep, limit = -1) {
|
|
3941
3982
|
if (typeof until === 'number')
|
|
3942
3983
|
return some(parser, global_1.undefined, deep, until);
|
|
3943
3984
|
const match = matcher(until);
|
|
3944
|
-
const
|
|
3945
|
-
|
|
3985
|
+
const delimiter = {
|
|
3986
|
+
signature: signature(deep),
|
|
3987
|
+
matcher: matcher(deep)
|
|
3988
|
+
};
|
|
3946
3989
|
return (source, context) => {
|
|
3947
|
-
var _a, _b
|
|
3948
|
-
var _d;
|
|
3990
|
+
var _a, _b;
|
|
3949
3991
|
if (source === '')
|
|
3950
3992
|
return;
|
|
3951
3993
|
let rest = source;
|
|
3952
3994
|
let nodes;
|
|
3953
|
-
if (
|
|
3954
|
-
(_a = context.delimiters) !== null && _a !== void 0 ? _a : context.delimiters =
|
|
3955
|
-
|
|
3956
|
-
matchers: {}
|
|
3957
|
-
};
|
|
3958
|
-
context.delimiters.stack.push(sig);
|
|
3959
|
-
(_b = (_d = context.delimiters.matchers)[sig]) !== null && _b !== void 0 ? _b : _d[sig] = delim;
|
|
3995
|
+
if (deep && context) {
|
|
3996
|
+
(_a = context.delimiters) !== null && _a !== void 0 ? _a : context.delimiters = new parser_1.Delimiters();
|
|
3997
|
+
context.delimiters.push(delimiter);
|
|
3960
3998
|
}
|
|
3961
|
-
const {stack, matchers} = (_c = context.delimiters) !== null && _c !== void 0 ? _c : {};
|
|
3962
3999
|
while (true) {
|
|
3963
4000
|
if (rest === '')
|
|
3964
4001
|
break;
|
|
3965
4002
|
if (match(rest))
|
|
3966
4003
|
break;
|
|
3967
|
-
if (
|
|
4004
|
+
if ((_b = context.delimiters) === null || _b === void 0 ? void 0 : _b.match(rest))
|
|
3968
4005
|
break;
|
|
3969
4006
|
const result = parser(rest, context);
|
|
3970
4007
|
if (!result)
|
|
@@ -3974,8 +4011,8 @@ require = function () {
|
|
|
3974
4011
|
if (limit >= 0 && source.length - rest.length > limit)
|
|
3975
4012
|
break;
|
|
3976
4013
|
}
|
|
3977
|
-
if (
|
|
3978
|
-
|
|
4014
|
+
if (deep && context.delimiters) {
|
|
4015
|
+
context.delimiters.pop();
|
|
3979
4016
|
}
|
|
3980
4017
|
return nodes && rest.length < source.length ? [
|
|
3981
4018
|
nodes,
|
|
@@ -4590,7 +4627,12 @@ require = function () {
|
|
|
4590
4627
|
const paragraph_1 = _dereq_('./block/paragraph');
|
|
4591
4628
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
4592
4629
|
const random_1 = _dereq_('spica/random');
|
|
4593
|
-
exports.block = (0, combinator_1.creator)(error((0, combinator_1.reset)({
|
|
4630
|
+
exports.block = (0, combinator_1.creator)(error((0, combinator_1.reset)({
|
|
4631
|
+
resources: {
|
|
4632
|
+
budget: 100 * 1000,
|
|
4633
|
+
recursion: 200
|
|
4634
|
+
}
|
|
4635
|
+
}, (0, combinator_1.union)([
|
|
4594
4636
|
source_1.emptyline,
|
|
4595
4637
|
horizontalrule_1.horizontalrule,
|
|
4596
4638
|
heading_1.heading,
|
|
@@ -4613,8 +4655,7 @@ require = function () {
|
|
|
4613
4655
|
[
|
|
4614
4656
|
(0, typed_dom_1.html)('h1', {
|
|
4615
4657
|
id: id !== '' ? `error:${ (0, random_1.rnd0Z)(8) }` : global_1.undefined,
|
|
4616
|
-
class: 'error'
|
|
4617
|
-
translate: 'no'
|
|
4658
|
+
class: 'error'
|
|
4618
4659
|
}, reason instanceof Error ? `${ reason.name }: ${ reason.message }` : `UnknownError: ${ reason }`),
|
|
4619
4660
|
(0, typed_dom_1.html)('pre', {
|
|
4620
4661
|
class: 'error',
|
|
@@ -5073,6 +5114,7 @@ require = function () {
|
|
|
5073
5114
|
const util_1 = _dereq_('../../util');
|
|
5074
5115
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
5075
5116
|
const memoize_1 = _dereq_('spica/memoize');
|
|
5117
|
+
const array_1 = _dereq_('spica/array');
|
|
5076
5118
|
exports.segment = (0, combinator_1.block)((0, combinator_1.match)(/^(~{3,})(?:figure[^\S\n]+)?(?=\[?\$[A-Za-z-][^\n]*\n(?:[^\n]*\n)*?\1[^\S\n]*(?:$|\n))/, (0, memoize_1.memoize)(([, fence], closer = new RegExp(String.raw`^${ fence }[^\S\n]*(?:$|\n)`)) => (0, combinator_1.close)((0, combinator_1.sequence)([
|
|
5077
5119
|
(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /^.*\n/)),
|
|
5078
5120
|
(0, combinator_1.inits)([
|
|
@@ -5112,9 +5154,8 @@ require = function () {
|
|
|
5112
5154
|
(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))))))
|
|
5113
5155
|
])
|
|
5114
5156
|
])), ([label, param, content, ...caption]) => [(0, typed_dom_1.html)('figure', attributes(label.getAttribute('data-label'), param, content, caption), [
|
|
5115
|
-
(0, typed_dom_1.html)('div',
|
|
5116
|
-
(0, typed_dom_1.html)('span', { class: 'figindex' }),
|
|
5117
|
-
(0, typed_dom_1.html)('figcaption', (0, typed_dom_1.defrag)(caption))
|
|
5157
|
+
(0, typed_dom_1.html)('div', [content]),
|
|
5158
|
+
(0, typed_dom_1.html)('figcaption', (0, array_1.unshift)([(0, typed_dom_1.html)('span', { class: 'figindex' })], (0, typed_dom_1.defrag)(caption)))
|
|
5118
5159
|
])])));
|
|
5119
5160
|
function attributes(label, param, content, caption) {
|
|
5120
5161
|
const group = label.split('-', 1)[0];
|
|
@@ -5156,6 +5197,7 @@ require = function () {
|
|
|
5156
5197
|
'./example': 69,
|
|
5157
5198
|
'./placeholder': 74,
|
|
5158
5199
|
'./table': 75,
|
|
5200
|
+
'spica/array': 6,
|
|
5159
5201
|
'spica/global': 15,
|
|
5160
5202
|
'spica/memoize': 18,
|
|
5161
5203
|
'typed-dom': 26
|
|
@@ -5273,6 +5315,7 @@ require = function () {
|
|
|
5273
5315
|
exports.table = exports.segment_ = exports.segment = void 0;
|
|
5274
5316
|
const global_1 = _dereq_('spica/global');
|
|
5275
5317
|
const alias_1 = _dereq_('spica/alias');
|
|
5318
|
+
const parser_1 = _dereq_('../../../combinator/data/parser');
|
|
5276
5319
|
const combinator_1 = _dereq_('../../../combinator');
|
|
5277
5320
|
const inline_1 = _dereq_('../../inline');
|
|
5278
5321
|
const source_1 = _dereq_('../../source');
|
|
@@ -5283,23 +5326,17 @@ require = function () {
|
|
|
5283
5326
|
const opener = /^(~{3,})table(?!\S)([^\n]*)(?:$|\n)/;
|
|
5284
5327
|
exports.segment = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 10000))));
|
|
5285
5328
|
exports.segment_ = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.clear)((0, combinator_1.fence)(opener, 10000, false))), false);
|
|
5286
|
-
exports.table = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.recover)((0, combinator_1.
|
|
5329
|
+
exports.table = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, combinator_1.recover)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 10000), ([body, closer, opener, delim, param], _, context) => {
|
|
5287
5330
|
var _a;
|
|
5288
5331
|
if (!closer || param.trimStart())
|
|
5289
|
-
return [
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
''
|
|
5298
|
-
];
|
|
5299
|
-
return (_a = parser(body, context)) !== null && _a !== void 0 ? _a : [
|
|
5300
|
-
[(0, typed_dom_1.html)('table')],
|
|
5301
|
-
''
|
|
5302
|
-
];
|
|
5332
|
+
return [(0, typed_dom_1.html)('pre', {
|
|
5333
|
+
class: 'invalid',
|
|
5334
|
+
translate: 'no',
|
|
5335
|
+
'data-invalid-syntax': 'table',
|
|
5336
|
+
'data-invalid-type': !closer ? 'closer' : 'argument',
|
|
5337
|
+
'data-invalid-description': !closer ? `Missing the closing delimiter "${ delim }".` : 'Invalid argument.'
|
|
5338
|
+
}, `${ opener }${ body }${ closer }`)];
|
|
5339
|
+
return (_a = (0, parser_1.eval)(parser(body, context))) !== null && _a !== void 0 ? _a : [(0, typed_dom_1.html)('table')];
|
|
5303
5340
|
}), (source, _, reason) => reason instanceof Error && reason.message === 'Number of columns must be 32 or less.' ? [
|
|
5304
5341
|
[(0, typed_dom_1.html)('pre', {
|
|
5305
5342
|
class: 'invalid',
|
|
@@ -5528,6 +5565,7 @@ require = function () {
|
|
|
5528
5565
|
},
|
|
5529
5566
|
{
|
|
5530
5567
|
'../../../combinator': 27,
|
|
5568
|
+
'../../../combinator/data/parser': 47,
|
|
5531
5569
|
'../../inline': 88,
|
|
5532
5570
|
'../../locale': 123,
|
|
5533
5571
|
'../../source': 128,
|
|
@@ -6294,7 +6332,7 @@ require = function () {
|
|
|
6294
6332
|
}
|
|
6295
6333
|
},
|
|
6296
6334
|
state: global_1.undefined
|
|
6297
|
-
}, (0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, ')', /^\\?\n/)]))
|
|
6335
|
+
}, (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)))]))));
|
|
6298
6336
|
},
|
|
6299
6337
|
{
|
|
6300
6338
|
'../../combinator': 27,
|
|
@@ -6572,16 +6610,8 @@ require = function () {
|
|
|
6572
6610
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
6573
6611
|
const array_1 = _dereq_('spica/array');
|
|
6574
6612
|
const index = /^(?:[0-9]+(?:\.[0-9]+)*|[A-Za-z])/;
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
(0, combinator_1.surround)((0, source_1.str)('('), (0, source_1.str)(index), (0, source_1.str)(')'), false, ([as, bs = [], cs], rest) => [
|
|
6578
|
-
(0, typed_dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)),
|
|
6579
|
-
rest
|
|
6580
|
-
]),
|
|
6581
|
-
(0, combinator_1.surround)((0, source_1.str)('\uFF08'), (0, source_1.str)(indexFW), (0, source_1.str)('\uFF09'), false, ([as, bs = [], cs], rest) => [
|
|
6582
|
-
(0, typed_dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)),
|
|
6583
|
-
rest
|
|
6584
|
-
]),
|
|
6613
|
+
exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.union)([
|
|
6614
|
+
(0, combinator_1.surround)((0, source_1.str)('('), (0, source_1.str)(index), (0, source_1.str)(')')),
|
|
6585
6615
|
(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)(inline_1.inline, ')'), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [
|
|
6586
6616
|
[(0, typed_dom_1.html)('span', { class: 'paren' }, (0, typed_dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))],
|
|
6587
6617
|
rest
|
|
@@ -6589,6 +6619,7 @@ require = function () {
|
|
|
6589
6619
|
(0, array_1.unshift)(as, bs),
|
|
6590
6620
|
rest
|
|
6591
6621
|
]),
|
|
6622
|
+
(0, combinator_1.surround)((0, source_1.str)('\uFF08'), (0, source_1.str)(new RegExp(index.source.replace(/[09AZaz.]/g, c => String.fromCharCode(c.charCodeAt(0) + 65248)))), (0, source_1.str)('\uFF09')),
|
|
6592
6623
|
(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) => [
|
|
6593
6624
|
[(0, typed_dom_1.html)('span', { class: 'paren' }, (0, typed_dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))],
|
|
6594
6625
|
rest
|
|
@@ -6608,7 +6639,7 @@ require = function () {
|
|
|
6608
6639
|
(0, array_1.unshift)(as, bs),
|
|
6609
6640
|
rest
|
|
6610
6641
|
])
|
|
6611
|
-
]));
|
|
6642
|
+
])));
|
|
6612
6643
|
},
|
|
6613
6644
|
{
|
|
6614
6645
|
'../../combinator': 27,
|
|
@@ -6681,8 +6712,11 @@ require = function () {
|
|
|
6681
6712
|
const util_1 = _dereq_('../util');
|
|
6682
6713
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
6683
6714
|
const array_1 = _dereq_('spica/array');
|
|
6684
|
-
exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('~~'), (0, combinator_1.
|
|
6685
|
-
|
|
6715
|
+
exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('~~'), (0, combinator_1.some)((0, combinator_1.union)([
|
|
6716
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, '~~')),
|
|
6717
|
+
(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '~'), true)
|
|
6718
|
+
])), (0, source_1.str)('~~'), false, ([, bs], rest) => [
|
|
6719
|
+
[(0, typed_dom_1.html)('del', (0, typed_dom_1.defrag)(bs))],
|
|
6686
6720
|
rest
|
|
6687
6721
|
], ([as, bs], rest) => [
|
|
6688
6722
|
(0, array_1.unshift)(as, bs),
|
|
@@ -6712,14 +6746,11 @@ require = function () {
|
|
|
6712
6746
|
const array_1 = _dereq_('spica/array');
|
|
6713
6747
|
exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('*'), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([
|
|
6714
6748
|
strong_1.strong,
|
|
6715
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
6749
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', '*')),
|
|
6716
6750
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)
|
|
6717
|
-
])), '*'), (0, source_1.str)('*'), false, ([
|
|
6751
|
+
])), '*'), (0, source_1.str)('*'), false, ([, bs], rest) => [
|
|
6718
6752
|
[(0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)(bs))],
|
|
6719
6753
|
rest
|
|
6720
|
-
] : [
|
|
6721
|
-
(0, array_1.unshift)(as, bs),
|
|
6722
|
-
cs[0] + rest
|
|
6723
6754
|
], ([as, bs], rest) => [
|
|
6724
6755
|
(0, array_1.unshift)(as, bs),
|
|
6725
6756
|
rest
|
|
@@ -6748,24 +6779,19 @@ require = function () {
|
|
|
6748
6779
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
6749
6780
|
const array_1 = _dereq_('spica/array');
|
|
6750
6781
|
const substrong = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([
|
|
6751
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
6782
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', '**')),
|
|
6752
6783
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)
|
|
6753
6784
|
])));
|
|
6754
6785
|
const subemphasis = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([
|
|
6755
6786
|
strong_1.strong,
|
|
6756
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
6787
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', '*')),
|
|
6757
6788
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)
|
|
6758
6789
|
])));
|
|
6759
6790
|
exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('***'), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([
|
|
6760
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
6791
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', '*')),
|
|
6761
6792
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)
|
|
6762
|
-
]))), (0, source_1.str)(/^\*{1,3}/), false, ([
|
|
6793
|
+
]))), (0, source_1.str)(/^\*{1,3}/), false, ([, bs, cs], rest, context) => {
|
|
6763
6794
|
var _a, _b;
|
|
6764
|
-
if (!(0, util_1.isEndTightNodes)(bs))
|
|
6765
|
-
return [
|
|
6766
|
-
(0, array_1.unshift)(as, bs),
|
|
6767
|
-
cs[0] + rest
|
|
6768
|
-
];
|
|
6769
6795
|
switch (cs[0]) {
|
|
6770
6796
|
case '***':
|
|
6771
6797
|
return [
|
|
@@ -6773,7 +6799,7 @@ require = function () {
|
|
|
6773
6799
|
rest
|
|
6774
6800
|
];
|
|
6775
6801
|
case '**':
|
|
6776
|
-
return (_a = (0, combinator_1.bind)(subemphasis, (ds, rest) => rest.slice(0, 1) === '*'
|
|
6802
|
+
return (_a = (0, combinator_1.bind)(subemphasis, (ds, rest) => rest.slice(0, 1) === '*' ? [
|
|
6777
6803
|
[(0, typed_dom_1.html)('em', (0, array_1.unshift)([(0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)(bs))], (0, typed_dom_1.defrag)(ds)))],
|
|
6778
6804
|
rest.slice(1)
|
|
6779
6805
|
] : [
|
|
@@ -6790,7 +6816,7 @@ require = function () {
|
|
|
6790
6816
|
rest
|
|
6791
6817
|
];
|
|
6792
6818
|
case '*':
|
|
6793
|
-
return (_b = (0, combinator_1.bind)(substrong, (ds, rest) => rest.slice(0, 2) === '**'
|
|
6819
|
+
return (_b = (0, combinator_1.bind)(substrong, (ds, rest) => rest.slice(0, 2) === '**' ? [
|
|
6794
6820
|
[(0, typed_dom_1.html)('strong', (0, array_1.unshift)([(0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)(bs))], (0, typed_dom_1.defrag)(ds)))],
|
|
6795
6821
|
rest.slice(2)
|
|
6796
6822
|
] : [
|
|
@@ -7151,11 +7177,11 @@ require = function () {
|
|
|
7151
7177
|
(0, alias_1.ObjectSetPrototypeOf)(attrspec, null);
|
|
7152
7178
|
(0, alias_1.ObjectValues)(attrspec).forEach(o => (0, alias_1.ObjectSetPrototypeOf)(o, null));
|
|
7153
7179
|
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)([
|
|
7154
|
-
(0, combinator_1.match)(/^(?=<(wbr)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)(`<${ tag }`, (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])),
|
|
7180
|
+
(0, combinator_1.match)(/^(?=<(wbr)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)(`<${ tag }`, (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), /^\s*>/, true, ([, bs = []], rest) => [
|
|
7155
7181
|
[(0, typed_dom_1.html)(tag, attributes('html', [], attrspec[tag], bs))],
|
|
7156
7182
|
rest
|
|
7157
7183
|
]), ([, tag]) => tag)),
|
|
7158
|
-
(0, combinator_1.match)(/^(?=<(sup|sub|small
|
|
7184
|
+
(0, combinator_1.match)(/^(?=<(sup|sub|small)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.validate)(`<${ tag }`, `</${ tag }>`, (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${ tag }`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^\s*>/), true), (0, util_1.startLoose)((0, combinator_1.context)((() => {
|
|
7159
7185
|
switch (tag) {
|
|
7160
7186
|
case 'sup':
|
|
7161
7187
|
case 'sub':
|
|
@@ -7177,12 +7203,28 @@ require = function () {
|
|
|
7177
7203
|
default:
|
|
7178
7204
|
return {};
|
|
7179
7205
|
}
|
|
7180
|
-
})(), (0, combinator_1.some)((0, combinator_1.union)([
|
|
7181
|
-
|
|
7206
|
+
})(), (0, combinator_1.some)((0, combinator_1.union)([
|
|
7207
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, `</${ tag }>`)),
|
|
7208
|
+
(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '</'), true)
|
|
7209
|
+
]), `</${ tag }>`)), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest, context) => [
|
|
7210
|
+
[elem(tag, as, (0, typed_dom_1.defrag)(bs), cs, context)],
|
|
7182
7211
|
rest
|
|
7183
7212
|
])), ([, tag]) => tag)),
|
|
7184
|
-
(0, combinator_1.match)(/^(?=<(
|
|
7185
|
-
|
|
7213
|
+
(0, combinator_1.match)(/^(?=<(bdo|bdi)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.validate)(`<${ tag }`, `</${ tag }>`, (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${ tag }`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^\s*>/), true), (0, util_1.startLoose)((0, combinator_1.some)((0, combinator_1.union)([
|
|
7214
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, `</${ tag }>`)),
|
|
7215
|
+
(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '</'), true)
|
|
7216
|
+
]), `</${ tag }>`), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest) => [
|
|
7217
|
+
[elem(tag, as, (0, typed_dom_1.defrag)(bs), cs, {})],
|
|
7218
|
+
rest
|
|
7219
|
+
], ([as, bs], rest) => as.length === 1 ? [
|
|
7220
|
+
(0, array_1.unshift)(as, bs),
|
|
7221
|
+
rest
|
|
7222
|
+
] : global_1.undefined)), ([, tag]) => tag)),
|
|
7223
|
+
(0, combinator_1.match)(/^(?=<([a-z]+)(?=[^\S\n]|>))/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.validate)(`<${ tag }`, `</${ tag }>`, (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${ tag }`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^\s*>/), true), (0, util_1.startLoose)((0, combinator_1.some)((0, combinator_1.union)([
|
|
7224
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, `</${ tag }>`)),
|
|
7225
|
+
(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '</'), true)
|
|
7226
|
+
]), `</${ tag }>`), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest) => [
|
|
7227
|
+
[elem(tag, as, (0, typed_dom_1.defrag)(bs), cs, {})],
|
|
7186
7228
|
rest
|
|
7187
7229
|
], ([as, bs], rest) => as.length === 1 ? [
|
|
7188
7230
|
(0, array_1.unshift)(as, bs),
|
|
@@ -7212,10 +7254,8 @@ require = function () {
|
|
|
7212
7254
|
}
|
|
7213
7255
|
let attrs;
|
|
7214
7256
|
switch (true) {
|
|
7215
|
-
case
|
|
7257
|
+
case 'data-invalid-syntax' in (attrs = attributes('html', [], attrspec[tag], as.slice(1, -1))):
|
|
7216
7258
|
return invalid('attribute', 'Invalid HTML attribute.', as, bs, cs);
|
|
7217
|
-
case cs.length === 0:
|
|
7218
|
-
return invalid('closer', `Missing the closing HTML tag <${ tag }>.`, as, bs, cs);
|
|
7219
7259
|
default:
|
|
7220
7260
|
return (0, typed_dom_1.html)(tag, attrs, bs);
|
|
7221
7261
|
}
|
|
@@ -7273,21 +7313,35 @@ require = function () {
|
|
|
7273
7313
|
'use strict';
|
|
7274
7314
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7275
7315
|
exports.htmlentity = exports.unsafehtmlentity = void 0;
|
|
7316
|
+
const global_1 = _dereq_('spica/global');
|
|
7276
7317
|
const combinator_1 = _dereq_('../../combinator');
|
|
7277
7318
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7319
|
+
const memoize_1 = _dereq_('spica/memoize');
|
|
7320
|
+
exports.unsafehtmlentity = (0, combinator_1.creator)((0, combinator_1.validate)('&', (0, combinator_1.focus)(/^&[0-9A-Za-z]+;/, entity => {
|
|
7321
|
+
var _a;
|
|
7322
|
+
return [
|
|
7323
|
+
[(_a = parse(entity)) !== null && _a !== void 0 ? _a : `\0${ entity }`],
|
|
7324
|
+
''
|
|
7325
|
+
];
|
|
7326
|
+
})));
|
|
7327
|
+
exports.htmlentity = (0, combinator_1.fmap)((0, combinator_1.union)([exports.unsafehtmlentity]), ([test]) => [test[0] === '\0' ? (0, typed_dom_1.html)('span', {
|
|
7283
7328
|
class: 'invalid',
|
|
7284
7329
|
'data-invalid-syntax': 'htmlentity',
|
|
7285
7330
|
'data-invalid-type': 'syntax',
|
|
7286
7331
|
'data-invalid-description': 'Invalid HTML entity.'
|
|
7287
|
-
},
|
|
7332
|
+
}, test.slice(1)) : test]);
|
|
7333
|
+
const parse = (0, memoize_1.reduce)((el => entity => {
|
|
7334
|
+
if (entity === '
')
|
|
7335
|
+
return ' ';
|
|
7336
|
+
el.innerHTML = entity;
|
|
7337
|
+
const text = el.textContent;
|
|
7338
|
+
return entity === text ? global_1.undefined : text;
|
|
7339
|
+
})((0, typed_dom_1.html)('b')));
|
|
7288
7340
|
},
|
|
7289
7341
|
{
|
|
7290
7342
|
'../../combinator': 27,
|
|
7343
|
+
'spica/global': 15,
|
|
7344
|
+
'spica/memoize': 18,
|
|
7291
7345
|
'typed-dom': 26
|
|
7292
7346
|
}
|
|
7293
7347
|
],
|
|
@@ -7302,8 +7356,11 @@ require = function () {
|
|
|
7302
7356
|
const util_1 = _dereq_('../util');
|
|
7303
7357
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
7304
7358
|
const array_1 = _dereq_('spica/array');
|
|
7305
|
-
exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('++'), (0, combinator_1.
|
|
7306
|
-
|
|
7359
|
+
exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('++'), (0, combinator_1.some)((0, combinator_1.union)([
|
|
7360
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, '++')),
|
|
7361
|
+
(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '+'), true)
|
|
7362
|
+
])), (0, source_1.str)('++'), false, ([, bs], rest) => [
|
|
7363
|
+
[(0, typed_dom_1.html)('ins', (0, typed_dom_1.defrag)(bs))],
|
|
7307
7364
|
rest
|
|
7308
7365
|
], ([as, bs], rest) => [
|
|
7309
7366
|
(0, array_1.unshift)(as, bs),
|
|
@@ -7358,18 +7415,18 @@ require = function () {
|
|
|
7358
7415
|
autolink: false
|
|
7359
7416
|
}
|
|
7360
7417
|
}
|
|
7361
|
-
}, (0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/))
|
|
7418
|
+
}, (0, util_1.trimSpaceStart)((0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/)))), ']', true)
|
|
7362
7419
|
]))),
|
|
7363
7420
|
(0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([
|
|
7364
7421
|
exports.uri,
|
|
7365
7422
|
(0, combinator_1.some)(exports.option)
|
|
7366
|
-
]), /^[^\S\n]
|
|
7423
|
+
]), /^[^\S\n]*}/))
|
|
7367
7424
|
]))), ([params, content = []], rest, context) => {
|
|
7368
7425
|
var _a, _b, _c, _d, _e, _f;
|
|
7369
7426
|
if ((_a = (0, parser_1.eval)((0, combinator_1.some)(autolink_1.autolink)((0, util_1.stringify)(content), context))) === null || _a === void 0 ? void 0 : _a.some(node => typeof node === 'object'))
|
|
7370
7427
|
return;
|
|
7371
7428
|
const INSECURE_URI = params.shift();
|
|
7372
|
-
const el = elem(INSECURE_URI, (0, util_1.
|
|
7429
|
+
const el = elem(INSECURE_URI, (0, util_1.trimNodeEnd)((0, typed_dom_1.defrag)(content)), new url_1.ReadonlyURL(resolve(INSECURE_URI, (_b = context.host) !== null && _b !== void 0 ? _b : global_1.location, (_d = (_c = context.url) !== null && _c !== void 0 ? _c : context.host) !== null && _d !== void 0 ? _d : global_1.location), ((_e = context.host) === null || _e === void 0 ? void 0 : _e.href) || global_1.location.href), ((_f = context.host) === null || _f === void 0 ? void 0 : _f.origin) || global_1.location.origin);
|
|
7373
7430
|
if (el.classList.contains('invalid'))
|
|
7374
7431
|
return [
|
|
7375
7432
|
[el],
|
|
@@ -7381,14 +7438,13 @@ require = function () {
|
|
|
7381
7438
|
];
|
|
7382
7439
|
}))));
|
|
7383
7440
|
exports.uri = (0, combinator_1.union)([
|
|
7384
|
-
(0, combinator_1.open)(/^[^\S\n]
|
|
7441
|
+
(0, combinator_1.open)(/^[^\S\n]+/, (0, source_1.str)(/^\S+/)),
|
|
7385
7442
|
(0, source_1.str)(/^[^\s{}]+/)
|
|
7386
7443
|
]);
|
|
7387
7444
|
exports.option = (0, combinator_1.union)([
|
|
7388
7445
|
(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+nofollow(?=[^\S\n]|})/), () => [` rel="nofollow"`]),
|
|
7389
7446
|
(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|})/),
|
|
7390
|
-
(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+
|
|
7391
|
-
(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[^\n{}]+/), opt => [` \\${ opt.slice(1) }`])
|
|
7447
|
+
(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[^\s{}]+/), opt => [` \\${ opt.slice(1) }`])
|
|
7392
7448
|
]);
|
|
7393
7449
|
function resolve(uri, host, source) {
|
|
7394
7450
|
switch (true) {
|
|
@@ -7475,14 +7531,11 @@ require = function () {
|
|
|
7475
7531
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
7476
7532
|
const array_1 = _dereq_('spica/array');
|
|
7477
7533
|
exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('=='), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([
|
|
7478
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
7534
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', '==')),
|
|
7479
7535
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '='), inline_1.inline)
|
|
7480
|
-
]))), (0, source_1.str)('=='), false, ([
|
|
7536
|
+
]))), (0, source_1.str)('=='), false, ([, bs], rest) => [
|
|
7481
7537
|
[(0, typed_dom_1.html)('mark', (0, typed_dom_1.defrag)(bs))],
|
|
7482
7538
|
rest
|
|
7483
|
-
] : [
|
|
7484
|
-
(0, array_1.unshift)(as, bs),
|
|
7485
|
-
cs[0] + rest
|
|
7486
7539
|
], ([as, bs], rest) => [
|
|
7487
7540
|
(0, array_1.unshift)(as, bs),
|
|
7488
7541
|
rest
|
|
@@ -7576,7 +7629,7 @@ require = function () {
|
|
|
7576
7629
|
(0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([
|
|
7577
7630
|
link_1.uri,
|
|
7578
7631
|
(0, combinator_1.some)(option)
|
|
7579
|
-
]), /^[^\S\n]
|
|
7632
|
+
]), /^[^\S\n]*}/))
|
|
7580
7633
|
]))), ([as, bs]) => bs ? [
|
|
7581
7634
|
[(0, array_1.join)(as).trim() || (0, array_1.join)(as)],
|
|
7582
7635
|
bs
|
|
@@ -7720,16 +7773,16 @@ require = function () {
|
|
|
7720
7773
|
state: global_1.undefined
|
|
7721
7774
|
}, (0, combinator_1.subsequence)([
|
|
7722
7775
|
abbr,
|
|
7723
|
-
(0, combinator_1.focus)(
|
|
7776
|
+
(0, combinator_1.focus)(/^\^[^\S\n]*/, source => [
|
|
7724
7777
|
[
|
|
7725
7778
|
'',
|
|
7726
|
-
|
|
7779
|
+
source
|
|
7727
7780
|
],
|
|
7728
7781
|
''
|
|
7729
7782
|
]),
|
|
7730
|
-
(0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/)
|
|
7731
|
-
]))
|
|
7732
|
-
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]
|
|
7783
|
+
(0, util_1.trimSpaceStart)((0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/))
|
|
7784
|
+
])))), ']]'), ns => [(0, typed_dom_1.html)('sup', attributes(ns), (0, util_1.trimNodeEnd)((0, typed_dom_1.defrag)(ns)))]))));
|
|
7785
|
+
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)]));
|
|
7733
7786
|
function attributes(ns) {
|
|
7734
7787
|
return typeof ns[0] === 'object' && ns[0].tagName === 'ABBR' ? {
|
|
7735
7788
|
class: 'reference',
|
|
@@ -7838,7 +7891,7 @@ require = function () {
|
|
|
7838
7891
|
rubies
|
|
7839
7892
|
]) {
|
|
7840
7893
|
for (let i = 0; i < ss.length; ++i) {
|
|
7841
|
-
if (
|
|
7894
|
+
if (ss[i].indexOf('\0') === -1)
|
|
7842
7895
|
continue;
|
|
7843
7896
|
ss[i] = ss[i].replace(/\0/g, '');
|
|
7844
7897
|
attrs !== null && attrs !== void 0 ? attrs : attrs = {
|
|
@@ -7894,14 +7947,11 @@ require = function () {
|
|
|
7894
7947
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
7895
7948
|
const array_1 = _dereq_('spica/array');
|
|
7896
7949
|
exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('**'), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([
|
|
7897
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
7950
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', '**')),
|
|
7898
7951
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)
|
|
7899
|
-
])), '*'), (0, source_1.str)('**'), false, ([
|
|
7952
|
+
])), '*'), (0, source_1.str)('**'), false, ([, bs], rest) => [
|
|
7900
7953
|
[(0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)(bs))],
|
|
7901
7954
|
rest
|
|
7902
|
-
] : [
|
|
7903
|
-
(0, array_1.unshift)(as, bs),
|
|
7904
|
-
cs[0] + rest
|
|
7905
7955
|
], ([as, bs], rest) => [
|
|
7906
7956
|
(0, array_1.unshift)(as, bs),
|
|
7907
7957
|
rest
|
|
@@ -8115,7 +8165,7 @@ require = function () {
|
|
|
8115
8165
|
!(0, label_1.isFixed)(label) && numbers.set(group, number);
|
|
8116
8166
|
opts.id !== '' && def.setAttribute('id', `label:${ opts.id ? `${ opts.id }:` : '' }${ label }`);
|
|
8117
8167
|
const figindex = group === '$' ? `(${ number })` : `${ capitalize(group) }${ group === 'fig' ? '.' : '' } ${ number }`;
|
|
8118
|
-
(0, typed_dom_1.define)(def.querySelector(':scope > .figindex'), group === '$' ? figindex : `${ figindex }. `);
|
|
8168
|
+
(0, typed_dom_1.define)(def.querySelector(':scope > figcaption > .figindex'), group === '$' ? figindex : `${ figindex }. `);
|
|
8119
8169
|
for (const ref of refs.take(label, global_1.Infinity)) {
|
|
8120
8170
|
if (ref.hash.slice(1) === def.id && ref.innerText === figindex)
|
|
8121
8171
|
continue;
|
|
@@ -8687,18 +8737,19 @@ require = function () {
|
|
|
8687
8737
|
function (_dereq_, module, exports) {
|
|
8688
8738
|
'use strict';
|
|
8689
8739
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8690
|
-
exports.stringify = exports.
|
|
8740
|
+
exports.stringify = exports.trimNodeEnd = exports.trimSpaceStart = exports.isStartTightNodes = exports.startTight = exports.isStartLoose = exports.startLoose = exports.visualize = exports.blank = void 0;
|
|
8691
8741
|
const global_1 = _dereq_('spica/global');
|
|
8692
8742
|
const parser_1 = _dereq_('../combinator/data/parser');
|
|
8693
8743
|
const combinator_1 = _dereq_('../combinator');
|
|
8694
8744
|
const htmlentity_1 = _dereq_('./inline/htmlentity');
|
|
8695
8745
|
const source_1 = _dereq_('./source');
|
|
8696
8746
|
const normalize_1 = _dereq_('./api/normalize');
|
|
8747
|
+
const memoize_1 = _dereq_('spica/memoize');
|
|
8697
8748
|
const array_1 = _dereq_('spica/array');
|
|
8698
|
-
function
|
|
8699
|
-
return new RegExp(String.raw
|
|
8749
|
+
function blank(prefix, suffix) {
|
|
8750
|
+
return new RegExp(String.raw`^${ prefix && prefix.source }(?:\\\s|[^\S\n]+|\n|&(?:${ normalize_1.invisibleHTMLEntityNames.join('|') });|<wbr>)?${ typeof suffix === 'string' ? suffix.replace(/[*+()\[\]]/g, '\\$&') : suffix.source }`);
|
|
8700
8751
|
}
|
|
8701
|
-
exports.
|
|
8752
|
+
exports.blank = blank;
|
|
8702
8753
|
function visualize(parser) {
|
|
8703
8754
|
const blankline = new RegExp(String.raw`^(?:\\$|\\?[^\S\n]|&(?:${ normalize_1.invisibleHTMLEntityNames.join('|') });|<wbr>)+$`, 'gm');
|
|
8704
8755
|
return (0, combinator_1.union)([
|
|
@@ -8732,21 +8783,17 @@ require = function () {
|
|
|
8732
8783
|
return false;
|
|
8733
8784
|
}
|
|
8734
8785
|
function startLoose(parser, except) {
|
|
8735
|
-
return (source, context) => isStartLoose(source, context, except) ? parser(source, context) : global_1.undefined;
|
|
8786
|
+
return (source, context) => (0, exports.isStartLoose)(source, context, except) ? parser(source, context) : global_1.undefined;
|
|
8736
8787
|
}
|
|
8737
8788
|
exports.startLoose = startLoose;
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
return true;
|
|
8742
|
-
return isStartTight(source, context, except);
|
|
8743
|
-
}
|
|
8744
|
-
exports.isStartLoose = isStartLoose;
|
|
8789
|
+
exports.isStartLoose = (0, memoize_1.reduce)((source, context, except) => {
|
|
8790
|
+
return isStartTight(source.replace(/^[^\S\n]+/, ''), context, except);
|
|
8791
|
+
}, (source, _, except = '') => `${ source }\0${ except }`);
|
|
8745
8792
|
function startTight(parser, except) {
|
|
8746
8793
|
return (source, context) => isStartTight(source, context, except) ? parser(source, context) : global_1.undefined;
|
|
8747
8794
|
}
|
|
8748
8795
|
exports.startTight = startTight;
|
|
8749
|
-
|
|
8796
|
+
const isStartTight = (0, memoize_1.reduce)((source, context, except) => {
|
|
8750
8797
|
var _a, _b, _c;
|
|
8751
8798
|
if (source === '')
|
|
8752
8799
|
return true;
|
|
@@ -8775,19 +8822,13 @@ require = function () {
|
|
|
8775
8822
|
default:
|
|
8776
8823
|
return source[0].trimStart() !== '';
|
|
8777
8824
|
}
|
|
8778
|
-
}
|
|
8825
|
+
}, (source, _, except = '') => `${ source }\0${ except }`);
|
|
8779
8826
|
function isStartTightNodes(nodes) {
|
|
8780
8827
|
if (nodes.length === 0)
|
|
8781
8828
|
return true;
|
|
8782
8829
|
return isVisible(nodes[0], 0);
|
|
8783
8830
|
}
|
|
8784
8831
|
exports.isStartTightNodes = isStartTightNodes;
|
|
8785
|
-
function isEndTightNodes(nodes) {
|
|
8786
|
-
if (nodes.length === 0)
|
|
8787
|
-
return true;
|
|
8788
|
-
return isVisible(nodes[nodes.length - 1], -1);
|
|
8789
|
-
}
|
|
8790
|
-
exports.isEndTightNodes = isEndTightNodes;
|
|
8791
8832
|
function isVisible(node, strpos) {
|
|
8792
8833
|
switch (typeof node) {
|
|
8793
8834
|
case 'string':
|
|
@@ -8813,25 +8854,10 @@ require = function () {
|
|
|
8813
8854
|
}
|
|
8814
8855
|
}
|
|
8815
8856
|
}
|
|
8816
|
-
function
|
|
8817
|
-
return
|
|
8818
|
-
}
|
|
8819
|
-
exports.trimNode = trimNode;
|
|
8820
|
-
function trimNodeStart(nodes) {
|
|
8821
|
-
for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes[0], 0);) {
|
|
8822
|
-
if (nodes.length === 1 && typeof node === 'object' && node.className === 'indexer')
|
|
8823
|
-
break;
|
|
8824
|
-
if (typeof node === 'string') {
|
|
8825
|
-
const pos = node.length - node.trimStart().length;
|
|
8826
|
-
if (pos > 0) {
|
|
8827
|
-
nodes[0] = node.slice(pos);
|
|
8828
|
-
break;
|
|
8829
|
-
}
|
|
8830
|
-
}
|
|
8831
|
-
nodes.shift();
|
|
8832
|
-
}
|
|
8833
|
-
return nodes;
|
|
8857
|
+
function trimSpaceStart(parser) {
|
|
8858
|
+
return (0, combinator_1.convert)((0, memoize_1.reduce)(source => source.replace(/^[^\S\n]+/, '')), parser);
|
|
8834
8859
|
}
|
|
8860
|
+
exports.trimSpaceStart = trimSpaceStart;
|
|
8835
8861
|
function trimNodeEnd(nodes) {
|
|
8836
8862
|
const skip = nodes.length > 0 && typeof nodes[nodes.length - 1] === 'object' && nodes[nodes.length - 1]['className'] === 'indexer' ? [nodes.pop()] : [];
|
|
8837
8863
|
for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes[nodes.length - 1], -1);) {
|
|
@@ -8847,13 +8873,6 @@ require = function () {
|
|
|
8847
8873
|
return (0, array_1.push)(nodes, skip);
|
|
8848
8874
|
}
|
|
8849
8875
|
exports.trimNodeEnd = trimNodeEnd;
|
|
8850
|
-
function trimNodeEndBR(nodes) {
|
|
8851
|
-
if (nodes.length === 0)
|
|
8852
|
-
return nodes;
|
|
8853
|
-
const node = nodes[nodes.length - 1];
|
|
8854
|
-
return typeof node === 'object' && node.tagName === 'BR' ? (0, array_1.pop)(nodes)[0] : nodes;
|
|
8855
|
-
}
|
|
8856
|
-
exports.trimNodeEndBR = trimNodeEndBR;
|
|
8857
8876
|
function stringify(nodes) {
|
|
8858
8877
|
let acc = '';
|
|
8859
8878
|
for (let i = 0; i < nodes.length; ++i) {
|
|
@@ -8875,7 +8894,8 @@ require = function () {
|
|
|
8875
8894
|
'./inline/htmlentity': 112,
|
|
8876
8895
|
'./source': 128,
|
|
8877
8896
|
'spica/array': 6,
|
|
8878
|
-
'spica/global': 15
|
|
8897
|
+
'spica/global': 15,
|
|
8898
|
+
'spica/memoize': 18
|
|
8879
8899
|
}
|
|
8880
8900
|
],
|
|
8881
8901
|
135: [
|