securemark 0.235.1 → 0.235.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 +4 -0
- package/dist/securemark.js +70 -77
- package/markdown.d.ts +5 -2
- package/package-lock.json +4 -4
- package/package.json +1 -1
- package/src/parser/api/parse.test.ts +2 -2
- 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 -31
- package/src/parser/block/extension/figure.ts +1 -1
- package/src/parser/inline/annotation.ts +3 -3
- package/src/parser/inline/bracket.test.ts +10 -10
- package/src/parser/inline/bracket.ts +2 -5
- package/src/parser/inline/deletion.test.ts +4 -1
- package/src/parser/inline/deletion.ts +7 -4
- package/src/parser/inline/emphasis.ts +2 -2
- package/src/parser/inline/emstrong.ts +4 -4
- package/src/parser/inline/html.test.ts +25 -17
- package/src/parser/inline/html.ts +36 -12
- 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 +2 -2
- 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/strong.ts +2 -2
- package/src/parser/inline.test.ts +2 -2
- package/src/parser/processor/figure.test.ts +28 -28
- package/src/parser/util.ts +38 -32
package/CHANGELOG.md
CHANGED
package/dist/securemark.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.235.
|
|
1
|
+
/*! securemark v0.235.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) {
|
|
@@ -5150,7 +5150,7 @@ require = function () {
|
|
|
5150
5150
|
(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))))))
|
|
5151
5151
|
])
|
|
5152
5152
|
])), ([label, param, content, ...caption]) => [(0, typed_dom_1.html)('figure', attributes(label.getAttribute('data-label'), param, content, caption), [
|
|
5153
|
-
(0, typed_dom_1.html)('div',
|
|
5153
|
+
(0, typed_dom_1.html)('div', [content]),
|
|
5154
5154
|
(0, typed_dom_1.html)('figcaption', (0, array_1.unshift)([(0, typed_dom_1.html)('span', { class: 'figindex' })], (0, typed_dom_1.defrag)(caption)))
|
|
5155
5155
|
])])));
|
|
5156
5156
|
function attributes(label, param, content, caption) {
|
|
@@ -6328,7 +6328,7 @@ require = function () {
|
|
|
6328
6328
|
}
|
|
6329
6329
|
},
|
|
6330
6330
|
state: global_1.undefined
|
|
6331
|
-
}, (0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, ')', /^\\?\n/)]))
|
|
6331
|
+
}, (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)))]))));
|
|
6332
6332
|
},
|
|
6333
6333
|
{
|
|
6334
6334
|
'../../combinator': 27,
|
|
@@ -6606,16 +6606,8 @@ require = function () {
|
|
|
6606
6606
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
6607
6607
|
const array_1 = _dereq_('spica/array');
|
|
6608
6608
|
const index = /^(?:[0-9]+(?:\.[0-9]+)*|[A-Za-z])/;
|
|
6609
|
-
const indexFW = new RegExp(index.source.replace(/[019AZaz](?!,)/g, c => String.fromCharCode(c.charCodeAt(0) + 65248)));
|
|
6610
6609
|
exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.union)([
|
|
6611
|
-
(0, combinator_1.surround)((0, source_1.str)('('), (0, source_1.str)(index), (0, source_1.str)(')'),
|
|
6612
|
-
(0, typed_dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)),
|
|
6613
|
-
rest
|
|
6614
|
-
]),
|
|
6615
|
-
(0, combinator_1.surround)((0, source_1.str)('\uFF08'), (0, source_1.str)(indexFW), (0, source_1.str)('\uFF09'), false, ([as, bs = [], cs], rest) => [
|
|
6616
|
-
(0, typed_dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)),
|
|
6617
|
-
rest
|
|
6618
|
-
]),
|
|
6610
|
+
(0, combinator_1.surround)((0, source_1.str)('('), (0, source_1.str)(index), (0, source_1.str)(')')),
|
|
6619
6611
|
(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)(inline_1.inline, ')'), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [
|
|
6620
6612
|
[(0, typed_dom_1.html)('span', { class: 'paren' }, (0, typed_dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))],
|
|
6621
6613
|
rest
|
|
@@ -6623,6 +6615,7 @@ require = function () {
|
|
|
6623
6615
|
(0, array_1.unshift)(as, bs),
|
|
6624
6616
|
rest
|
|
6625
6617
|
]),
|
|
6618
|
+
(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')),
|
|
6626
6619
|
(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) => [
|
|
6627
6620
|
[(0, typed_dom_1.html)('span', { class: 'paren' }, (0, typed_dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))],
|
|
6628
6621
|
rest
|
|
@@ -6715,8 +6708,11 @@ require = function () {
|
|
|
6715
6708
|
const util_1 = _dereq_('../util');
|
|
6716
6709
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
6717
6710
|
const array_1 = _dereq_('spica/array');
|
|
6718
|
-
exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('~~'), (0, combinator_1.
|
|
6719
|
-
|
|
6711
|
+
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)([
|
|
6712
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, /~~/)),
|
|
6713
|
+
(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '~'), true)
|
|
6714
|
+
])), (0, source_1.str)('~~'), false, ([, bs], rest) => [
|
|
6715
|
+
[(0, typed_dom_1.html)('del', (0, typed_dom_1.defrag)(bs))],
|
|
6720
6716
|
rest
|
|
6721
6717
|
], ([as, bs], rest) => [
|
|
6722
6718
|
(0, array_1.unshift)(as, bs),
|
|
@@ -6746,7 +6742,7 @@ require = function () {
|
|
|
6746
6742
|
const array_1 = _dereq_('spica/array');
|
|
6747
6743
|
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)([
|
|
6748
6744
|
strong_1.strong,
|
|
6749
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
6745
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', /\*/)),
|
|
6750
6746
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)
|
|
6751
6747
|
])), '*'), (0, source_1.str)('*'), false, ([, bs], rest) => [
|
|
6752
6748
|
[(0, typed_dom_1.html)('em', (0, typed_dom_1.defrag)(bs))],
|
|
@@ -6779,16 +6775,16 @@ require = function () {
|
|
|
6779
6775
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
6780
6776
|
const array_1 = _dereq_('spica/array');
|
|
6781
6777
|
const substrong = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([
|
|
6782
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
6778
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', /\*\*/)),
|
|
6783
6779
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)
|
|
6784
6780
|
])));
|
|
6785
6781
|
const subemphasis = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([
|
|
6786
6782
|
strong_1.strong,
|
|
6787
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
6783
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', /\*/)),
|
|
6788
6784
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)
|
|
6789
6785
|
])));
|
|
6790
6786
|
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)([
|
|
6791
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
6787
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', /\*/)),
|
|
6792
6788
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)
|
|
6793
6789
|
]))), (0, source_1.str)(/^\*{1,3}/), false, ([, bs, cs], rest, context) => {
|
|
6794
6790
|
var _a, _b;
|
|
@@ -7177,11 +7173,11 @@ require = function () {
|
|
|
7177
7173
|
(0, alias_1.ObjectSetPrototypeOf)(attrspec, null);
|
|
7178
7174
|
(0, alias_1.ObjectValues)(attrspec).forEach(o => (0, alias_1.ObjectSetPrototypeOf)(o, null));
|
|
7179
7175
|
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)([
|
|
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])),
|
|
7176
|
+
(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) => [
|
|
7181
7177
|
[(0, typed_dom_1.html)(tag, attributes('html', [], attrspec[tag], bs))],
|
|
7182
7178
|
rest
|
|
7183
7179
|
]), ([, tag]) => tag)),
|
|
7184
|
-
(0, combinator_1.match)(/^(?=<(sup|sub|small
|
|
7180
|
+
(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)((() => {
|
|
7185
7181
|
switch (tag) {
|
|
7186
7182
|
case 'sup':
|
|
7187
7183
|
case 'sub':
|
|
@@ -7203,12 +7199,28 @@ require = function () {
|
|
|
7203
7199
|
default:
|
|
7204
7200
|
return {};
|
|
7205
7201
|
}
|
|
7206
|
-
})(), (0, combinator_1.some)((0, combinator_1.union)([
|
|
7207
|
-
|
|
7202
|
+
})(), (0, combinator_1.some)((0, combinator_1.union)([
|
|
7203
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, `</${ tag }>`)),
|
|
7204
|
+
(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '</'), true)
|
|
7205
|
+
]), `</${ tag }>`)), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest, context) => [
|
|
7206
|
+
[elem(tag, as, (0, typed_dom_1.defrag)(bs), cs, context)],
|
|
7208
7207
|
rest
|
|
7209
7208
|
])), ([, tag]) => tag)),
|
|
7210
|
-
(0, combinator_1.match)(/^(?=<(
|
|
7211
|
-
|
|
7209
|
+
(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)([
|
|
7210
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, `</${ tag }>`)),
|
|
7211
|
+
(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '</'), true)
|
|
7212
|
+
]), `</${ tag }>`), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest) => [
|
|
7213
|
+
[elem(tag, as, (0, typed_dom_1.defrag)(bs), cs, {})],
|
|
7214
|
+
rest
|
|
7215
|
+
], ([as, bs], rest) => as.length === 1 ? [
|
|
7216
|
+
(0, array_1.unshift)(as, bs),
|
|
7217
|
+
rest
|
|
7218
|
+
] : global_1.undefined)), ([, tag]) => tag)),
|
|
7219
|
+
(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)([
|
|
7220
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, `</${ tag }>`)),
|
|
7221
|
+
(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '</'), true)
|
|
7222
|
+
]), `</${ tag }>`), `</${ tag }>`), (0, source_1.str)(`</${ tag }>`), false, ([as, bs, cs], rest) => [
|
|
7223
|
+
[elem(tag, as, (0, typed_dom_1.defrag)(bs), cs, {})],
|
|
7212
7224
|
rest
|
|
7213
7225
|
], ([as, bs], rest) => as.length === 1 ? [
|
|
7214
7226
|
(0, array_1.unshift)(as, bs),
|
|
@@ -7238,7 +7250,7 @@ require = function () {
|
|
|
7238
7250
|
}
|
|
7239
7251
|
let attrs;
|
|
7240
7252
|
switch (true) {
|
|
7241
|
-
case
|
|
7253
|
+
case 'data-invalid-syntax' in (attrs = attributes('html', [], attrspec[tag], as.slice(1, -1))):
|
|
7242
7254
|
return invalid('attribute', 'Invalid HTML attribute.', as, bs, cs);
|
|
7243
7255
|
default:
|
|
7244
7256
|
return (0, typed_dom_1.html)(tag, attrs, bs);
|
|
@@ -7326,8 +7338,11 @@ require = function () {
|
|
|
7326
7338
|
const util_1 = _dereq_('../util');
|
|
7327
7339
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
7328
7340
|
const array_1 = _dereq_('spica/array');
|
|
7329
|
-
exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('++'), (0, combinator_1.
|
|
7330
|
-
|
|
7341
|
+
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)([
|
|
7342
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)(/\n?/, /\+\+/)),
|
|
7343
|
+
(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, '+'), true)
|
|
7344
|
+
])), (0, source_1.str)('++'), false, ([, bs], rest) => [
|
|
7345
|
+
[(0, typed_dom_1.html)('ins', (0, typed_dom_1.defrag)(bs))],
|
|
7331
7346
|
rest
|
|
7332
7347
|
], ([as, bs], rest) => [
|
|
7333
7348
|
(0, array_1.unshift)(as, bs),
|
|
@@ -7382,18 +7397,18 @@ require = function () {
|
|
|
7382
7397
|
autolink: false
|
|
7383
7398
|
}
|
|
7384
7399
|
}
|
|
7385
|
-
}, (0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/))
|
|
7400
|
+
}, (0, util_1.trimSpaceStart)((0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/)))), ']', true)
|
|
7386
7401
|
]))),
|
|
7387
7402
|
(0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([
|
|
7388
7403
|
exports.uri,
|
|
7389
7404
|
(0, combinator_1.some)(exports.option)
|
|
7390
|
-
]), /^[^\S\n]
|
|
7405
|
+
]), /^[^\S\n]*}/))
|
|
7391
7406
|
]))), ([params, content = []], rest, context) => {
|
|
7392
7407
|
var _a, _b, _c, _d, _e, _f;
|
|
7393
7408
|
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'))
|
|
7394
7409
|
return;
|
|
7395
7410
|
const INSECURE_URI = params.shift();
|
|
7396
|
-
const el = elem(INSECURE_URI, (0, util_1.
|
|
7411
|
+
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);
|
|
7397
7412
|
if (el.classList.contains('invalid'))
|
|
7398
7413
|
return [
|
|
7399
7414
|
[el],
|
|
@@ -7405,14 +7420,13 @@ require = function () {
|
|
|
7405
7420
|
];
|
|
7406
7421
|
}))));
|
|
7407
7422
|
exports.uri = (0, combinator_1.union)([
|
|
7408
|
-
(0, combinator_1.open)(/^[^\S\n]
|
|
7423
|
+
(0, combinator_1.open)(/^[^\S\n]+/, (0, source_1.str)(/^\S+/)),
|
|
7409
7424
|
(0, source_1.str)(/^[^\s{}]+/)
|
|
7410
7425
|
]);
|
|
7411
7426
|
exports.option = (0, combinator_1.union)([
|
|
7412
7427
|
(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+nofollow(?=[^\S\n]|})/), () => [` rel="nofollow"`]),
|
|
7413
7428
|
(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|})/),
|
|
7414
|
-
(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+
|
|
7415
|
-
(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[^\n{}]+/), opt => [` \\${ opt.slice(1) }`])
|
|
7429
|
+
(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[^\s{}]+/), opt => [` \\${ opt.slice(1) }`])
|
|
7416
7430
|
]);
|
|
7417
7431
|
function resolve(uri, host, source) {
|
|
7418
7432
|
switch (true) {
|
|
@@ -7499,7 +7513,7 @@ require = function () {
|
|
|
7499
7513
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
7500
7514
|
const array_1 = _dereq_('spica/array');
|
|
7501
7515
|
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)([
|
|
7502
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
7516
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', /==/)),
|
|
7503
7517
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '='), inline_1.inline)
|
|
7504
7518
|
]))), (0, source_1.str)('=='), false, ([, bs], rest) => [
|
|
7505
7519
|
[(0, typed_dom_1.html)('mark', (0, typed_dom_1.defrag)(bs))],
|
|
@@ -7597,7 +7611,7 @@ require = function () {
|
|
|
7597
7611
|
(0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([
|
|
7598
7612
|
link_1.uri,
|
|
7599
7613
|
(0, combinator_1.some)(option)
|
|
7600
|
-
]), /^[^\S\n]
|
|
7614
|
+
]), /^[^\S\n]*}/))
|
|
7601
7615
|
]))), ([as, bs]) => bs ? [
|
|
7602
7616
|
[(0, array_1.join)(as).trim() || (0, array_1.join)(as)],
|
|
7603
7617
|
bs
|
|
@@ -7741,16 +7755,16 @@ require = function () {
|
|
|
7741
7755
|
state: global_1.undefined
|
|
7742
7756
|
}, (0, combinator_1.subsequence)([
|
|
7743
7757
|
abbr,
|
|
7744
|
-
(0, combinator_1.focus)(
|
|
7758
|
+
(0, combinator_1.focus)(/^\^[^\S\n]*/, source => [
|
|
7745
7759
|
[
|
|
7746
7760
|
'',
|
|
7747
|
-
|
|
7761
|
+
source
|
|
7748
7762
|
],
|
|
7749
7763
|
''
|
|
7750
7764
|
]),
|
|
7751
|
-
(0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/)
|
|
7752
|
-
]))
|
|
7753
|
-
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]
|
|
7765
|
+
(0, util_1.trimSpaceStart)((0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/))
|
|
7766
|
+
])))), ']]'), ns => [(0, typed_dom_1.html)('sup', attributes(ns), (0, util_1.trimNodeEnd)((0, typed_dom_1.defrag)(ns)))]))));
|
|
7767
|
+
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)]));
|
|
7754
7768
|
function attributes(ns) {
|
|
7755
7769
|
return typeof ns[0] === 'object' && ns[0].tagName === 'ABBR' ? {
|
|
7756
7770
|
class: 'reference',
|
|
@@ -7915,7 +7929,7 @@ require = function () {
|
|
|
7915
7929
|
const typed_dom_1 = _dereq_('typed-dom');
|
|
7916
7930
|
const array_1 = _dereq_('spica/array');
|
|
7917
7931
|
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)([
|
|
7918
|
-
(0, combinator_1.some)(inline_1.inline, (0, util_1.
|
|
7932
|
+
(0, combinator_1.some)(inline_1.inline, (0, util_1.blank)('', /\*\*/)),
|
|
7919
7933
|
(0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)
|
|
7920
7934
|
])), '*'), (0, source_1.str)('**'), false, ([, bs], rest) => [
|
|
7921
7935
|
[(0, typed_dom_1.html)('strong', (0, typed_dom_1.defrag)(bs))],
|
|
@@ -8705,18 +8719,19 @@ require = function () {
|
|
|
8705
8719
|
function (_dereq_, module, exports) {
|
|
8706
8720
|
'use strict';
|
|
8707
8721
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8708
|
-
exports.stringify = exports.
|
|
8722
|
+
exports.stringify = exports.trimNodeEnd = exports.trimSpaceStart = exports.isStartTightNodes = exports.startTight = exports.isStartLoose = exports.startLoose = exports.visualize = exports.blank = void 0;
|
|
8709
8723
|
const global_1 = _dereq_('spica/global');
|
|
8710
8724
|
const parser_1 = _dereq_('../combinator/data/parser');
|
|
8711
8725
|
const combinator_1 = _dereq_('../combinator');
|
|
8712
8726
|
const htmlentity_1 = _dereq_('./inline/htmlentity');
|
|
8713
8727
|
const source_1 = _dereq_('./source');
|
|
8714
8728
|
const normalize_1 = _dereq_('./api/normalize');
|
|
8729
|
+
const memoize_1 = _dereq_('spica/memoize');
|
|
8715
8730
|
const array_1 = _dereq_('spica/array');
|
|
8716
|
-
function
|
|
8717
|
-
return new RegExp(String.raw
|
|
8731
|
+
function blank(prefix, suffix) {
|
|
8732
|
+
return new RegExp(String.raw`^${ prefix && prefix.source }(?:\\\s|[^\S\n]+|\n|&(?:${ normalize_1.invisibleHTMLEntityNames.join('|') });|<wbr>)?${ typeof suffix === 'string' ? suffix : suffix.source }`);
|
|
8718
8733
|
}
|
|
8719
|
-
exports.
|
|
8734
|
+
exports.blank = blank;
|
|
8720
8735
|
function visualize(parser) {
|
|
8721
8736
|
const blankline = new RegExp(String.raw`^(?:\\$|\\?[^\S\n]|&(?:${ normalize_1.invisibleHTMLEntityNames.join('|') });|<wbr>)+$`, 'gm');
|
|
8722
8737
|
return (0, combinator_1.union)([
|
|
@@ -8750,18 +8765,17 @@ require = function () {
|
|
|
8750
8765
|
return false;
|
|
8751
8766
|
}
|
|
8752
8767
|
function startLoose(parser, except) {
|
|
8753
|
-
return (source, context) => isStartLoose(source, context, except) ? parser(source, context) : global_1.undefined;
|
|
8768
|
+
return (source, context) => (0, exports.isStartLoose)(source, context, except) ? parser(source, context) : global_1.undefined;
|
|
8754
8769
|
}
|
|
8755
8770
|
exports.startLoose = startLoose;
|
|
8756
|
-
|
|
8771
|
+
exports.isStartLoose = (0, memoize_1.reduce)((source, context, except) => {
|
|
8757
8772
|
return isStartTight(source.replace(/^[^\S\n]+/, ''), context, except);
|
|
8758
|
-
}
|
|
8759
|
-
exports.isStartLoose = isStartLoose;
|
|
8773
|
+
}, (source, _, except = '') => `${ source }\0${ except }`);
|
|
8760
8774
|
function startTight(parser, except) {
|
|
8761
8775
|
return (source, context) => isStartTight(source, context, except) ? parser(source, context) : global_1.undefined;
|
|
8762
8776
|
}
|
|
8763
8777
|
exports.startTight = startTight;
|
|
8764
|
-
|
|
8778
|
+
const isStartTight = (0, memoize_1.reduce)((source, context, except) => {
|
|
8765
8779
|
var _a, _b, _c;
|
|
8766
8780
|
if (source === '')
|
|
8767
8781
|
return true;
|
|
@@ -8790,7 +8804,7 @@ require = function () {
|
|
|
8790
8804
|
default:
|
|
8791
8805
|
return source[0].trimStart() !== '';
|
|
8792
8806
|
}
|
|
8793
|
-
}
|
|
8807
|
+
}, (source, _, except = '') => `${ source }\0${ except }`);
|
|
8794
8808
|
function isStartTightNodes(nodes) {
|
|
8795
8809
|
if (nodes.length === 0)
|
|
8796
8810
|
return true;
|
|
@@ -8822,25 +8836,10 @@ require = function () {
|
|
|
8822
8836
|
}
|
|
8823
8837
|
}
|
|
8824
8838
|
}
|
|
8825
|
-
function
|
|
8826
|
-
return
|
|
8827
|
-
}
|
|
8828
|
-
exports.trimNode = trimNode;
|
|
8829
|
-
function trimNodeStart(nodes) {
|
|
8830
|
-
for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes[0], 0);) {
|
|
8831
|
-
if (nodes.length === 1 && typeof node === 'object' && node.className === 'indexer')
|
|
8832
|
-
break;
|
|
8833
|
-
if (typeof node === 'string') {
|
|
8834
|
-
const pos = node.length - node.trimStart().length;
|
|
8835
|
-
if (pos > 0) {
|
|
8836
|
-
nodes[0] = node.slice(pos);
|
|
8837
|
-
break;
|
|
8838
|
-
}
|
|
8839
|
-
}
|
|
8840
|
-
nodes.shift();
|
|
8841
|
-
}
|
|
8842
|
-
return nodes;
|
|
8839
|
+
function trimSpaceStart(parser) {
|
|
8840
|
+
return (0, combinator_1.convert)((0, memoize_1.reduce)(source => source.replace(/^[^\S\n]+/, '')), parser);
|
|
8843
8841
|
}
|
|
8842
|
+
exports.trimSpaceStart = trimSpaceStart;
|
|
8844
8843
|
function trimNodeEnd(nodes) {
|
|
8845
8844
|
const skip = nodes.length > 0 && typeof nodes[nodes.length - 1] === 'object' && nodes[nodes.length - 1]['className'] === 'indexer' ? [nodes.pop()] : [];
|
|
8846
8845
|
for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes[nodes.length - 1], -1);) {
|
|
@@ -8856,13 +8855,6 @@ require = function () {
|
|
|
8856
8855
|
return (0, array_1.push)(nodes, skip);
|
|
8857
8856
|
}
|
|
8858
8857
|
exports.trimNodeEnd = trimNodeEnd;
|
|
8859
|
-
function trimNodeEndBR(nodes) {
|
|
8860
|
-
if (nodes.length === 0)
|
|
8861
|
-
return nodes;
|
|
8862
|
-
const node = nodes[nodes.length - 1];
|
|
8863
|
-
return typeof node === 'object' && node.tagName === 'BR' ? (0, array_1.pop)(nodes)[0] : nodes;
|
|
8864
|
-
}
|
|
8865
|
-
exports.trimNodeEndBR = trimNodeEndBR;
|
|
8866
8858
|
function stringify(nodes) {
|
|
8867
8859
|
let acc = '';
|
|
8868
8860
|
for (let i = 0; i < nodes.length; ++i) {
|
|
@@ -8884,7 +8876,8 @@ require = function () {
|
|
|
8884
8876
|
'./inline/htmlentity': 112,
|
|
8885
8877
|
'./source': 128,
|
|
8886
8878
|
'spica/array': 6,
|
|
8887
|
-
'spica/global': 15
|
|
8879
|
+
'spica/global': 15,
|
|
8880
|
+
'spica/memoize': 18
|
|
8888
8881
|
}
|
|
8889
8882
|
],
|
|
8890
8883
|
135: [
|
package/markdown.d.ts
CHANGED
|
@@ -852,7 +852,6 @@ export namespace MarkdownParser {
|
|
|
852
852
|
SourceParser.StrParser,
|
|
853
853
|
SourceParser.StrParser,
|
|
854
854
|
SourceParser.StrParser,
|
|
855
|
-
SourceParser.StrParser,
|
|
856
855
|
]> {
|
|
857
856
|
}
|
|
858
857
|
}
|
|
@@ -927,6 +926,7 @@ export namespace MarkdownParser {
|
|
|
927
926
|
HTMLParser.OpenTagParser,
|
|
928
927
|
HTMLParser.TagParser,
|
|
929
928
|
HTMLParser.TagParser,
|
|
929
|
+
HTMLParser.TagParser,
|
|
930
930
|
]> {
|
|
931
931
|
}
|
|
932
932
|
export namespace HTMLParser {
|
|
@@ -940,6 +940,7 @@ export namespace MarkdownParser {
|
|
|
940
940
|
Inline<'html/tag'>,
|
|
941
941
|
Parser<HTMLElement | string, Context, [
|
|
942
942
|
InlineParser,
|
|
943
|
+
InlineParser,
|
|
943
944
|
]> {
|
|
944
945
|
}
|
|
945
946
|
export namespace TagParser {
|
|
@@ -956,6 +957,7 @@ export namespace MarkdownParser {
|
|
|
956
957
|
Inline<'insertion'>,
|
|
957
958
|
Parser<HTMLElement | string, Context, [
|
|
958
959
|
InlineParser,
|
|
960
|
+
InlineParser,
|
|
959
961
|
]> {
|
|
960
962
|
}
|
|
961
963
|
export interface DeletionParser extends
|
|
@@ -963,6 +965,7 @@ export namespace MarkdownParser {
|
|
|
963
965
|
Inline<'deletion'>,
|
|
964
966
|
Parser<HTMLElement | string, Context, [
|
|
965
967
|
InlineParser,
|
|
968
|
+
InlineParser,
|
|
966
969
|
]> {
|
|
967
970
|
}
|
|
968
971
|
export interface MarkParser extends
|
|
@@ -1137,9 +1140,9 @@ export namespace MarkdownParser {
|
|
|
1137
1140
|
// ""
|
|
1138
1141
|
Inline<'bracket'>,
|
|
1139
1142
|
Parser<HTMLElement | string, Context, [
|
|
1140
|
-
SourceParser.StrParser,
|
|
1141
1143
|
SourceParser.StrParser,
|
|
1142
1144
|
InlineParser,
|
|
1145
|
+
SourceParser.StrParser,
|
|
1143
1146
|
InlineParser,
|
|
1144
1147
|
InlineParser,
|
|
1145
1148
|
InlineParser,
|
package/package-lock.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "securemark",
|
|
3
|
-
"version": "0.235.
|
|
3
|
+
"version": "0.235.2",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -1927,9 +1927,9 @@
|
|
|
1927
1927
|
"dev": true
|
|
1928
1928
|
},
|
|
1929
1929
|
"caniuse-lite": {
|
|
1930
|
-
"version": "1.0.
|
|
1931
|
-
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.
|
|
1932
|
-
"integrity": "sha512-
|
|
1930
|
+
"version": "1.0.30001323",
|
|
1931
|
+
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001323.tgz",
|
|
1932
|
+
"integrity": "sha512-e4BF2RlCVELKx8+RmklSEIVub1TWrmdhvA5kEUueummz1XyySW0DVk+3x9HyhU9MuWTa2BhqLgEuEmUwASAdCA==",
|
|
1933
1933
|
"dev": true
|
|
1934
1934
|
},
|
|
1935
1935
|
"chalk": {
|
package/package.json
CHANGED
|
@@ -118,7 +118,7 @@ describe('Unit: parser/api/parse', () => {
|
|
|
118
118
|
'<p><a href="https://source/hashtags/a" target="_blank" class="hashtag">#a</a></p>',
|
|
119
119
|
'<p><a href="https://domain/hashtags/a" target="_blank" class="hashtag">#domain/a</a></p>',
|
|
120
120
|
'<p><a class="index" href="#index:a">a</a></p>',
|
|
121
|
-
'<figure data-label="$-a" data-group="$" data-number="1" id="label:$-a"><div
|
|
121
|
+
'<figure data-label="$-a" data-group="$" data-number="1" id="label:$-a"><div><div class="math" translate="no">$$\n$$</div></div><figcaption><span class="figindex">(1)</span></figcaption></figure>',
|
|
122
122
|
'<p><a class="label" data-label="$-a" href="#label:$-a">(1)</a></p>',
|
|
123
123
|
'<p><sup class="annotation" id="annotation:ref:1" title="a"><span hidden="">a</span><a href="#annotation:def:1">*1</a></sup></p>',
|
|
124
124
|
'<p><a href="https://source/x/a" target="_blank">a</a></p>',
|
|
@@ -201,7 +201,7 @@ describe('Unit: parser/api/parse', () => {
|
|
|
201
201
|
assert.deepStrictEqual(
|
|
202
202
|
[...parse('$-a\n$$\n$$\n\n(($-a[[b]][[c*d*]]))', { footnotes }).children].map(el => el.outerHTML),
|
|
203
203
|
[
|
|
204
|
-
'<figure data-label="$-a" data-group="$" data-number="1" id="label:$-a"><div
|
|
204
|
+
'<figure data-label="$-a" data-group="$" data-number="1" id="label:$-a"><div><div class="math" translate="no">$$\n$$</div></div><figcaption><span class="figindex">(1)</span></figcaption></figure>',
|
|
205
205
|
'<p><sup class="annotation" id="annotation:ref:1" title="(1)[1][2]"><span hidden=""><a class="label" data-label="$-a" href="#label:$-a">(1)</a><sup class="reference" id="reference:ref:1" title="b"><span hidden="">b</span><a href="#reference:def:1">[1]</a></sup><sup class="reference" id="reference:ref:2" title="cd"><span hidden="">c<em>d</em></span><a href="#reference:def:2">[2]</a></sup></span><a href="#annotation:def:1">*1</a></sup></p>',
|
|
206
206
|
]);
|
|
207
207
|
assert.deepStrictEqual(
|
|
@@ -95,7 +95,7 @@ describe('Unit: parser/block/blockquote', () => {
|
|
|
95
95
|
assert.deepStrictEqual(inspect(parser('!>\n> a')), [['<blockquote><section><p>a</p><ol class="annotations"></ol><ol class="references"></ol></section></blockquote>'], '']);
|
|
96
96
|
assert.deepStrictEqual(inspect(parser('!>> ## a\n> ## a')), [['<blockquote><blockquote><section><h2>a</h2><ol class="annotations"></ol><ol class="references"></ol></section></blockquote><section><h2>a</h2><ol class="annotations"></ol><ol class="references"></ol></section></blockquote>'], '']);
|
|
97
97
|
assert.deepStrictEqual(inspect(parser('!>> ~ a\n> ~ a')), [['<blockquote><blockquote><section><dl><dt>a</dt><dd></dd></dl><ol class="annotations"></ol><ol class="references"></ol></section></blockquote><section><dl><dt>a</dt><dd></dd></dl><ol class="annotations"></ol><ol class="references"></ol></section></blockquote>'], '']);
|
|
98
|
-
assert.deepStrictEqual(inspect(parser('!>> ~~~figure $fig-a\n>> > \n>>\n~~~\n> ~~~figure $fig-a\n> > \n>\n[#a]\n~~~')), [['<blockquote><blockquote><section><figure data-label="fig-a" data-group="fig" data-number="1"><div
|
|
98
|
+
assert.deepStrictEqual(inspect(parser('!>> ~~~figure $fig-a\n>> > \n>>\n~~~\n> ~~~figure $fig-a\n> > \n>\n[#a]\n~~~')), [['<blockquote><blockquote><section><figure data-label="fig-a" data-group="fig" data-number="1"><div><blockquote></blockquote></div><figcaption><span class="figindex">Fig. 1. </span></figcaption></figure><ol class="annotations"></ol><ol class="references"></ol></section></blockquote><section><figure data-label="fig-a" data-group="fig" data-number="1"><div><blockquote></blockquote></div><figcaption><span class="figindex">Fig. 1. </span><a class="index">a</a></figcaption></figure><ol class="annotations"></ol><ol class="references"></ol></section></blockquote>'], '']);
|
|
99
99
|
assert.deepStrictEqual(inspect(parser('!>> ((a))\n> ((a))')), [['<blockquote><blockquote><section><p><sup class="annotation disabled" title="a"><span hidden="">a</span><a>*1</a></sup></p><ol class="annotations"><li>a<sup><a>^1</a></sup></li></ol><ol class="references"></ol></section></blockquote><section><p><sup class="annotation disabled" title="a"><span hidden="">a</span><a>*1</a></sup></p><ol class="annotations"><li>a<sup><a>^1</a></sup></li></ol><ol class="references"></ol></section></blockquote>'], '']);
|
|
100
100
|
});
|
|
101
101
|
|
|
@@ -16,7 +16,7 @@ describe('Unit: parser/block/extension/aside', () => {
|
|
|
16
16
|
it('valid', () => {
|
|
17
17
|
assert.deepStrictEqual(inspect(parser('~~~aside\n# 0\n~~~')), [['<aside id="index:0" class="aside"><h1>0</h1><ol class="annotations"></ol><ol class="references"></ol></aside>'], '']);
|
|
18
18
|
assert.deepStrictEqual(inspect(parser('~~~aside\n## 0\n~~~')), [['<aside id="index:0" class="aside"><h2>0</h2><ol class="annotations"></ol><ol class="references"></ol></aside>'], '']);
|
|
19
|
-
assert.deepStrictEqual(inspect(parser('~~~aside\n# 0\n\n$-0.0\n\n## 1\n\n$fig-a\n> \n~~~')), [['<aside id="index:0" class="aside"><h1>0</h1><figure data-label="$-0.0" data-group="$" hidden="" data-number="0.0"></figure><h2>1</h2><figure data-label="fig-a" data-group="fig" data-number="1.1"><div
|
|
19
|
+
assert.deepStrictEqual(inspect(parser('~~~aside\n# 0\n\n$-0.0\n\n## 1\n\n$fig-a\n> \n~~~')), [['<aside id="index:0" class="aside"><h1>0</h1><figure data-label="$-0.0" data-group="$" hidden="" data-number="0.0"></figure><h2>1</h2><figure data-label="fig-a" data-group="fig" data-number="1.1"><div><blockquote></blockquote></div><figcaption><span class="figindex">Fig. 1.1. </span></figcaption></figure><ol class="annotations"></ol><ol class="references"></ol></aside>'], '']);
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
});
|
|
@@ -19,8 +19,8 @@ describe('Unit: parser/block/extension/example', () => {
|
|
|
19
19
|
assert.deepStrictEqual(inspect(parser('~~~example/markdown\n\n~~~')), [['<aside class="example" data-type="markdown"><pre translate="no"></pre><hr><section><ol class="annotations"></ol><ol class="references"></ol></section></aside>'], '']);
|
|
20
20
|
assert.deepStrictEqual(inspect(parser('~~~example/markdown\na\n~~~')), [['<aside class="example" data-type="markdown"><pre translate="no">a</pre><hr><section><p>a</p><ol class="annotations"></ol><ol class="references"></ol></section></aside>'], '']);
|
|
21
21
|
assert.deepStrictEqual(inspect(parser('~~~example/markdown\n*a\nb*\n~~~')), [['<aside class="example" data-type="markdown"><pre translate="no">*a\nb*</pre><hr><section><p><em>a<br>b</em></p><ol class="annotations"></ol><ol class="references"></ol></section></aside>'], '']);
|
|
22
|
-
assert.deepStrictEqual(inspect(parser('~~~example/markdown\n$fig-a\n!https://host\n~~~')), [['<aside class="example" data-type="markdown"><pre translate="no">$fig-a\n!https://host</pre><hr><section><figure data-label="fig-a" data-group="fig" data-number="1"><div
|
|
23
|
-
assert.deepStrictEqual(inspect(parser('~~~example/markdown\n[$fig-a]\n!https://host\n~~~')), [['<aside class="example" data-type="markdown"><pre translate="no">[$fig-a]\n!https://host</pre><hr><section><figure data-label="fig-a" data-group="fig" data-number="1"><div
|
|
22
|
+
assert.deepStrictEqual(inspect(parser('~~~example/markdown\n$fig-a\n!https://host\n~~~')), [['<aside class="example" data-type="markdown"><pre translate="no">$fig-a\n!https://host</pre><hr><section><figure data-label="fig-a" data-group="fig" data-number="1"><div><a href="https://host" target="_blank"><img class="media" data-src="https://host" alt=""></a></div><figcaption><span class="figindex">Fig. 1. </span></figcaption></figure><ol class="annotations"></ol><ol class="references"></ol></section></aside>'], '']);
|
|
23
|
+
assert.deepStrictEqual(inspect(parser('~~~example/markdown\n[$fig-a]\n!https://host\n~~~')), [['<aside class="example" data-type="markdown"><pre translate="no">[$fig-a]\n!https://host</pre><hr><section><figure data-label="fig-a" data-group="fig" data-number="1"><div><a href="https://host" target="_blank"><img class="media" data-src="https://host" alt=""></a></div><figcaption><span class="figindex">Fig. 1. </span></figcaption></figure><ol class="annotations"></ol><ol class="references"></ol></section></aside>'], '']);
|
|
24
24
|
assert.deepStrictEqual(inspect(parser('~~~example/markdown\n## a\n~~~')), [['<aside class="example" data-type="markdown"><pre translate="no">## a</pre><hr><section><h2>a</h2><ol class="annotations"></ol><ol class="references"></ol></section></aside>'], '']);
|
|
25
25
|
assert.deepStrictEqual(inspect(parser('~~~example/markdown\n~ a\n~~~')), [['<aside class="example" data-type="markdown"><pre translate="no">~ a</pre><hr><section><dl><dt>a</dt><dd></dd></dl><ol class="annotations"></ol><ol class="references"></ol></section></aside>'], '']);
|
|
26
26
|
assert.deepStrictEqual(inspect(parser('~~~example/markdown\n((a))[[b]]\n~~~')), [['<aside class="example" data-type="markdown"><pre translate="no">((a))[[b]]</pre><hr><section><p><sup class="annotation disabled" title="a"><span hidden="">a</span><a>*1</a></sup><sup class="reference disabled" title="b"><span hidden="">b</span><a>[1]</a></sup></p><ol class="annotations"><li>a<sup><a>^1</a></sup></li></ol><ol class="references"><li>b<sup><a>^1</a></sup></li></ol></section></aside>'], '']);
|