securemark 0.251.0 → 0.253.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/design.md +17 -11
- package/dist/index.js +137 -157
- package/index.d.ts +7 -8
- package/markdown.d.ts +12 -22
- package/package.json +8 -8
- package/src/combinator/control/manipulation/indent.ts +8 -8
- package/src/combinator/data/parser.ts +1 -1
- package/src/parser/api/bind.test.ts +8 -8
- package/src/parser/api/bind.ts +1 -1
- package/src/parser/api/parse.test.ts +4 -3
- package/src/parser/api/parse.ts +0 -1
- package/src/parser/block/blockquote.test.ts +31 -31
- package/src/parser/block/blockquote.ts +1 -3
- package/src/parser/block/extension/aside.test.ts +3 -3
- package/src/parser/block/extension/aside.ts +0 -3
- package/src/parser/block/extension/example.test.ts +11 -11
- package/src/parser/block/extension/example.ts +1 -3
- package/src/parser/block/extension/fig.test.ts +5 -5
- package/src/parser/block/extension/figure.test.ts +2 -2
- package/src/parser/block/extension/figure.ts +0 -2
- package/src/parser/block/extension/message.test.ts +7 -7
- package/src/parser/block/extension/message.ts +2 -4
- package/src/parser/block/ilist.ts +4 -5
- package/src/parser/block/olist.ts +24 -20
- package/src/parser/block/paragraph.test.ts +3 -3
- package/src/parser/block/ulist.ts +3 -13
- package/src/parser/block.ts +0 -3
- package/src/parser/inline/annotation.test.ts +18 -18
- package/src/parser/inline/annotation.ts +1 -1
- package/src/parser/inline/autolink/hashnum.ts +1 -1
- package/src/parser/inline/autolink/hashtag.ts +5 -5
- package/src/parser/inline/autolink.ts +2 -2
- package/src/parser/inline/extension/index.ts +4 -5
- package/src/parser/inline/reference.test.ts +58 -58
- package/src/parser/inline/reference.ts +4 -4
- package/src/parser/inline.test.ts +20 -20
- package/src/parser/locale.test.ts +1 -1
- package/src/parser/processor/figure.test.ts +3 -3
- package/src/parser/processor/figure.ts +3 -6
- package/src/parser/processor/footnote.test.ts +60 -2
- package/src/parser/processor/footnote.ts +56 -26
- package/src/parser/source/str.ts +2 -2
- package/src/parser/util.ts +14 -10
- package/src/renderer/render/code.ts +2 -2
- package/src/renderer/render/math.ts +2 -2
- package/src/renderer/render/media/image.ts +2 -2
- package/src/renderer/render/media.ts +2 -2
- package/src/util/info.ts +4 -4
- package/src/util/toc.ts +12 -16
- package/src/parser/block/indentblock.test.ts +0 -37
- package/src/parser/block/indentblock.ts +0 -13
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.
|
|
1
|
+
/*! securemark v0.253.1 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory(require("DOMPurify"), require("Prism"));
|
|
@@ -758,7 +758,26 @@ function run() {
|
|
|
758
758
|
|
|
759
759
|
/***/ }),
|
|
760
760
|
|
|
761
|
-
/***/
|
|
761
|
+
/***/ 5529:
|
|
762
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
763
|
+
|
|
764
|
+
"use strict";
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
768
|
+
value: true
|
|
769
|
+
}));
|
|
770
|
+
exports.equal = void 0;
|
|
771
|
+
|
|
772
|
+
function equal(a, b) {
|
|
773
|
+
return a === a ? a === b : b !== b;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
exports.equal = equal;
|
|
777
|
+
|
|
778
|
+
/***/ }),
|
|
779
|
+
|
|
780
|
+
/***/ 5084:
|
|
762
781
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
763
782
|
|
|
764
783
|
"use strict";
|
|
@@ -863,25 +882,6 @@ exports.MultiMap = MultiMap;
|
|
|
863
882
|
|
|
864
883
|
/***/ }),
|
|
865
884
|
|
|
866
|
-
/***/ 5529:
|
|
867
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
868
|
-
|
|
869
|
-
"use strict";
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
873
|
-
value: true
|
|
874
|
-
}));
|
|
875
|
-
exports.equal = void 0;
|
|
876
|
-
|
|
877
|
-
function equal(a, b) {
|
|
878
|
-
return a === a ? a === b : b !== b;
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
exports.equal = equal;
|
|
882
|
-
|
|
883
|
-
/***/ }),
|
|
884
|
-
|
|
885
885
|
/***/ 7822:
|
|
886
886
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
887
887
|
|
|
@@ -1417,7 +1417,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1417
1417
|
value: true
|
|
1418
1418
|
}));
|
|
1419
1419
|
|
|
1420
|
-
__exportStar(__webpack_require__(
|
|
1420
|
+
__exportStar(__webpack_require__(5084), exports);
|
|
1421
1421
|
|
|
1422
1422
|
/***/ }),
|
|
1423
1423
|
|
|
@@ -2339,16 +2339,16 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
2339
2339
|
|
|
2340
2340
|
function indent(opener, parser, separation = false) {
|
|
2341
2341
|
if (typeof opener === 'function') return indent(/^([ \t])\1*/, opener, parser);
|
|
2342
|
-
return (0, bind_1.bind)((0, block_1.block)((0, match_1.match)(opener, (0, memoize_1.memoize)(([indent]) => (0, some_1.some)((0, line_1.line)((0, surround_1.open)(indent, source => [[
|
|
2343
|
-
const result = parser(
|
|
2342
|
+
return (0, bind_1.bind)((0, block_1.block)((0, match_1.match)(opener, (0, memoize_1.memoize)(([indent]) => (0, some_1.some)((0, line_1.line)((0, surround_1.open)(indent, source => [[source], '']))), ([indent]) => indent.length * 2 + +(indent[0] === ' '), [])), separation), (lines, rest, context) => {
|
|
2343
|
+
const result = parser(trimBlockEnd(lines.join('')), context);
|
|
2344
2344
|
return result && (0, parser_1.exec)(result) === '' ? [(0, parser_1.eval)(result), rest] : global_1.undefined;
|
|
2345
2345
|
});
|
|
2346
2346
|
}
|
|
2347
2347
|
|
|
2348
2348
|
exports.indent = indent;
|
|
2349
2349
|
|
|
2350
|
-
function
|
|
2351
|
-
return
|
|
2350
|
+
function trimBlockEnd(block) {
|
|
2351
|
+
return block === '' || block[block.length - 1] !== '\n' ? block : block.slice(0, -1);
|
|
2352
2352
|
}
|
|
2353
2353
|
|
|
2354
2354
|
/***/ }),
|
|
@@ -3314,7 +3314,7 @@ function bind(target, settings) {
|
|
|
3314
3314
|
};
|
|
3315
3315
|
}
|
|
3316
3316
|
|
|
3317
|
-
for (const el of (0, footnote_1.footnote)(next(0)?.parentNode ?? target, settings.footnotes, context)) {
|
|
3317
|
+
for (const el of (0, footnote_1.footnote)(next(0)?.parentNode ?? target, settings.footnotes, context, bottom)) {
|
|
3318
3318
|
el ? yield {
|
|
3319
3319
|
type: 'footnote',
|
|
3320
3320
|
value: el
|
|
@@ -3632,8 +3632,6 @@ const dlist_1 = __webpack_require__(9373);
|
|
|
3632
3632
|
|
|
3633
3633
|
const table_1 = __webpack_require__(8717);
|
|
3634
3634
|
|
|
3635
|
-
const indentblock_1 = __webpack_require__(3565);
|
|
3636
|
-
|
|
3637
3635
|
const codeblock_1 = __webpack_require__(1849);
|
|
3638
3636
|
|
|
3639
3637
|
const mathblock_1 = __webpack_require__(3754);
|
|
@@ -3657,7 +3655,7 @@ exports.block = (0, combinator_1.creator)(error((0, combinator_1.reset)({
|
|
|
3657
3655
|
budget: 100 * 1000,
|
|
3658
3656
|
recursion: 200
|
|
3659
3657
|
}
|
|
3660
|
-
}, (0, combinator_1.union)([source_1.emptyline, horizontalrule_1.horizontalrule, heading_1.heading, ulist_1.ulist, olist_1.olist, ilist_1.ilist, dlist_1.dlist, table_1.table,
|
|
3658
|
+
}, (0, combinator_1.union)([source_1.emptyline, horizontalrule_1.horizontalrule, heading_1.heading, ulist_1.ulist, olist_1.olist, ilist_1.ilist, dlist_1.dlist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, extension_1.extension, sidefence_1.sidefence, blockquote_1.blockquote, reply_1.reply, paragraph_1.paragraph]))));
|
|
3661
3659
|
|
|
3662
3660
|
function error(parser) {
|
|
3663
3661
|
return (0, combinator_1.recover)((0, combinator_1.fallback)((0, combinator_1.open)('\x07', source => {
|
|
@@ -3705,20 +3703,16 @@ const unindent = source => source.replace(/(^|\n)>(?:[^\S\n]|(?=>*(?:$|\s)))|\n$
|
|
|
3705
3703
|
|
|
3706
3704
|
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, source)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)((0, combinator_1.some)(autolink_1.autolink), ns => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))])))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
|
|
3707
3705
|
const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, markdown)), (0, combinator_1.creator)(99, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (source, context) => {
|
|
3708
|
-
const annotations = (0, dom_1.html)('ol', {
|
|
3709
|
-
class: 'annotations'
|
|
3710
|
-
});
|
|
3711
3706
|
const references = (0, dom_1.html)('ol', {
|
|
3712
3707
|
class: 'references'
|
|
3713
3708
|
});
|
|
3714
3709
|
const document = (0, parse_1.parse)(source, {
|
|
3715
3710
|
id: '',
|
|
3716
3711
|
footnotes: {
|
|
3717
|
-
annotations,
|
|
3718
3712
|
references
|
|
3719
3713
|
}
|
|
3720
3714
|
}, context);
|
|
3721
|
-
return [[(0, dom_1.html)('section', [document,
|
|
3715
|
+
return [[(0, dom_1.html)('section', [document, references])], ''];
|
|
3722
3716
|
})))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
|
|
3723
3717
|
|
|
3724
3718
|
/***/ }),
|
|
@@ -3903,16 +3897,12 @@ exports.aside = (0, combinator_1.creator)(100, (0, combinator_1.block)((0, combi
|
|
|
3903
3897
|
'data-invalid-type': !closer || overflow ? 'fence' : 'argument',
|
|
3904
3898
|
'data-invalid-message': !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument'
|
|
3905
3899
|
}, `${opener}${body}${overflow || closer}`)];
|
|
3906
|
-
const annotations = (0, dom_1.html)('ol', {
|
|
3907
|
-
class: 'annotations'
|
|
3908
|
-
});
|
|
3909
3900
|
const references = (0, dom_1.html)('ol', {
|
|
3910
3901
|
class: 'references'
|
|
3911
3902
|
});
|
|
3912
3903
|
const document = (0, parse_1.parse)(body.slice(0, -1), {
|
|
3913
3904
|
id: '',
|
|
3914
3905
|
footnotes: {
|
|
3915
|
-
annotations,
|
|
3916
3906
|
references
|
|
3917
3907
|
}
|
|
3918
3908
|
}, context);
|
|
@@ -3929,7 +3919,7 @@ exports.aside = (0, combinator_1.creator)(100, (0, combinator_1.block)((0, combi
|
|
|
3929
3919
|
return [(0, dom_1.html)('aside', {
|
|
3930
3920
|
id: (0, indexee_1.identity)((0, indexee_1.text)(heading)),
|
|
3931
3921
|
class: 'aside'
|
|
3932
|
-
}, [document,
|
|
3922
|
+
}, [document, references])];
|
|
3933
3923
|
}))));
|
|
3934
3924
|
|
|
3935
3925
|
/***/ }),
|
|
@@ -3969,16 +3959,12 @@ exports.example = (0, combinator_1.creator)(100, (0, combinator_1.block)((0, com
|
|
|
3969
3959
|
switch (type) {
|
|
3970
3960
|
case 'markdown':
|
|
3971
3961
|
{
|
|
3972
|
-
const annotations = (0, dom_1.html)('ol', {
|
|
3973
|
-
class: 'annotations'
|
|
3974
|
-
});
|
|
3975
3962
|
const references = (0, dom_1.html)('ol', {
|
|
3976
3963
|
class: 'references'
|
|
3977
3964
|
});
|
|
3978
3965
|
const document = (0, parse_1.parse)(body.slice(0, -1), {
|
|
3979
3966
|
id: '',
|
|
3980
3967
|
footnotes: {
|
|
3981
|
-
annotations,
|
|
3982
3968
|
references
|
|
3983
3969
|
}
|
|
3984
3970
|
}, context);
|
|
@@ -3987,7 +3973,7 @@ exports.example = (0, combinator_1.creator)(100, (0, combinator_1.block)((0, com
|
|
|
3987
3973
|
'data-type': 'markdown'
|
|
3988
3974
|
}, [(0, dom_1.html)('pre', {
|
|
3989
3975
|
translate: 'no'
|
|
3990
|
-
}, body.slice(0, -1)), (0, dom_1.html)('hr'), (0, dom_1.html)('section', [document,
|
|
3976
|
+
}, body.slice(0, -1)), (0, dom_1.html)('hr'), (0, dom_1.html)('section', [document, references])])];
|
|
3991
3977
|
}
|
|
3992
3978
|
|
|
3993
3979
|
case 'math':
|
|
@@ -4102,8 +4088,6 @@ const olist_1 = __webpack_require__(7471);
|
|
|
4102
4088
|
|
|
4103
4089
|
const table_1 = __webpack_require__(8717);
|
|
4104
4090
|
|
|
4105
|
-
const indentblock_1 = __webpack_require__(3565);
|
|
4106
|
-
|
|
4107
4091
|
const codeblock_1 = __webpack_require__(1849);
|
|
4108
4092
|
|
|
4109
4093
|
const mathblock_1 = __webpack_require__(3754);
|
|
@@ -4130,7 +4114,7 @@ const array_1 = __webpack_require__(8112);
|
|
|
4130
4114
|
|
|
4131
4115
|
exports.segment = (0, combinator_1.block)((0, combinator_1.match)(/^(~{3,})(?:figure[^\S\n])?(?=\[?\$)/, (0, memoize_1.memoize)(([, fence], closer = new RegExp(String.raw`^${fence}[^\S\n]*(?:$|\n)`)) => (0, combinator_1.close)((0, combinator_1.sequence)([source_1.contentline, (0, combinator_1.inits)([// All parsers which can include closing terms.
|
|
4132
4116
|
(0, combinator_1.union)([codeblock_1.segment_, mathblock_1.segment_, table_2.segment_, blockquote_1.segment, placeholder_1.segment_, (0, combinator_1.some)(source_1.contentline, closer)]), source_1.emptyline, (0, combinator_1.union)([source_1.emptyline, (0, combinator_1.some)(source_1.contentline, closer)])])]), closer), ([, fence]) => fence.length, [])));
|
|
4133
|
-
exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:\w+\s+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.sequence)([label_1.label, (0, source_1.str)(/^(?=\s).*\n/)])), (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([ulist_1.ulist, olist_1.olist, table_1.table,
|
|
4117
|
+
exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:\w+\s+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.sequence)([label_1.label, (0, source_1.str)(/^(?=\s).*\n/)])), (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([ulist_1.ulist, olist_1.olist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, example_1.example, table_2.table, blockquote_1.blockquote, placeholder_1.placeholder, (0, combinator_1.line)(inline_1.media), (0, combinator_1.line)(inline_1.shortmedia)])), source_1.emptyline, (0, combinator_1.block)((0, locale_1.localize)((0, combinator_1.context)({
|
|
4134
4118
|
syntax: {
|
|
4135
4119
|
inline: {
|
|
4136
4120
|
media: false
|
|
@@ -4265,8 +4249,6 @@ const ilist_1 = __webpack_require__(238);
|
|
|
4265
4249
|
|
|
4266
4250
|
const table_1 = __webpack_require__(8717);
|
|
4267
4251
|
|
|
4268
|
-
const indentblock_1 = __webpack_require__(3565);
|
|
4269
|
-
|
|
4270
4252
|
const codeblock_1 = __webpack_require__(1849);
|
|
4271
4253
|
|
|
4272
4254
|
const mathblock_1 = __webpack_require__(3754);
|
|
@@ -4307,10 +4289,10 @@ exports.message = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0,
|
|
|
4307
4289
|
}, `${opener}${body}${closer}`)];
|
|
4308
4290
|
}
|
|
4309
4291
|
|
|
4310
|
-
return [(0, dom_1.html)('
|
|
4292
|
+
return [(0, dom_1.html)('section', {
|
|
4311
4293
|
class: `message`,
|
|
4312
4294
|
'data-type': type
|
|
4313
|
-
}, (0, array_1.unshift)([(0, dom_1.html)('
|
|
4295
|
+
}, (0, array_1.unshift)([(0, dom_1.html)('h1', title(type))], [...(0, segment_1.segment)(body)].reduce((acc, seg) => (0, array_1.push)(acc, (0, parser_1.eval)(content(seg, context), [])), [])))];
|
|
4314
4296
|
})));
|
|
4315
4297
|
|
|
4316
4298
|
function title(type) {
|
|
@@ -4327,7 +4309,7 @@ function title(type) {
|
|
|
4327
4309
|
} // Must not have indexed blocks.
|
|
4328
4310
|
|
|
4329
4311
|
|
|
4330
|
-
const content = (0, combinator_1.union)([source_1.emptyline, ulist_1.ulist, olist_1.olist, ilist_1.ilist, table_1.table,
|
|
4312
|
+
const content = (0, combinator_1.union)([source_1.emptyline, ulist_1.ulist, olist_1.olist, ilist_1.ilist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, sidefence_1.sidefence, blockquote_1.blockquote, paragraph_1.paragraph]);
|
|
4331
4313
|
|
|
4332
4314
|
/***/ }),
|
|
4333
4315
|
|
|
@@ -4723,8 +4705,6 @@ const olist_1 = __webpack_require__(7471);
|
|
|
4723
4705
|
|
|
4724
4706
|
const inline_1 = __webpack_require__(1160);
|
|
4725
4707
|
|
|
4726
|
-
const source_1 = __webpack_require__(6743);
|
|
4727
|
-
|
|
4728
4708
|
const dom_1 = __webpack_require__(3252);
|
|
4729
4709
|
|
|
4730
4710
|
exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^[-+*](?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.context)({
|
|
@@ -4734,7 +4714,7 @@ exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combina
|
|
|
4734
4714
|
}
|
|
4735
4715
|
}
|
|
4736
4716
|
}, exports.ilist_))));
|
|
4737
|
-
exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^[-+*](?:$|\s)/, (0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/^[-+*](?:$|\s)/, (0, combinator_1.
|
|
4717
|
+
exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^[-+*](?:$|\s)/, (0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/^[-+*](?:$|\s)/, (0, combinator_1.some)(inline_1.inline), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), olist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])])))), es => [(0, dom_1.html)('ul', {
|
|
4738
4718
|
class: 'invalid',
|
|
4739
4719
|
'data-invalid-syntax': 'list',
|
|
4740
4720
|
'data-invalid-type': 'syntax',
|
|
@@ -4743,29 +4723,6 @@ exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combin
|
|
|
4743
4723
|
|
|
4744
4724
|
/***/ }),
|
|
4745
4725
|
|
|
4746
|
-
/***/ 3565:
|
|
4747
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4748
|
-
|
|
4749
|
-
"use strict";
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
4753
|
-
value: true
|
|
4754
|
-
}));
|
|
4755
|
-
exports.indentblock = void 0;
|
|
4756
|
-
|
|
4757
|
-
const combinator_1 = __webpack_require__(2087);
|
|
4758
|
-
|
|
4759
|
-
const codeblock_1 = __webpack_require__(1849); // 空行を含むインデントブロックはインデントの違いによるセグメント分割の境界が視認不能となるため採用しない
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
exports.indentblock = (0, combinator_1.block)((0, combinator_1.indent)(/^( {4}|\t)\1*/, (0, combinator_1.convert)(source => {
|
|
4763
|
-
const fence = (source.match(/^`{3,}(?=[^\S\n]*$)/mg) ?? []).reduce((max, fence) => fence > max ? fence : max, '``') + '`';
|
|
4764
|
-
return `${fence}\n${source}\n${fence}`;
|
|
4765
|
-
}, (0, combinator_1.union)([codeblock_1.codeblock])), true));
|
|
4766
|
-
|
|
4767
|
-
/***/ }),
|
|
4768
|
-
|
|
4769
4726
|
/***/ 3754:
|
|
4770
4727
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4771
4728
|
|
|
@@ -4813,7 +4770,7 @@ exports.mathblock = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0,
|
|
|
4813
4770
|
Object.defineProperty(exports, "__esModule", ({
|
|
4814
4771
|
value: true
|
|
4815
4772
|
}));
|
|
4816
|
-
exports.olist_ = exports.olist = void 0;
|
|
4773
|
+
exports.invalid = exports.olist_ = exports.olist = void 0;
|
|
4817
4774
|
|
|
4818
4775
|
const global_1 = __webpack_require__(4128);
|
|
4819
4776
|
|
|
@@ -4835,11 +4792,13 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
4835
4792
|
|
|
4836
4793
|
const array_1 = __webpack_require__(8112);
|
|
4837
4794
|
|
|
4795
|
+
const tuple_1 = __webpack_require__(5341);
|
|
4796
|
+
|
|
4838
4797
|
const openers = {
|
|
4839
|
-
'.': /^([0-9]+|[a-z]+|[A-Z]+)(?:-(?!-)[0-9]*)*(?![^\S\n])\.?(
|
|
4840
|
-
'(': /^\(([0-9]*|[a-z]*)(?![^)\n])\)?(?:-(?!-)[0-9]*)*(
|
|
4798
|
+
'.': /^([0-9]+|[a-z]+|[A-Z]+)(?:-(?!-)[0-9]*)*(?![^\S\n])\.?(?:$|\s)/,
|
|
4799
|
+
'(': /^\(([0-9]*|[a-z]*)(?![^)\n])\)?(?:-(?!-)[0-9]*)*(?:$|\s)/
|
|
4841
4800
|
};
|
|
4842
|
-
exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)([/^([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*\.(?=[^\S\n]|\n[^\S\n]*\S)
|
|
4801
|
+
exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(new RegExp([/^([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*\.(?=[^\S\n]|\n[^\S\n]*\S)/.source, /^\(([0-9]+|[a-z]+)\)(?:-[0-9]+)*(?=[^\S\n]|\n[^\S\n]*\S)/.source].join('|')), (0, combinator_1.context)({
|
|
4843
4802
|
syntax: {
|
|
4844
4803
|
inline: {
|
|
4845
4804
|
media: false
|
|
@@ -4848,15 +4807,15 @@ exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combina
|
|
|
4848
4807
|
}, exports.olist_))));
|
|
4849
4808
|
exports.olist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.match)(openers['.'], (0, memoize_1.memoize)(ms => list(type(ms[1]), '.'), ms => type(ms[1]).charCodeAt(0) || 0, [])), (0, combinator_1.match)(openers['('], (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => type(ms[1]).charCodeAt(0) || 0, []))])));
|
|
4850
4809
|
|
|
4851
|
-
const list = (type, form) => (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)([(0, combinator_1.line)((0, combinator_1.open)(heads[form], (0, combinator_1.
|
|
4852
|
-
'data-marker': ns[0]
|
|
4810
|
+
const list = (type, form) => (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)([(0, combinator_1.line)((0, combinator_1.open)(heads[form], (0, combinator_1.subsequence)([ulist_1.checkbox, (0, util_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))]), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, exports.olist_, ilist_1.ilist_]))]), exports.invalid), ns => [(0, dom_1.html)('li', {
|
|
4811
|
+
'data-marker': ns[0] || global_1.undefined
|
|
4853
4812
|
}, (0, dom_1.defrag)((0, ulist_1.fillFirstLine)((0, array_1.shift)(ns)[1])))]), true)]))), es => [format((0, dom_1.html)('ol', es), type, form)]);
|
|
4854
4813
|
|
|
4855
4814
|
const heads = {
|
|
4856
|
-
'.': (0, combinator_1.focus)(openers['.'], source => [[
|
|
4857
|
-
'(': (0, combinator_1.focus)(openers['('], source => [[source.replace(/^\($/, '(1)').replace(/^\((\w+)$/, '($1)')], ''])
|
|
4815
|
+
'.': (0, combinator_1.focus)(openers['.'], source => [[source.trimEnd().split('.', 1)[0] + '.'], '']),
|
|
4816
|
+
'(': (0, combinator_1.focus)(openers['('], source => [[source.trimEnd().replace(/^\($/, '(1)').replace(/^\((\w+)$/, '($1)')], ''])
|
|
4858
4817
|
};
|
|
4859
|
-
|
|
4818
|
+
exports.invalid = (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.contentline, (0, combinator_1.indent)(s => [(0, tuple_1.tuple)(s), ''])]), source => [['', (0, dom_1.html)('span', {
|
|
4860
4819
|
class: 'invalid',
|
|
4861
4820
|
'data-invalid-syntax': 'listitem',
|
|
4862
4821
|
'data-invalid-type': 'syntax',
|
|
@@ -5228,8 +5187,6 @@ const ilist_1 = __webpack_require__(238);
|
|
|
5228
5187
|
|
|
5229
5188
|
const inline_1 = __webpack_require__(1160);
|
|
5230
5189
|
|
|
5231
|
-
const source_1 = __webpack_require__(6743);
|
|
5232
|
-
|
|
5233
5190
|
const util_1 = __webpack_require__(9437);
|
|
5234
5191
|
|
|
5235
5192
|
const dom_1 = __webpack_require__(3252);
|
|
@@ -5243,16 +5200,10 @@ exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combina
|
|
|
5243
5200
|
}
|
|
5244
5201
|
}
|
|
5245
5202
|
}, exports.ulist_))));
|
|
5246
|
-
exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^-(?=$|\s)/, (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)([(0, combinator_1.line)((0, combinator_1.open)(/^-(?:$|\s)/, (0, combinator_1.
|
|
5203
|
+
exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^-(?=$|\s)/, (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)([(0, combinator_1.line)((0, combinator_1.open)(/^-(?:$|\s)/, (0, combinator_1.subsequence)([exports.checkbox, (0, util_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))]), true)), (0, combinator_1.indent)((0, combinator_1.union)([exports.ulist_, olist_1.olist_, ilist_1.ilist_]))]), olist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)(fillFirstLine(ns)))]), true)])))), es => [format((0, dom_1.html)('ul', es))])));
|
|
5247
5204
|
exports.checkbox = (0, combinator_1.focus)(/^\[[xX ]\](?=$|\s)/, source => [[(0, dom_1.html)('span', {
|
|
5248
5205
|
class: 'checkbox'
|
|
5249
5206
|
}, source[1].trimStart() ? '☑' : '☐')], '']);
|
|
5250
|
-
const invalid = (0, combinator_1.rewrite)(source_1.contentline, source => [[(0, dom_1.html)('span', {
|
|
5251
|
-
class: 'invalid',
|
|
5252
|
-
'data-invalid-syntax': 'listitem',
|
|
5253
|
-
'data-invalid-type': 'syntax',
|
|
5254
|
-
'data-invalid-message': 'Fix the indent or the head of the list item'
|
|
5255
|
-
}, source.replace('\n', ''))], '']);
|
|
5256
5207
|
|
|
5257
5208
|
function fillFirstLine(ns) {
|
|
5258
5209
|
return ns.length === 1 && typeof ns[0] === 'object' && ['UL', 'OL'].includes(ns[0].tagName) ? (0, array_1.unshift)([(0, dom_1.html)('br')], ns) : ns;
|
|
@@ -5455,7 +5406,7 @@ exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0,
|
|
|
5455
5406
|
delimiters: global_1.undefined
|
|
5456
5407
|
}, (0, util_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', /^\\?\n/)))), '))'), ns => [(0, dom_1.html)('sup', {
|
|
5457
5408
|
class: 'annotation'
|
|
5458
|
-
}, (0, dom_1.defrag)(ns))]))));
|
|
5409
|
+
}, [(0, dom_1.html)('span', (0, dom_1.defrag)(ns))])]))));
|
|
5459
5410
|
|
|
5460
5411
|
/***/ }),
|
|
5461
5412
|
|
|
@@ -5493,8 +5444,8 @@ const util_1 = __webpack_require__(9437);
|
|
|
5493
5444
|
exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]|\S#)/, (0, combinator_1.guard)(context => context.syntax?.inline?.autolink ?? true, (0, combinator_1.some)((0, combinator_1.union)([url_1.url, email_1.email, // Escape unmatched email-like strings.
|
|
5494
5445
|
(0, source_1.str)(/^[0-9A-Za-z]+(?:[.+_-][0-9A-Za-z]+)*(?:@(?:[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?)+/), channel_1.channel, account_1.account, // Escape unmatched account-like strings.
|
|
5495
5446
|
(0, source_1.str)(/^@+[0-9A-Za-z]*(?:-[0-9A-Za-z]+)*/), // Escape invalid leading characters.
|
|
5496
|
-
(0, source_1.str)(new RegExp(
|
|
5497
|
-
(0, source_1.str)(new RegExp(
|
|
5447
|
+
(0, source_1.str)(new RegExp(/^(?:[^\p{C}\p{S}\p{P}\s]|emoji|['_])(?=#)/u.source.replace('emoji', hashtag_1.emoji), 'u')), hashtag_1.hashtag, hashnum_1.hashnum, // Escape unmatched hashtag-like strings.
|
|
5448
|
+
(0, source_1.str)(new RegExp(/^#+(?:[^\p{C}\p{S}\p{P}\s]|emoji|['_])*/u.source.replace('emoji', hashtag_1.emoji), 'u')), anchor_1.anchor])))), ns => ns.length === 1 ? ns : [(0, util_1.stringify)(ns)]);
|
|
5498
5449
|
|
|
5499
5450
|
/***/ }),
|
|
5500
5451
|
|
|
@@ -5648,7 +5599,7 @@ const source_1 = __webpack_require__(6743);
|
|
|
5648
5599
|
|
|
5649
5600
|
const dom_1 = __webpack_require__(3252);
|
|
5650
5601
|
|
|
5651
|
-
exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, source_1.str)(new RegExp(
|
|
5602
|
+
exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, source_1.str)(new RegExp(/^[0-9]{1,16}(?![^\p{C}\p{S}\p{P}\s]|emoji|['_])/u.source.replace(/emoji/, hashtag_1.emoji), 'u'))), (0, combinator_1.context)({
|
|
5652
5603
|
syntax: {
|
|
5653
5604
|
inline: {
|
|
5654
5605
|
link: true,
|
|
@@ -5684,7 +5635,7 @@ const dom_1 = __webpack_require__(3252); // https://example/hashtags/a must be a
|
|
|
5684
5635
|
|
|
5685
5636
|
|
|
5686
5637
|
exports.emoji = String.raw`\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F`;
|
|
5687
|
-
exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, combinator_1.tails)([(0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?)*\//), ([source]) => source.length <= 253 + 1), (0, combinator_1.verify)((0, source_1.str)(new RegExp([
|
|
5638
|
+
exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.open)('#', (0, combinator_1.tails)([(0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?)*\//), ([source]) => source.length <= 253 + 1), (0, combinator_1.verify)((0, source_1.str)(new RegExp([/^(?=[0-9]{0,127}_?(?:[^\d\p{C}\p{S}\p{P}\s]|emoji))/u.source, /(?:[^\p{C}\p{S}\p{P}\s]|emoji|_(?=[^\p{C}\p{S}\p{P}\s]|emoji)){1,128}/u.source, /(?!_?(?:[^\p{C}\p{S}\p{P}\s]|emoji)|')/u.source].join('').replace(/emoji/g, exports.emoji), 'u')), ([source]) => source.length <= 128)])), (0, combinator_1.context)({
|
|
5688
5639
|
syntax: {
|
|
5689
5640
|
inline: {
|
|
5690
5641
|
link: true,
|
|
@@ -6015,7 +5966,7 @@ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combi
|
|
|
6015
5966
|
autolink: false
|
|
6016
5967
|
}
|
|
6017
5968
|
}
|
|
6018
|
-
}, (0, combinator_1.open)((0, source_1.stropt)(
|
|
5969
|
+
}, (0, combinator_1.open)((0, source_1.stropt)(/^\|?/), (0, util_1.trimBlankEnd)((0, combinator_1.some)((0, combinator_1.union)([signature, inline_1.inline]), ']', /^\\?\n/)), true)))), ']'), ns => [(0, dom_1.html)('a', (0, dom_1.defrag)(ns))])), ([el]) => [(0, dom_1.define)(el, {
|
|
6019
5970
|
id: el.id ? null : global_1.undefined,
|
|
6020
5971
|
class: 'index',
|
|
6021
5972
|
href: el.id ? `#${el.id}` : global_1.undefined
|
|
@@ -6719,7 +6670,7 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, c
|
|
|
6719
6670
|
}
|
|
6720
6671
|
},
|
|
6721
6672
|
delimiters: global_1.undefined
|
|
6722
|
-
}, (0, combinator_1.subsequence)([abbr, (0, combinator_1.
|
|
6673
|
+
}, (0, combinator_1.subsequence)([abbr, (0, combinator_1.open)((0, source_1.stropt)(/^(?=\^)/), (0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/)), (0, util_1.trimBlank)((0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/))]))), ']]'), ns => [(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, dom_1.defrag)(ns))])]))));
|
|
6723
6674
|
const abbr = (0, combinator_1.creator)((0, combinator_1.bind)((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]*/), ([source], rest) => [[(0, dom_1.html)('abbr', source)], rest.replace(util_1.regBlankStart, '')]));
|
|
6724
6675
|
|
|
6725
6676
|
function attributes(ns) {
|
|
@@ -7046,7 +6997,7 @@ const multimap_1 = __webpack_require__(940);
|
|
|
7046
6997
|
const array_1 = __webpack_require__(8112);
|
|
7047
6998
|
|
|
7048
6999
|
function* figure(target, footnotes, opts = {}) {
|
|
7049
|
-
const refs = new multimap_1.MultiMap((0, array_1.push)((0, array_1.push)(
|
|
7000
|
+
const refs = new multimap_1.MultiMap((0, array_1.push)((0, array_1.push)([], target.querySelectorAll('a.label:not(.disabled)[data-label]')), footnotes?.references.querySelectorAll('a.label:not(.disabled)') ?? []).map(el => [el.getAttribute('data-label'), el]));
|
|
7050
7001
|
const labels = new global_1.Set();
|
|
7051
7002
|
const numbers = new global_1.Map();
|
|
7052
7003
|
let base = '0';
|
|
@@ -7238,37 +7189,53 @@ const dom_1 = __webpack_require__(3252);
|
|
|
7238
7189
|
|
|
7239
7190
|
const multimap_1 = __webpack_require__(940);
|
|
7240
7191
|
|
|
7241
|
-
const
|
|
7192
|
+
const array_1 = __webpack_require__(8112);
|
|
7242
7193
|
|
|
7243
|
-
function* footnote(target, footnotes, opts = {}) {
|
|
7244
|
-
yield* (0, exports.reference)(target, footnotes?.references, opts,
|
|
7245
|
-
yield* (0, exports.annotation)(target, footnotes?.annotations, opts,
|
|
7194
|
+
function* footnote(target, footnotes, opts = {}, bottom = null) {
|
|
7195
|
+
yield* (0, exports.reference)(target, footnotes?.references, opts, bottom);
|
|
7196
|
+
yield* (0, exports.annotation)(target, footnotes?.annotations, opts, bottom);
|
|
7246
7197
|
return;
|
|
7247
7198
|
}
|
|
7248
7199
|
|
|
7249
7200
|
exports.footnote = footnote;
|
|
7250
|
-
exports.annotation = build('annotation', n => `*${n}
|
|
7201
|
+
exports.annotation = build('annotation', n => `*${n}`, 'h1, h2, h3, h4, h5, h6, aside.aside, hr');
|
|
7251
7202
|
exports.reference = build('reference', (n, abbr) => `[${abbr || n}]`);
|
|
7252
7203
|
|
|
7253
|
-
function build(syntax, marker) {
|
|
7204
|
+
function build(syntax, marker, splitter) {
|
|
7254
7205
|
// Referenceを含むAnnotationの重複排除は両構文が互いに処理済みであることを必要とするため
|
|
7255
7206
|
// 構文ごとに各1回の処理では不可能
|
|
7256
|
-
|
|
7257
|
-
const contentify = (0, memoize_1.memoize)(ref => (0, dom_1.frag)(ref.cloneNode(true).childNodes), new global_1.WeakMap());
|
|
7258
|
-
return function* (target, footnote, opts = {}, footnotes = []) {
|
|
7207
|
+
return function* (target, footnote, opts = {}, bottom = null) {
|
|
7259
7208
|
const defs = new global_1.Map();
|
|
7260
7209
|
const buffer = new multimap_1.MultiMap();
|
|
7261
|
-
const titles = new global_1.Map();
|
|
7262
|
-
const
|
|
7210
|
+
const titles = new global_1.Map(); // Bug: Firefox
|
|
7211
|
+
//const splitters = push([], target.querySelectorAll(`:scope > :is(${splitter ?? '_'})`));
|
|
7212
|
+
|
|
7213
|
+
const splitters = (0, array_1.push)([], target.querySelectorAll(splitter ?? '_')).filter(el => el.parentNode === target); // Bug: Firefox
|
|
7214
|
+
//target.querySelectorAll(`:scope > .${syntax}s`).forEach(el => el.remove());
|
|
7215
|
+
|
|
7216
|
+
target.querySelectorAll(`.${syntax}s`).forEach(el => el.parentNode === target && el.remove());
|
|
7217
|
+
let offset = 0;
|
|
7263
7218
|
let style;
|
|
7264
7219
|
|
|
7265
7220
|
for (let refs = target.querySelectorAll(`sup.${syntax}:not(.disabled)`), i = 0, len = refs.length; i < len; ++i) {
|
|
7266
7221
|
yield;
|
|
7267
7222
|
const ref = refs[i];
|
|
7268
|
-
|
|
7269
|
-
|
|
7223
|
+
|
|
7224
|
+
while (+splitters[0]?.compareDocumentPosition(ref) & global_1.Node.DOCUMENT_POSITION_FOLLOWING) {
|
|
7225
|
+
if (defs.size > 0) {
|
|
7226
|
+
offset += defs.size;
|
|
7227
|
+
yield* proc(defs, target.insertBefore((0, dom_1.html)('ol', {
|
|
7228
|
+
class: `${syntax}s`
|
|
7229
|
+
}), splitters[0] ?? null));
|
|
7230
|
+
}
|
|
7231
|
+
|
|
7232
|
+
splitters.shift();
|
|
7233
|
+
}
|
|
7234
|
+
|
|
7235
|
+
if (syntax === 'annotation' && ref.closest('#annotations, .annotations, #references, .references')) continue;
|
|
7236
|
+
const identifier = `${+!ref.querySelector('.label')}:${ref.getAttribute('data-abbr') || '_' + ref.firstElementChild.innerHTML}`;
|
|
7270
7237
|
const abbr = ref.getAttribute('data-abbr') || global_1.undefined;
|
|
7271
|
-
const content =
|
|
7238
|
+
const content = (0, dom_1.frag)(ref.firstElementChild.cloneNode(true).childNodes);
|
|
7272
7239
|
style ??= abbr ? 'abbr' : 'count';
|
|
7273
7240
|
|
|
7274
7241
|
if (style === 'count' ? abbr : !abbr) {
|
|
@@ -7278,12 +7245,17 @@ function build(syntax, marker) {
|
|
|
7278
7245
|
'data-invalid-type': 'style',
|
|
7279
7246
|
'data-invalid-message': `${syntax[0].toUpperCase() + syntax.slice(1)} style must be consistent`
|
|
7280
7247
|
});
|
|
7248
|
+
} else if (ref.getAttribute('data-invalid-type') === 'style') {
|
|
7249
|
+
(0, dom_1.define)(ref, {
|
|
7250
|
+
class: void ref.classList.remove('invalid'),
|
|
7251
|
+
'data-invalid-syntax': null,
|
|
7252
|
+
'data-invalid-type': null,
|
|
7253
|
+
'data-invalid-message': null
|
|
7254
|
+
});
|
|
7281
7255
|
}
|
|
7282
7256
|
|
|
7283
|
-
if (ref.firstElementChild
|
|
7284
|
-
ref.
|
|
7285
|
-
hidden: ''
|
|
7286
|
-
}, ref.childNodes));
|
|
7257
|
+
if (!ref.firstElementChild.hasAttribute('hidden')) {
|
|
7258
|
+
ref.firstElementChild.setAttribute('hidden', '');
|
|
7287
7259
|
} else {
|
|
7288
7260
|
ref.lastChild?.remove();
|
|
7289
7261
|
}
|
|
@@ -7294,7 +7266,8 @@ function build(syntax, marker) {
|
|
|
7294
7266
|
const refIndex = i + 1;
|
|
7295
7267
|
const refId = opts.id !== '' ? ref.id || `${syntax}:${opts.id ? `${opts.id}:` : ''}ref:${refIndex}` : global_1.undefined;
|
|
7296
7268
|
const def = global_1.undefined || defs.get(identifier) || defs.set(identifier, (0, dom_1.html)('li', {
|
|
7297
|
-
id: opts.id !== '' ? `${syntax}:${opts.id ? `${opts.id}:` : ''}def:${defs.size + 1}` : global_1.undefined
|
|
7269
|
+
id: opts.id !== '' ? `${syntax}:${opts.id ? `${opts.id}:` : ''}def:${defs.size + offset + 1}` : global_1.undefined,
|
|
7270
|
+
'data-marker': !footnote ? marker(defs.size + offset + 1, abbr) : global_1.undefined
|
|
7298
7271
|
}, [content.cloneNode(true), (0, dom_1.html)('sup')])).get(identifier);
|
|
7299
7272
|
|
|
7300
7273
|
if (title && !blank && def.childNodes.length === 1) {
|
|
@@ -7312,7 +7285,7 @@ function build(syntax, marker) {
|
|
|
7312
7285
|
}
|
|
7313
7286
|
}
|
|
7314
7287
|
|
|
7315
|
-
const defIndex = +def.id.slice(def.id.lastIndexOf(':') + 1) || defs.size;
|
|
7288
|
+
const defIndex = +def.id.slice(def.id.lastIndexOf(':') + 1) || defs.size + offset;
|
|
7316
7289
|
const defId = def.id || global_1.undefined;
|
|
7317
7290
|
(0, dom_1.define)(ref, {
|
|
7318
7291
|
id: refId,
|
|
@@ -7335,7 +7308,16 @@ function build(syntax, marker) {
|
|
|
7335
7308
|
}, `^${refIndex}`));
|
|
7336
7309
|
}
|
|
7337
7310
|
|
|
7338
|
-
if (
|
|
7311
|
+
if (defs.size > 0 || footnote) {
|
|
7312
|
+
yield* proc(defs, footnote ?? target.insertBefore((0, dom_1.html)('ol', {
|
|
7313
|
+
class: `${syntax}s`
|
|
7314
|
+
}), splitters[0] ?? bottom));
|
|
7315
|
+
}
|
|
7316
|
+
|
|
7317
|
+
return;
|
|
7318
|
+
};
|
|
7319
|
+
|
|
7320
|
+
function* proc(defs, footnote) {
|
|
7339
7321
|
const {
|
|
7340
7322
|
children
|
|
7341
7323
|
} = footnote;
|
|
@@ -7343,7 +7325,8 @@ function build(syntax, marker) {
|
|
|
7343
7325
|
let count = 0;
|
|
7344
7326
|
let length = children.length;
|
|
7345
7327
|
|
|
7346
|
-
I: for (const def of defs
|
|
7328
|
+
I: for (const [key, def] of defs) {
|
|
7329
|
+
defs.delete(key);
|
|
7347
7330
|
++count;
|
|
7348
7331
|
|
|
7349
7332
|
while (length > size) {
|
|
@@ -7365,7 +7348,7 @@ function build(syntax, marker) {
|
|
|
7365
7348
|
}
|
|
7366
7349
|
|
|
7367
7350
|
return;
|
|
7368
|
-
}
|
|
7351
|
+
}
|
|
7369
7352
|
}
|
|
7370
7353
|
|
|
7371
7354
|
function equal(a, b) {
|
|
@@ -7618,11 +7601,11 @@ exports.str = str;
|
|
|
7618
7601
|
function stropt(pattern) {
|
|
7619
7602
|
return typeof pattern === 'string' ? (0, combinator_1.creator)(source => {
|
|
7620
7603
|
if (source === '') return;
|
|
7621
|
-
return source.slice(0, pattern.length) === pattern ? [[pattern], source.slice(pattern.length)] :
|
|
7604
|
+
return source.slice(0, pattern.length) === pattern ? [[pattern], source.slice(pattern.length)] : global_1.undefined;
|
|
7622
7605
|
}) : (0, combinator_1.creator)(source => {
|
|
7623
7606
|
if (source === '') return;
|
|
7624
7607
|
const m = source.match(pattern);
|
|
7625
|
-
return m ? [[m[0]], source.slice(m[0].length)] :
|
|
7608
|
+
return m ? [[m[0]], source.slice(m[0].length)] : global_1.undefined;
|
|
7626
7609
|
});
|
|
7627
7610
|
}
|
|
7628
7611
|
|
|
@@ -7779,7 +7762,7 @@ exports.unescsource = (0, combinator_1.creator)(source => {
|
|
|
7779
7762
|
Object.defineProperty(exports, "__esModule", ({
|
|
7780
7763
|
value: true
|
|
7781
7764
|
}));
|
|
7782
|
-
exports.stringify = exports.
|
|
7765
|
+
exports.stringify = exports.trimBlankEnd = exports.trimBlankStart = exports.trimBlank = exports.isStartTightNodes = exports.startTight = exports.startLoose = exports.visualize = exports.blankWith = exports.regBlankStart = void 0;
|
|
7783
7766
|
|
|
7784
7767
|
const global_1 = __webpack_require__(4128);
|
|
7785
7768
|
|
|
@@ -7797,7 +7780,7 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
7797
7780
|
|
|
7798
7781
|
const array_1 = __webpack_require__(8112);
|
|
7799
7782
|
|
|
7800
|
-
exports.regBlankStart = new RegExp(
|
|
7783
|
+
exports.regBlankStart = new RegExp(/^(?:\\?[^\S\n]|&IHN;|<wbr>)+/.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`));
|
|
7801
7784
|
|
|
7802
7785
|
function blankWith(starting, delimiter) {
|
|
7803
7786
|
if (delimiter === global_1.undefined) return blankWith('', starting);
|
|
@@ -7807,7 +7790,7 @@ function blankWith(starting, delimiter) {
|
|
|
7807
7790
|
exports.blankWith = blankWith;
|
|
7808
7791
|
|
|
7809
7792
|
function visualize(parser) {
|
|
7810
|
-
const blankline = new RegExp(
|
|
7793
|
+
const blankline = new RegExp(/^(?:\\$|\\?[^\S\n]|&IHN;|<wbr>)+$/.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'gm');
|
|
7811
7794
|
return (0, combinator_1.union)([(0, combinator_1.convert)(source => source.replace(blankline, line => line.replace(/[\\&<]/g, '\x1B$&')), (0, combinator_1.verify)(parser, (ns, rest, context) => !rest && hasVisible(ns, context))), (0, combinator_1.some)((0, combinator_1.union)([source_1.linebreak, source_1.unescsource]))]);
|
|
7812
7795
|
}
|
|
7813
7796
|
|
|
@@ -7926,14 +7909,22 @@ function isVisible(node, strpos) {
|
|
|
7926
7909
|
}
|
|
7927
7910
|
|
|
7928
7911
|
function trimBlank(parser) {
|
|
7929
|
-
return (
|
|
7912
|
+
return trimBlankStart(trimBlankEnd(parser));
|
|
7930
7913
|
}
|
|
7931
7914
|
|
|
7932
7915
|
exports.trimBlank = trimBlank;
|
|
7933
7916
|
|
|
7934
7917
|
function trimBlankStart(parser) {
|
|
7935
7918
|
return (0, combinator_1.convert)((0, memoize_1.reduce)(source => source.replace(exports.regBlankStart, '')), parser);
|
|
7936
|
-
}
|
|
7919
|
+
}
|
|
7920
|
+
|
|
7921
|
+
exports.trimBlankStart = trimBlankStart;
|
|
7922
|
+
|
|
7923
|
+
function trimBlankEnd(parser) {
|
|
7924
|
+
return (0, combinator_1.fmap)(parser, trimNodeEnd);
|
|
7925
|
+
}
|
|
7926
|
+
|
|
7927
|
+
exports.trimBlankEnd = trimBlankEnd; //export function trimNode(nodes: (HTMLElement | string)[]): (HTMLElement | string)[] {
|
|
7937
7928
|
// return trimNodeStart(trimNodeEnd(nodes));
|
|
7938
7929
|
//}
|
|
7939
7930
|
//function trimNodeStart(nodes: (HTMLElement | string)[]): (HTMLElement | string)[] {
|
|
@@ -7951,7 +7942,6 @@ function trimBlankStart(parser) {
|
|
|
7951
7942
|
// return nodes;
|
|
7952
7943
|
//}
|
|
7953
7944
|
|
|
7954
|
-
|
|
7955
7945
|
function trimNodeEnd(nodes) {
|
|
7956
7946
|
const skip = nodes.length > 0 && typeof nodes[nodes.length - 1] === 'object' && nodes[nodes.length - 1]['className'] === 'indexer' ? [nodes.pop()] : [];
|
|
7957
7947
|
|
|
@@ -7971,8 +7961,6 @@ function trimNodeEnd(nodes) {
|
|
|
7971
7961
|
return (0, array_1.push)(nodes, skip);
|
|
7972
7962
|
}
|
|
7973
7963
|
|
|
7974
|
-
exports.trimNodeEnd = trimNodeEnd;
|
|
7975
|
-
|
|
7976
7964
|
function stringify(nodes) {
|
|
7977
7965
|
let acc = '';
|
|
7978
7966
|
|
|
@@ -8501,13 +8489,13 @@ exports.info = void 0;
|
|
|
8501
8489
|
|
|
8502
8490
|
const scope_1 = __webpack_require__(5202);
|
|
8503
8491
|
|
|
8504
|
-
const
|
|
8492
|
+
const array_1 = __webpack_require__(8112);
|
|
8505
8493
|
|
|
8506
8494
|
function info(source) {
|
|
8507
8495
|
const match = (0, scope_1.scope)(source, '.invalid');
|
|
8508
8496
|
return {
|
|
8509
|
-
url: find('a:not(
|
|
8510
|
-
tel: find('a:not(
|
|
8497
|
+
url: find('a:not(:is(.email, .account, .channel, .hashtag, .hashnum, .anchor))').filter(el => ['http:', 'https:'].includes(el.protocol)),
|
|
8498
|
+
tel: find('a:not(:is(.email, .account, .channel, .hashtag, .hashnum, .anchor))').filter(el => ['tel:'].includes(el.protocol)),
|
|
8511
8499
|
email: find('a.email'),
|
|
8512
8500
|
account: find('a.account'),
|
|
8513
8501
|
channel: find('a.channel'),
|
|
@@ -8519,7 +8507,7 @@ function info(source) {
|
|
|
8519
8507
|
};
|
|
8520
8508
|
|
|
8521
8509
|
function find(selector) {
|
|
8522
|
-
return (0,
|
|
8510
|
+
return (0, array_1.push)([], source.querySelectorAll(selector)).filter(match);
|
|
8523
8511
|
}
|
|
8524
8512
|
}
|
|
8525
8513
|
|
|
@@ -8692,29 +8680,21 @@ const array_1 = __webpack_require__(8112); // Bug: Firefox
|
|
|
8692
8680
|
//const selector = 'h1 h2 h3 h4 h5 h6 aside.aside'.split(' ').map(s => `:scope > ${s}[id]`).join();
|
|
8693
8681
|
|
|
8694
8682
|
|
|
8695
|
-
const selector = 'h1 h2 h3 h4 h5 h6 aside.aside
|
|
8683
|
+
const selector = ':is(h1, h2, h3, h4, h5, h6, aside.aside)[id]';
|
|
8696
8684
|
|
|
8697
8685
|
function toc(source) {
|
|
8698
|
-
const
|
|
8699
|
-
const hs = (0, global_1.Array)(es.length);
|
|
8700
|
-
|
|
8701
|
-
for (let i = 0; i < hs.length; ++i) {
|
|
8702
|
-
const el = es[i];
|
|
8703
|
-
|
|
8686
|
+
const hs = (0, array_1.push)([], source.querySelectorAll(selector)).map(el => {
|
|
8704
8687
|
switch (el.tagName) {
|
|
8705
8688
|
case 'ASIDE':
|
|
8706
|
-
|
|
8689
|
+
return (0, dom_1.html)(el.firstElementChild.tagName.toLowerCase(), {
|
|
8707
8690
|
id: el.id,
|
|
8708
8691
|
class: 'aside'
|
|
8709
8692
|
}, el.firstElementChild.cloneNode(true).childNodes);
|
|
8710
|
-
continue;
|
|
8711
8693
|
|
|
8712
8694
|
default:
|
|
8713
|
-
|
|
8714
|
-
continue;
|
|
8695
|
+
return el;
|
|
8715
8696
|
}
|
|
8716
|
-
}
|
|
8717
|
-
|
|
8697
|
+
});
|
|
8718
8698
|
return parse(cons(hs));
|
|
8719
8699
|
}
|
|
8720
8700
|
|
|
@@ -8759,7 +8739,7 @@ function fix(h) {
|
|
|
8759
8739
|
/***/ 3252:
|
|
8760
8740
|
/***/ (function(module) {
|
|
8761
8741
|
|
|
8762
|
-
/*! typed-dom v0.0.
|
|
8742
|
+
/*! typed-dom v0.0.299 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
|
|
8763
8743
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
8764
8744
|
if(true)
|
|
8765
8745
|
module.exports = factory();
|
|
@@ -9193,7 +9173,7 @@ exports.defrag = defrag;
|
|
|
9193
9173
|
/***/ 6120:
|
|
9194
9174
|
/***/ (function(module) {
|
|
9195
9175
|
|
|
9196
|
-
/*! typed-dom v0.0.
|
|
9176
|
+
/*! typed-dom v0.0.299 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
|
|
9197
9177
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
9198
9178
|
if(true)
|
|
9199
9179
|
module.exports = factory();
|