securemark 0.293.0 → 0.293.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 +8 -0
- package/dist/index.js +254 -193
- package/markdown.d.ts +13 -21
- package/package.json +1 -1
- package/src/combinator/control/manipulation/scope.ts +3 -4
- package/src/combinator/data/parser/context.ts +5 -5
- package/src/combinator.ts +0 -1
- package/src/parser/api/parse.test.ts +2 -2
- package/src/parser/autolink.test.ts +7 -7
- package/src/parser/block/blockquote.ts +2 -2
- package/src/parser/block/codeblock.ts +7 -7
- package/src/parser/block/dlist.ts +1 -2
- package/src/parser/block/extension/aside.ts +3 -3
- package/src/parser/block/extension/example.ts +3 -3
- package/src/parser/block/extension/fig.ts +2 -2
- package/src/parser/block/extension/figure.test.ts +1 -1
- package/src/parser/block/extension/figure.ts +2 -2
- package/src/parser/block/extension/message.ts +3 -3
- package/src/parser/block/extension/placeholder.ts +7 -7
- package/src/parser/block/extension/table.ts +26 -16
- package/src/parser/block/extension.ts +3 -3
- package/src/parser/block/ilist.ts +3 -3
- package/src/parser/block/mathblock.ts +7 -7
- package/src/parser/block/mediablock.ts +6 -6
- package/src/parser/block/olist.ts +3 -3
- package/src/parser/block/paragraph.test.ts +1 -2
- package/src/parser/block/paragraph.ts +1 -2
- package/src/parser/block/reply/cite.ts +3 -5
- package/src/parser/block/reply/quote.ts +2 -3
- package/src/parser/block/sidefence.ts +2 -2
- package/src/parser/block/table.ts +5 -5
- package/src/parser/block/ulist.ts +2 -3
- package/src/parser/block.ts +2 -2
- package/src/parser/context.ts +4 -4
- package/src/parser/inline/annotation.ts +1 -1
- package/src/parser/inline/autolink/url.test.ts +7 -7
- package/src/parser/inline/autolink/url.ts +1 -2
- package/src/parser/inline/autolink.ts +1 -1
- package/src/parser/inline/bracket.test.ts +2 -2
- package/src/parser/inline/extension/index.ts +5 -4
- package/src/parser/inline/extension/indexer.test.ts +0 -1
- package/src/parser/inline/extension/indexer.ts +1 -1
- package/src/parser/inline/html.ts +7 -6
- package/src/parser/inline/htmlentity.ts +3 -3
- package/src/parser/inline/italic.test.ts +11 -11
- package/src/parser/inline/link.ts +1 -6
- package/src/parser/inline/mark.test.ts +5 -5
- package/src/parser/inline/math.ts +3 -3
- package/src/parser/inline/media.ts +3 -8
- package/src/parser/inline/reference.ts +1 -1
- package/src/parser/inline/remark.test.ts +14 -18
- package/src/parser/inline/remark.ts +17 -19
- package/src/parser/inline/ruby.ts +3 -3
- package/src/parser/inline/shortmedia.ts +1 -1
- package/src/parser/inline.test.ts +25 -24
- package/src/parser/inline.ts +21 -9
- package/src/parser/segment.ts +23 -5
- package/src/parser/source/escapable.test.ts +1 -1
- package/src/parser/source/escapable.ts +4 -12
- package/src/parser/source/text.test.ts +40 -40
- package/src/parser/source/text.ts +77 -24
- package/src/parser/source/unescapable.test.ts +3 -3
- package/src/parser/source/unescapable.ts +4 -12
- package/src/parser/visibility.ts +32 -32
- package/src/combinator/control/manipulation/trim.test.ts +0 -23
- package/src/combinator/control/manipulation/trim.ts +0 -17
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.293.
|
|
1
|
+
/*! securemark v0.293.2 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("Prism"), require("DOMPurify"));
|
|
@@ -2440,7 +2440,6 @@ __exportStar(__webpack_require__(8606), exports);
|
|
|
2440
2440
|
__exportStar(__webpack_require__(5781), exports);
|
|
2441
2441
|
__exportStar(__webpack_require__(1638), exports);
|
|
2442
2442
|
__exportStar(__webpack_require__(6572), exports);
|
|
2443
|
-
__exportStar(__webpack_require__(79), exports);
|
|
2444
2443
|
__exportStar(__webpack_require__(4750), exports);
|
|
2445
2444
|
__exportStar(__webpack_require__(2217), exports);
|
|
2446
2445
|
__exportStar(__webpack_require__(5117), exports);
|
|
@@ -2907,7 +2906,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2907
2906
|
exports.rewrite = exports.focus = void 0;
|
|
2908
2907
|
const parser_1 = __webpack_require__(605);
|
|
2909
2908
|
const combinator_1 = __webpack_require__(3484);
|
|
2910
|
-
function focus(scope, parser
|
|
2909
|
+
function focus(scope, parser) {
|
|
2911
2910
|
const match = (0, combinator_1.matcher)(scope, false);
|
|
2912
2911
|
return (0, parser_1.failsafe)(({
|
|
2913
2912
|
context
|
|
@@ -2921,7 +2920,6 @@ function focus(scope, parser, cost = true) {
|
|
|
2921
2920
|
context
|
|
2922
2921
|
}))?.[0] ?? '';
|
|
2923
2922
|
if (src === '') return;
|
|
2924
|
-
cost && (0, combinator_1.consume)(src.length, context);
|
|
2925
2923
|
context.range = src.length;
|
|
2926
2924
|
context.offset ??= 0;
|
|
2927
2925
|
context.offset += position;
|
|
@@ -3111,32 +3109,6 @@ function size(bits) {
|
|
|
3111
3109
|
|
|
3112
3110
|
/***/ },
|
|
3113
3111
|
|
|
3114
|
-
/***/ 79
|
|
3115
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
3116
|
-
|
|
3117
|
-
"use strict";
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
3121
|
-
value: true
|
|
3122
|
-
}));
|
|
3123
|
-
exports.trimEnd = exports.trimStart = exports.trim = void 0;
|
|
3124
|
-
const convert_1 = __webpack_require__(6572);
|
|
3125
|
-
function trim(parser) {
|
|
3126
|
-
return (0, convert_1.convert)(source => source.trim(), parser, false);
|
|
3127
|
-
}
|
|
3128
|
-
exports.trim = trim;
|
|
3129
|
-
function trimStart(parser) {
|
|
3130
|
-
return (0, convert_1.convert)(source => source.trimStart(), parser, true);
|
|
3131
|
-
}
|
|
3132
|
-
exports.trimStart = trimStart;
|
|
3133
|
-
function trimEnd(parser) {
|
|
3134
|
-
return (0, convert_1.convert)(source => source.trimEnd(), parser, false);
|
|
3135
|
-
}
|
|
3136
|
-
exports.trimEnd = trimEnd;
|
|
3137
|
-
|
|
3138
|
-
/***/ },
|
|
3139
|
-
|
|
3140
3112
|
/***/ 994
|
|
3141
3113
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
3142
3114
|
|
|
@@ -3449,13 +3421,13 @@ function matcher(pattern, advance) {
|
|
|
3449
3421
|
position
|
|
3450
3422
|
} = context;
|
|
3451
3423
|
pattern.lastIndex = position;
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
count && consume(
|
|
3424
|
+
if (!pattern.test(source)) return;
|
|
3425
|
+
const src = source.slice(position, pattern.lastIndex);
|
|
3426
|
+
count && consume(src.length, context);
|
|
3455
3427
|
if (advance) {
|
|
3456
|
-
context.position +=
|
|
3428
|
+
context.position += src.length;
|
|
3457
3429
|
}
|
|
3458
|
-
return [[
|
|
3430
|
+
return [[src]];
|
|
3459
3431
|
};
|
|
3460
3432
|
}
|
|
3461
3433
|
}
|
|
@@ -4354,6 +4326,8 @@ exports.block = (0, combinator_1.reset)({
|
|
|
4354
4326
|
return (0, pagebreak_1.pagebreak)(input);
|
|
4355
4327
|
case '~~~':
|
|
4356
4328
|
return (0, extension_1.extension)(input);
|
|
4329
|
+
case '```':
|
|
4330
|
+
return (0, codeblock_1.codeblock)(input);
|
|
4357
4331
|
}
|
|
4358
4332
|
switch (source.slice(position, position + 2)) {
|
|
4359
4333
|
case '$$':
|
|
@@ -4379,8 +4353,6 @@ exports.block = (0, combinator_1.reset)({
|
|
|
4379
4353
|
return (0, heading_1.heading)(input);
|
|
4380
4354
|
case '|':
|
|
4381
4355
|
return (0, table_1.table)(input) || (0, sidefence_1.sidefence)(input);
|
|
4382
|
-
case '`':
|
|
4383
|
-
return (0, codeblock_1.codeblock)(input);
|
|
4384
4356
|
case '$':
|
|
4385
4357
|
return (0, extension_1.extension)(input);
|
|
4386
4358
|
case '>':
|
|
@@ -4430,7 +4402,7 @@ const autolink_1 = __webpack_require__(1671);
|
|
|
4430
4402
|
const source_1 = __webpack_require__(8745);
|
|
4431
4403
|
const parse_1 = __webpack_require__(3662);
|
|
4432
4404
|
const dom_1 = __webpack_require__(394);
|
|
4433
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.
|
|
4405
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(/!?>+(?=[^\S\n]|\n[^\S\n]*\S)/y, (0, combinator_1.some)(source_1.contentline))]));
|
|
4434
4406
|
exports.blockquote = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.union)([(0, combinator_1.open)(/(?=>)/y, source), (0, combinator_1.open)(/!(?=>)/y, markdown)]))));
|
|
4435
4407
|
const opener = /(?=>>+(?:$|\s))/y;
|
|
4436
4408
|
const indent = (0, combinator_1.block)((0, combinator_1.open)(opener, (0, combinator_1.some)(source_1.contentline, />(?:$|\s)/y)), false);
|
|
@@ -4474,9 +4446,9 @@ const util_1 = __webpack_require__(4992);
|
|
|
4474
4446
|
const dom_1 = __webpack_require__(394);
|
|
4475
4447
|
const opener = /(`{3,})(?!`)([^\n]*)(?:$|\n)/y;
|
|
4476
4448
|
const language = /^[0-9a-z]+(?:-[a-z][0-9a-z]*)*$/i;
|
|
4477
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.
|
|
4478
|
-
exports.segment_ = (0, combinator_1.block)((0, combinator_1.
|
|
4479
|
-
exports.codeblock = (0, combinator_1.block)((0, combinator_1.
|
|
4449
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300)));
|
|
4450
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false)), false);
|
|
4451
|
+
exports.codeblock = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
|
|
4480
4452
|
// Bug: Type mismatch between outer and inner.
|
|
4481
4453
|
([body, overflow, closer, opener, delim, param], context) => {
|
|
4482
4454
|
const params = param.match(/(?:\\.?|\S)+/g)?.reduce((params, value, i) => {
|
|
@@ -4514,7 +4486,7 @@ exports.codeblock = (0, combinator_1.block)((0, combinator_1.validate)('```', (0
|
|
|
4514
4486
|
...context
|
|
4515
4487
|
})), [])));
|
|
4516
4488
|
return [el];
|
|
4517
|
-
}))
|
|
4489
|
+
}));
|
|
4518
4490
|
|
|
4519
4491
|
/***/ },
|
|
4520
4492
|
|
|
@@ -4531,7 +4503,6 @@ exports.dlist = void 0;
|
|
|
4531
4503
|
const combinator_1 = __webpack_require__(3484);
|
|
4532
4504
|
const inline_1 = __webpack_require__(7973);
|
|
4533
4505
|
const source_1 = __webpack_require__(8745);
|
|
4534
|
-
const util_1 = __webpack_require__(4992);
|
|
4535
4506
|
const visibility_1 = __webpack_require__(6364);
|
|
4536
4507
|
const array_1 = __webpack_require__(6876);
|
|
4537
4508
|
const dom_1 = __webpack_require__(394);
|
|
@@ -4539,7 +4510,7 @@ exports.dlist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combina
|
|
|
4539
4510
|
const term = (0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.open)(/~[^\S\n]+(?=\S)/y, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), ns => [(0, dom_1.html)('dt', {
|
|
4540
4511
|
'data-index': (0, inline_1.dataindex)(ns)
|
|
4541
4512
|
}, (0, dom_1.defrag)(ns))])));
|
|
4542
|
-
const desc = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)(/:[^\S\n]+(?=\S)|/y, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, /[~:][^\S\n]+\S/y), (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0,
|
|
4513
|
+
const desc = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)(/:[^\S\n]+(?=\S)|/y, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, /[~:][^\S\n]+\S/y), (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('dd', (0, dom_1.defrag)(ns))]), false);
|
|
4543
4514
|
function fillTrailingDescription(es) {
|
|
4544
4515
|
return es.length > 0 && es.at(-1).tagName === 'DT' ? (0, array_1.push)(es, [(0, dom_1.html)('dd')]) : es;
|
|
4545
4516
|
}
|
|
@@ -4565,7 +4536,7 @@ const message_1 = __webpack_require__(3949);
|
|
|
4565
4536
|
const aside_1 = __webpack_require__(6150);
|
|
4566
4537
|
const example_1 = __webpack_require__(6624);
|
|
4567
4538
|
const placeholder_1 = __webpack_require__(4091);
|
|
4568
|
-
exports.segment = (0, combinator_1.
|
|
4539
|
+
exports.segment = (0, combinator_1.union)([fig_1.segment, figure_1.segment, table_1.segment, placeholder_1.segment]);
|
|
4569
4540
|
exports.extension = (0, combinator_1.union)([figbase_1.figbase, fig_1.fig, figure_1.figure, table_1.table, message_1.message, aside_1.aside, example_1.example, placeholder_1.placeholder]);
|
|
4570
4541
|
|
|
4571
4542
|
/***/ },
|
|
@@ -4585,7 +4556,7 @@ const indexee_1 = __webpack_require__(7610);
|
|
|
4585
4556
|
const util_1 = __webpack_require__(4992);
|
|
4586
4557
|
const parse_1 = __webpack_require__(3662);
|
|
4587
4558
|
const dom_1 = __webpack_require__(394);
|
|
4588
|
-
exports.aside = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.
|
|
4559
|
+
exports.aside = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})aside(?!\S)([^\n]*)(?:$|\n)/y, 300),
|
|
4589
4560
|
// Bug: Type mismatch between outer and inner.
|
|
4590
4561
|
([body, overflow, closer, opener, delim, param], context) => {
|
|
4591
4562
|
if (!closer || overflow || param.trimStart()) return [(0, dom_1.html)('pre', {
|
|
@@ -4612,7 +4583,7 @@ exports.aside = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combina
|
|
|
4612
4583
|
id: (0, indexee_1.identity)('index', context.id, heading),
|
|
4613
4584
|
class: 'aside'
|
|
4614
4585
|
}, [document, (0, dom_1.html)('h2', 'References'), references])];
|
|
4615
|
-
})))
|
|
4586
|
+
})));
|
|
4616
4587
|
|
|
4617
4588
|
/***/ },
|
|
4618
4589
|
|
|
@@ -4633,7 +4604,7 @@ const util_1 = __webpack_require__(4992);
|
|
|
4633
4604
|
const parse_1 = __webpack_require__(3662);
|
|
4634
4605
|
const dom_1 = __webpack_require__(394);
|
|
4635
4606
|
const opener = /(~{3,})(?:example\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/y;
|
|
4636
|
-
exports.example = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.
|
|
4607
|
+
exports.example = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
|
|
4637
4608
|
// Bug: Type mismatch between outer and inner.
|
|
4638
4609
|
([body, overflow, closer, opener, delim, type = 'markdown', param], context) => {
|
|
4639
4610
|
if (!closer || overflow || param.trimStart()) return [(0, dom_1.html)('pre', {
|
|
@@ -4676,7 +4647,7 @@ exports.example = (0, combinator_1.recursion)(1 /* Recursion.block */, (0, combi
|
|
|
4676
4647
|
...(0, util_1.invalid)('example', 'type', 'Invalid example type')
|
|
4677
4648
|
}, `${opener}${body}${closer}`)];
|
|
4678
4649
|
}
|
|
4679
|
-
})))
|
|
4650
|
+
})));
|
|
4680
4651
|
|
|
4681
4652
|
/***/ },
|
|
4682
4653
|
|
|
@@ -4708,7 +4679,7 @@ exports.fig = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment,
|
|
|
4708
4679
|
context
|
|
4709
4680
|
}) ? `${fence}figure ${source.replace(/^(.+\n.+\n)([\S\s]+?)\n?$/, '$1\n$2')}\n${fence}` : `${fence}figure ${source}\n\n${fence}`;
|
|
4710
4681
|
}, (0, combinator_1.union)([figure_1.figure]), false), ([el]) => el.tagName === 'FIGURE')));
|
|
4711
|
-
const parser = (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /(?=\s).*\n/y)), (0, combinator_1.line)((0, combinator_1.union)([inline_1.media, inline_1.
|
|
4682
|
+
const parser = (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /(?=\s).*\n/y)), (0, combinator_1.line)((0, combinator_1.union)([inline_1.media, inline_1.lineshortmedia])), (0, combinator_1.some)(source_1.contentline)]);
|
|
4712
4683
|
|
|
4713
4684
|
/***/ },
|
|
4714
4685
|
|
|
@@ -4768,7 +4739,7 @@ const dom_1 = __webpack_require__(394);
|
|
|
4768
4739
|
exports.segment = (0, combinator_1.block)((0, combinator_1.match)(/(~{3,})(?:figure[^\S\n])?(?=\[?\$)/y, (0, memoize_1.memoize)(([, fence], closer = new RegExp(String.raw`${fence}[^\S\n]*(?:$|\n)`, 'y')) => (0, combinator_1.close)((0, combinator_1.sequence)([source_1.contentline, (0, combinator_1.inits)([
|
|
4769
4740
|
// All parsers which can include closing terms.
|
|
4770
4741
|
(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, {})));
|
|
4771
|
-
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/y)])), (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.
|
|
4742
|
+
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/y)])), (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.lineshortmedia)])), source_1.emptyline, (0, combinator_1.block)((0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))))])]), false), ([label, param, content, ...caption]) => [(0, dom_1.html)('figure', attributes(label.getAttribute('data-label'), param, content, caption), [(0, dom_1.html)('figcaption', [(0, dom_1.html)('span', {
|
|
4772
4743
|
class: 'figindex'
|
|
4773
4744
|
}), (0, dom_1.html)('span', {
|
|
4774
4745
|
class: 'figtext'
|
|
@@ -4849,7 +4820,7 @@ const paragraph_1 = __webpack_require__(4330);
|
|
|
4849
4820
|
const util_1 = __webpack_require__(4992);
|
|
4850
4821
|
const array_1 = __webpack_require__(6876);
|
|
4851
4822
|
const dom_1 = __webpack_require__(394);
|
|
4852
|
-
exports.message = (0, combinator_1.block)((0, combinator_1.
|
|
4823
|
+
exports.message = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})message\/(\S+)([^\n]*)(?:$|\n)/y, 300),
|
|
4853
4824
|
// Bug: Type mismatch between outer and inner.
|
|
4854
4825
|
([body, overflow, closer, opener, delim, type, param], context) => {
|
|
4855
4826
|
if (!closer || overflow || param.trimStart()) return [(0, dom_1.html)('pre', {
|
|
@@ -4875,7 +4846,7 @@ exports.message = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0,
|
|
|
4875
4846
|
}, (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((0, parser_1.input)(seg, {
|
|
4876
4847
|
...context
|
|
4877
4848
|
})), [])), [])))];
|
|
4878
|
-
}))
|
|
4849
|
+
}));
|
|
4879
4850
|
function title(type) {
|
|
4880
4851
|
switch (type) {
|
|
4881
4852
|
case 'warning':
|
|
@@ -4905,13 +4876,13 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
4905
4876
|
const util_1 = __webpack_require__(4992);
|
|
4906
4877
|
const dom_1 = __webpack_require__(394);
|
|
4907
4878
|
const opener = /(~{3,})(?!~)[^\n]*(?:$|\n)/y;
|
|
4908
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.
|
|
4909
|
-
exports.segment_ = (0, combinator_1.block)((0, combinator_1.
|
|
4910
|
-
exports.placeholder = (0, combinator_1.block)((0, combinator_1.
|
|
4879
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300)));
|
|
4880
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false)), false);
|
|
4881
|
+
exports.placeholder = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, Infinity), ([body, overflow, closer, opener, delim]) => [(0, dom_1.html)('pre', {
|
|
4911
4882
|
class: 'invalid',
|
|
4912
4883
|
translate: 'no',
|
|
4913
4884
|
...(0, util_1.invalid)('extension', 'fence', !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument')
|
|
4914
|
-
}, `${opener}${body}${overflow || closer}`)]))
|
|
4885
|
+
}, `${opener}${body}${overflow || closer}`)]));
|
|
4915
4886
|
|
|
4916
4887
|
/***/ },
|
|
4917
4888
|
|
|
@@ -4935,9 +4906,9 @@ const visibility_1 = __webpack_require__(6364);
|
|
|
4935
4906
|
const array_1 = __webpack_require__(6876);
|
|
4936
4907
|
const dom_1 = __webpack_require__(394);
|
|
4937
4908
|
const opener = /(~{3,})table(?:\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/y;
|
|
4938
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.
|
|
4939
|
-
exports.segment_ = (0, combinator_1.block)((0, combinator_1.
|
|
4940
|
-
exports.table = (0, combinator_1.block)((0, combinator_1.
|
|
4909
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 10000)));
|
|
4910
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 10000, false)), false);
|
|
4911
|
+
exports.table = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 10000),
|
|
4941
4912
|
// Bug: Type mismatch between outer and inner.
|
|
4942
4913
|
([body, overflow, closer, opener, delim, type, param], context) => {
|
|
4943
4914
|
if (!closer || overflow || param.trimStart()) return [(0, dom_1.html)('pre', {
|
|
@@ -4960,14 +4931,14 @@ exports.table = (0, combinator_1.block)((0, combinator_1.validate)('~~~', (0, co
|
|
|
4960
4931
|
...(0, util_1.invalid)('table', 'argument', 'Invalid table type')
|
|
4961
4932
|
}, `${opener}${body}${closer}`)];
|
|
4962
4933
|
}
|
|
4963
|
-
}))
|
|
4934
|
+
}));
|
|
4964
4935
|
const parser = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([row])), rows => [(0, dom_1.html)('table', format(rows))])));
|
|
4965
4936
|
const row = (0, combinator_1.lazy)(() => (0, combinator_1.dup)((0, combinator_1.fmap)((0, combinator_1.subsequence)([(0, combinator_1.dup)((0, combinator_1.union)([align])), (0, combinator_1.some)((0, combinator_1.union)([head, data, (0, combinator_1.some)(dataline, alignment), source_1.emptyline]))]), ns => !(0, alias_1.isArray)(ns[0]) ? (0, array_1.unshift)([[[]]], ns) : ns)));
|
|
4966
4937
|
const alignment = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)/y;
|
|
4967
4938
|
const align = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.union)([(0, source_1.str)(alignment)]), ([s]) => s.split('/').map(s => s.split(''))));
|
|
4968
4939
|
const delimiter = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|[#:](?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/y;
|
|
4969
|
-
const head = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/y), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(
|
|
4970
|
-
const data = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/y), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(
|
|
4940
|
+
const head = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/y), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/\s/y, (0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia]), /\s*$/y)), (0, combinator_1.open)(/(?:[^\S\n]*\n|\s)/y, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => [(0, dom_1.html)('th', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false);
|
|
4941
|
+
const data = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=\s)/y), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/\s/y, (0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia]), /\s*$/y)), (0, combinator_1.open)(/(?:[^\S\n]*\n|\s)/y, (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => [(0, dom_1.html)('td', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false);
|
|
4971
4942
|
const dataline = (0, combinator_1.line)((0, combinator_1.rewrite)(source_1.contentline, (0, combinator_1.union)([(0, combinator_1.validate)(/!+\s/y, (0, combinator_1.convert)(source => `:${source}`, data, false)), (0, combinator_1.convert)(source => `: ${source}`, data, false)])));
|
|
4972
4943
|
function attributes(source) {
|
|
4973
4944
|
let [, rowspan = undefined, colspan = undefined, highlight = undefined, extension = undefined] = source.match(/^[#:](?:(\d+)?:(\d+)?)?(?:(!+)([+]?))?$/) ?? [];
|
|
@@ -5219,7 +5190,7 @@ const visibility_1 = __webpack_require__(6364);
|
|
|
5219
5190
|
const util_1 = __webpack_require__(4992);
|
|
5220
5191
|
const dom_1 = __webpack_require__(394);
|
|
5221
5192
|
exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/[-+*] /y, exports.ilist_)));
|
|
5222
|
-
exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/[-+*](?:$|[ \n])/y, (0, combinator_1.some)((0, combinator_1.recursion)(3 /* Recursion.listitem */, (0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/[-+*](?:$|[ \n])/y, (0,
|
|
5193
|
+
exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/[-+*](?:$|[ \n])/y, (0, combinator_1.some)((0, combinator_1.recursion)(3 /* Recursion.listitem */, (0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/[-+*](?:$|[ \n])/y, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), exports.ilistitem), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])])))), es => [(0, dom_1.html)('ul', {
|
|
5223
5194
|
class: 'invalid',
|
|
5224
5195
|
...(0, util_1.invalid)('list', 'syntax', 'Use "-" instead of "+" or "*"')
|
|
5225
5196
|
}, es)])));
|
|
@@ -5252,9 +5223,9 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
5252
5223
|
const util_1 = __webpack_require__(4992);
|
|
5253
5224
|
const dom_1 = __webpack_require__(394);
|
|
5254
5225
|
const opener = /(\${2,})(?!\$)([^\n]*)(?:$|\n)/y;
|
|
5255
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.
|
|
5256
|
-
exports.segment_ = (0, combinator_1.block)((0, combinator_1.
|
|
5257
|
-
exports.mathblock = (0, combinator_1.block)((0, combinator_1.
|
|
5226
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300)));
|
|
5227
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.clear)((0, combinator_1.fence)(opener, 300, false)), false);
|
|
5228
|
+
exports.mathblock = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(opener, 300),
|
|
5258
5229
|
// Bug: Type mismatch between outer and inner.
|
|
5259
5230
|
([body, overflow, closer, opener, delim, param], {
|
|
5260
5231
|
caches: {
|
|
@@ -5267,7 +5238,7 @@ exports.mathblock = (0, combinator_1.block)((0, combinator_1.validate)('$$', (0,
|
|
|
5267
5238
|
class: 'invalid',
|
|
5268
5239
|
translate: 'no',
|
|
5269
5240
|
...(0, util_1.invalid)('mathblock', delim.length > 2 ? 'syntax' : !closer || overflow ? 'fence' : 'argument', delim.length > 2 ? 'Invalid syntax' : !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument')
|
|
5270
|
-
}, `${opener}${body}${overflow || closer}`)]))
|
|
5241
|
+
}, `${opener}${body}${overflow || closer}`)]));
|
|
5271
5242
|
|
|
5272
5243
|
/***/ },
|
|
5273
5244
|
|
|
@@ -5285,14 +5256,14 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
5285
5256
|
const inline_1 = __webpack_require__(7973);
|
|
5286
5257
|
const util_1 = __webpack_require__(4992);
|
|
5287
5258
|
const dom_1 = __webpack_require__(394);
|
|
5288
|
-
exports.mediablock = (0, combinator_1.block)((0, combinator_1.
|
|
5259
|
+
exports.mediablock = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia])), (0, combinator_1.some)((0, combinator_1.line)((0, combinator_1.fallback)((0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia]), ({
|
|
5289
5260
|
context: {
|
|
5290
5261
|
source
|
|
5291
5262
|
}
|
|
5292
5263
|
}) => [[(0, dom_1.html)('span', {
|
|
5293
5264
|
class: 'invalid',
|
|
5294
5265
|
...(0, util_1.invalid)('mediablock', 'syntax', 'Not media syntax')
|
|
5295
|
-
}, source.replace('\n', ''))]])))]), ns => [(0, dom_1.html)('div', ns)]))
|
|
5266
|
+
}, source.replace('\n', ''))]])))]), ns => [(0, dom_1.html)('div', ns)]));
|
|
5296
5267
|
|
|
5297
5268
|
/***/ },
|
|
5298
5269
|
|
|
@@ -5320,7 +5291,7 @@ const openers = {
|
|
|
5320
5291
|
};
|
|
5321
5292
|
exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(new RegExp([/([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*\. /y.source, /\(([0-9]+|[a-z]+)\)(?:-[0-9]+)* /y.source].join('|'), 'y'), exports.olist_)));
|
|
5322
5293
|
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 => idx(ms[1]), [])), (0, combinator_1.match)(openers['('], (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => idx(ms[1]), []))])));
|
|
5323
|
-
const list = (type, form) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(3 /* Recursion.listitem */, (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,
|
|
5294
|
+
const list = (type, form) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(3 /* Recursion.listitem */, (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, visibility_1.visualize)((0, visibility_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_]))]), ilist_1.ilistitem), ns => [(0, dom_1.html)('li', {
|
|
5324
5295
|
'data-index': (0, inline_1.dataindex)(ns),
|
|
5325
5296
|
'data-marker': ns.shift() || undefined
|
|
5326
5297
|
}, (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))]))]))), es => [format((0, dom_1.html)('ol', es), type, form)]);
|
|
@@ -5454,10 +5425,9 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
5454
5425
|
exports.paragraph = void 0;
|
|
5455
5426
|
const combinator_1 = __webpack_require__(3484);
|
|
5456
5427
|
const inline_1 = __webpack_require__(7973);
|
|
5457
|
-
const util_1 = __webpack_require__(4992);
|
|
5458
5428
|
const visibility_1 = __webpack_require__(6364);
|
|
5459
5429
|
const dom_1 = __webpack_require__(394);
|
|
5460
|
-
exports.paragraph = (0, combinator_1.block)((0, combinator_1.fmap)((0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0,
|
|
5430
|
+
exports.paragraph = (0, combinator_1.block)((0, combinator_1.fmap)((0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline])))), ns => [(0, dom_1.html)('p', (0, dom_1.defrag)(ns))]));
|
|
5461
5431
|
|
|
5462
5432
|
/***/ },
|
|
5463
5433
|
|
|
@@ -5500,7 +5470,7 @@ const source_1 = __webpack_require__(8745);
|
|
|
5500
5470
|
const util_1 = __webpack_require__(4992);
|
|
5501
5471
|
const dom_1 = __webpack_require__(394);
|
|
5502
5472
|
exports.syntax = />*(?=>>[^>\s]\S*[^\S\n]*(?:$|\n))/y;
|
|
5503
|
-
exports.cite = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.
|
|
5473
|
+
exports.cite = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(exports.syntax), (0, combinator_1.union)([anchor_1.anchor,
|
|
5504
5474
|
// Subject page representation.
|
|
5505
5475
|
// リンクの実装は後で検討
|
|
5506
5476
|
(0, combinator_1.focus)(/>>#\S*(?=\s*$)/y, ({
|
|
@@ -5521,7 +5491,7 @@ exports.cite = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.va
|
|
|
5521
5491
|
context: {
|
|
5522
5492
|
source
|
|
5523
5493
|
}
|
|
5524
|
-
}) => [[source]])]))
|
|
5494
|
+
}) => [[source]])])), ([quotes, node]) => [(0, dom_1.html)('span', typeof node === 'object' ? {
|
|
5525
5495
|
class: 'cite'
|
|
5526
5496
|
} : {
|
|
5527
5497
|
class: 'cite invalid',
|
|
@@ -5549,9 +5519,9 @@ const source_1 = __webpack_require__(8745);
|
|
|
5549
5519
|
const util_1 = __webpack_require__(4992);
|
|
5550
5520
|
const dom_1 = __webpack_require__(394);
|
|
5551
5521
|
exports.syntax = />+[^\S\n]/y;
|
|
5552
|
-
exports.quote = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.
|
|
5522
|
+
exports.quote = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.some)((0, combinator_1.validate)(exports.syntax, source_1.anyline)), (0, util_1.linearize)((0, combinator_1.convert)(source => source.replace(/(?<=^>+[^\S\n])/mg, '\r'), (0, combinator_1.some)((0, combinator_1.union)([
|
|
5553
5523
|
// quote補助関数が残した数式をパースする。
|
|
5554
|
-
math_1.math, autolink_1.autolink, source_1.linebreak, source_1.unescsource])), false), -1))
|
|
5524
|
+
math_1.math, autolink_1.autolink, source_1.linebreak, source_1.unescsource])), false), -1)), ns => [(0, dom_1.html)('span', {
|
|
5555
5525
|
class: 'quote'
|
|
5556
5526
|
}, (0, dom_1.defrag)(ns)), (0, dom_1.html)('br')]), false));
|
|
5557
5527
|
|
|
@@ -5572,13 +5542,13 @@ const autolink_1 = __webpack_require__(1671);
|
|
|
5572
5542
|
const source_1 = __webpack_require__(8745);
|
|
5573
5543
|
const util_1 = __webpack_require__(4992);
|
|
5574
5544
|
const dom_1 = __webpack_require__(394);
|
|
5575
|
-
exports.sidefence = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.focus)(/(?=\|+(?:[^\S\n]|\n\|))(?:\|+(?:[^\S\n][^\n]*)?(?:$|\n))+$/y, (0, combinator_1.union)([source])
|
|
5545
|
+
exports.sidefence = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.focus)(/(?=\|+(?:[^\S\n]|\n\|))(?:\|+(?:[^\S\n][^\n]*)?(?:$|\n))+$/y, (0, combinator_1.union)([source])), ([el]) => [(0, dom_1.define)(el, {
|
|
5576
5546
|
class: 'invalid',
|
|
5577
5547
|
...(0, util_1.invalid)('sidefence', 'syntax', 'Reserved syntax')
|
|
5578
5548
|
})])));
|
|
5579
5549
|
const opener = /(?=\|\|+(?:$|\s))/y;
|
|
5580
5550
|
const unindent = source => source.replace(/(?<=^|\n)\|(?:[^\S\n]|(?=\|*(?:$|\s)))|\n$/g, '');
|
|
5581
|
-
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.union)([(0, combinator_1.focus)(/(?:\|\|+(?:[^\S\n][^\n]*)?(?:$|\n))+/y, (0, combinator_1.convert)(unindent, source, false, true)
|
|
5551
|
+
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.union)([(0, combinator_1.focus)(/(?:\|\|+(?:[^\S\n][^\n]*)?(?:$|\n))+/y, (0, combinator_1.convert)(unindent, source, false, true)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)(autolink_1.autolink, ns => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))]), false, true))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
|
|
5582
5552
|
|
|
5583
5553
|
/***/ },
|
|
5584
5554
|
|
|
@@ -5613,12 +5583,12 @@ const align = (0, combinator_1.fmap)((0, combinator_1.open)('|', (0, combinator_
|
|
|
5613
5583
|
context: {
|
|
5614
5584
|
source
|
|
5615
5585
|
}
|
|
5616
|
-
}) => [[source.at(-1) === ':' ? 'center' : 'start']]
|
|
5586
|
+
}) => [[source.at(-1) === ':' ? 'center' : 'start']]), (0, combinator_1.focus)(/-+:?/y, ({
|
|
5617
5587
|
context: {
|
|
5618
5588
|
source
|
|
5619
5589
|
}
|
|
5620
|
-
}) => [[source.at(-1) === ':' ? 'end' : '']]
|
|
5621
|
-
const cell = (0, combinator_1.surround)(/\|\s*(?=\S)/y, (0, combinator_1.
|
|
5590
|
+
}) => [[source.at(-1) === ':' ? 'end' : '']])])), ns => [(0, dom_1.html)('td', (0, dom_1.defrag)(ns))]);
|
|
5591
|
+
const cell = (0, combinator_1.surround)(/\|\s*(?=\S)/y, (0, combinator_1.union)([(0, combinator_1.close)(inline_1.medialink, /\s*(?=\||$)/y), (0, combinator_1.close)(inline_1.media, /\s*(?=\||$)/y), (0, combinator_1.close)(inline_1.shortmedia, /\s*(?=\||$)/y), (0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline, /\|/y, [[/[|\\]?\s*$/y, 9]]))]), /[^|]*/y, true);
|
|
5622
5592
|
const head = (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('th', (0, dom_1.defrag)(ns))]);
|
|
5623
5593
|
const data = (0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('td', (0, dom_1.defrag)(ns))]);
|
|
5624
5594
|
function format(rows) {
|
|
@@ -5651,12 +5621,11 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
5651
5621
|
const olist_1 = __webpack_require__(7697);
|
|
5652
5622
|
const ilist_1 = __webpack_require__(4223);
|
|
5653
5623
|
const inline_1 = __webpack_require__(7973);
|
|
5654
|
-
const util_1 = __webpack_require__(4992);
|
|
5655
5624
|
const visibility_1 = __webpack_require__(6364);
|
|
5656
5625
|
const array_1 = __webpack_require__(6876);
|
|
5657
5626
|
const dom_1 = __webpack_require__(394);
|
|
5658
5627
|
exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/- /y, exports.ulist_)));
|
|
5659
|
-
exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/-(?=$|[ \n])/y, (0, combinator_1.some)((0, combinator_1.recursion)(3 /* Recursion.listitem */, (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)(/-(?:$|[ \n])/y, (0, combinator_1.subsequence)([exports.checkbox, (0,
|
|
5628
|
+
exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/-(?=$|[ \n])/y, (0, combinator_1.some)((0, combinator_1.recursion)(3 /* Recursion.listitem */, (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)(/-(?:$|[ \n])/y, (0, combinator_1.subsequence)([exports.checkbox, (0, visibility_1.visualize)((0, visibility_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_]))]), ilist_1.ilistitem), ns => [(0, dom_1.html)('li', {
|
|
5660
5629
|
'data-index': (0, inline_1.dataindex)(ns)
|
|
5661
5630
|
}, (0, dom_1.defrag)(fillFirstLine(ns)))]))])))), es => [format((0, dom_1.html)('ul', es))])));
|
|
5662
5631
|
exports.checkbox = (0, combinator_1.focus)(/\[[xX ]\](?=$|[ \n])/y, ({
|
|
@@ -5757,7 +5726,7 @@ const field = (0, combinator_1.line)(({
|
|
|
5757
5726
|
Object.defineProperty(exports, "__esModule", ({
|
|
5758
5727
|
value: true
|
|
5759
5728
|
}));
|
|
5760
|
-
exports.shortmedia = exports.media = exports.medialink = exports.dataindex = exports.indexer = exports.indexee = exports.inline = void 0;
|
|
5729
|
+
exports.lineshortmedia = exports.shortmedia = exports.media = exports.medialink = exports.dataindex = exports.indexer = exports.indexee = exports.inline = void 0;
|
|
5761
5730
|
const combinator_1 = __webpack_require__(3484);
|
|
5762
5731
|
const annotation_1 = __webpack_require__(4045);
|
|
5763
5732
|
const reference_1 = __webpack_require__(9047);
|
|
@@ -5791,19 +5760,19 @@ exports.inline = (0, combinator_1.lazy)(() => (0, combinator_1.union)([input =>
|
|
|
5791
5760
|
if (position === source.length) return;
|
|
5792
5761
|
switch (source.slice(position, position + 2)) {
|
|
5793
5762
|
case '((':
|
|
5794
|
-
return (0, annotation_1.annotation)(input);
|
|
5763
|
+
return (0, annotation_1.annotation)(input) || (0, bracket_1.bracket)(input);
|
|
5795
5764
|
case '[[':
|
|
5796
|
-
return (0, reference_1.reference)(input) || (0, link_1.textlink)(input);
|
|
5765
|
+
return (0, reference_1.reference)(input) || (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
|
|
5797
5766
|
case '{{':
|
|
5798
|
-
return (0, template_1.template)(input);
|
|
5767
|
+
return (0, template_1.template)(input) || (0, bracket_1.bracket)(input);
|
|
5799
5768
|
case '[%':
|
|
5800
|
-
return (0, remark_1.remark)(input) || (0, link_1.textlink)(input);
|
|
5769
|
+
return (0, remark_1.remark)(input) || (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
|
|
5801
5770
|
case '[#':
|
|
5802
5771
|
case '[$':
|
|
5803
5772
|
case '[:':
|
|
5804
5773
|
case '[^':
|
|
5805
5774
|
case '[|':
|
|
5806
|
-
return (0, extension_1.extension)(input) || (0, link_1.textlink)(input);
|
|
5775
|
+
return (0, extension_1.extension)(input) || (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
|
|
5807
5776
|
case '${':
|
|
5808
5777
|
return (0, math_1.math)(input);
|
|
5809
5778
|
case '++':
|
|
@@ -5819,9 +5788,9 @@ exports.inline = (0, combinator_1.lazy)(() => (0, combinator_1.union)([input =>
|
|
|
5819
5788
|
}
|
|
5820
5789
|
switch (source[position]) {
|
|
5821
5790
|
case '[':
|
|
5822
|
-
return (0, link_1.textlink)(input) || (0, ruby_1.ruby)(input);
|
|
5791
|
+
return (0, link_1.textlink)(input) || (0, ruby_1.ruby)(input) || (0, bracket_1.bracket)(input);
|
|
5823
5792
|
case '{':
|
|
5824
|
-
return (0, link_1.textlink)(input);
|
|
5793
|
+
return (0, link_1.textlink)(input) || (0, bracket_1.bracket)(input);
|
|
5825
5794
|
case '<':
|
|
5826
5795
|
return (0, html_1.html)(input);
|
|
5827
5796
|
case '$':
|
|
@@ -5832,8 +5801,14 @@ exports.inline = (0, combinator_1.lazy)(() => (0, combinator_1.union)([input =>
|
|
|
5832
5801
|
return (0, emphasis_1.emphasis)(input) || stars(input);
|
|
5833
5802
|
case '&':
|
|
5834
5803
|
return (0, htmlentity_1.htmlentity)(input);
|
|
5835
|
-
|
|
5836
|
-
|
|
5804
|
+
case '(':
|
|
5805
|
+
case '(':
|
|
5806
|
+
case '[':
|
|
5807
|
+
case '{':
|
|
5808
|
+
case '"':
|
|
5809
|
+
return (0, bracket_1.bracket)(input);
|
|
5810
|
+
}
|
|
5811
|
+
}, autolink_1.autolink, source_1.text]));
|
|
5837
5812
|
var indexee_1 = __webpack_require__(7610);
|
|
5838
5813
|
Object.defineProperty(exports, "indexee", ({
|
|
5839
5814
|
enumerable: true,
|
|
@@ -5876,6 +5851,12 @@ Object.defineProperty(exports, "shortmedia", ({
|
|
|
5876
5851
|
return shortmedia_1.shortmedia;
|
|
5877
5852
|
}
|
|
5878
5853
|
}));
|
|
5854
|
+
Object.defineProperty(exports, "lineshortmedia", ({
|
|
5855
|
+
enumerable: true,
|
|
5856
|
+
get: function () {
|
|
5857
|
+
return shortmedia_1.lineshortmedia;
|
|
5858
|
+
}
|
|
5859
|
+
}));
|
|
5879
5860
|
|
|
5880
5861
|
/***/ },
|
|
5881
5862
|
|
|
@@ -5895,7 +5876,7 @@ const visibility_1 = __webpack_require__(6364);
|
|
|
5895
5876
|
const dom_1 = __webpack_require__(394);
|
|
5896
5877
|
exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(128 /* State.annotation */, (0, combinator_1.surround)('((', (0, combinator_1.precedence)(1, (0, combinator_1.state)(128 /* State.annotation */, (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[')', 1]])))), '))', false, ([, ns], context) => context.linebreak === 0 ? [[(0, dom_1.html)('sup', {
|
|
5897
5878
|
class: 'annotation'
|
|
5898
|
-
}, [(0, dom_1.html)('span', (0, dom_1.defrag)((0, visibility_1.trimBlankNodeEnd)(ns)))])]] : undefined, undefined, [
|
|
5879
|
+
}, [(0, dom_1.html)('span', (0, dom_1.defrag)((0, visibility_1.trimBlankNodeEnd)(ns)))])]] : undefined, undefined, [1 | 64 /* Backtrack.bracket */, 3 | 32 /* Backtrack.doublebracket */])));
|
|
5899
5880
|
|
|
5900
5881
|
/***/ },
|
|
5901
5882
|
|
|
@@ -5920,7 +5901,7 @@ const anchor_1 = __webpack_require__(8535);
|
|
|
5920
5901
|
const source_1 = __webpack_require__(8745);
|
|
5921
5902
|
exports.autolink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(new RegExp([/(?<![0-9a-z])@/yi.source, /(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yiu.source, /(?<![0-9a-z])>>/yi.source, /(?<![0-9a-z][.+-]?)!?[0-9a-z]/yi.source].join('|').replace(/emoji/g, hashtag_1.emoji), 'yiu'), (0, combinator_1.state)(~1 /* State.autolink */, (0, combinator_1.union)([url_1.lineurl, url_1.url, email_1.email,
|
|
5922
5903
|
// Escape unmatched email-like strings.
|
|
5923
|
-
(0, source_1.str)(/[0-9a-z]+(?:[_.+-][0-9a-z]
|
|
5904
|
+
(0, source_1.str)(/[0-9a-z]+(?:[_.+-][0-9a-z]+[:@]?|:|@(?=@))*/yi), channel_1.channel, account_1.account,
|
|
5924
5905
|
// Escape unmatched account-like strings.
|
|
5925
5906
|
(0, source_1.str)(/@+(?:[0-9a-z]+(?:[_.+-][0-9a-z]+)*)?/yi), hashtag_1.hashtag, hashnum_1.hashnum,
|
|
5926
5907
|
// Escape unmatched hashtag-like strings.
|
|
@@ -6114,9 +6095,7 @@ exports.lineurl = exports.url = void 0;
|
|
|
6114
6095
|
const combinator_1 = __webpack_require__(3484);
|
|
6115
6096
|
const link_1 = __webpack_require__(3628);
|
|
6116
6097
|
const source_1 = __webpack_require__(8745);
|
|
6117
|
-
exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9a-z][.+-]?)https?:\/\/(?=[\x21-\x7E])/y, (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.verify)(bracket, ns => ns.length > 0),
|
|
6118
|
-
// 再帰に注意
|
|
6119
|
-
(0, combinator_1.some)(source_1.unescsource, /[-+*=~^_/,.;:!?]{2}|[-+*=~^_,.;:!?]?(?=[\\"`|\[\](){}<>]|[^\x21-\x7E]|$)/y)]), undefined, [[/[^\x21-\x7E]|\$/y, 9]])), false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.convert)(url => `{ ${url} }`, link_1.unsafelink, false))), ({
|
|
6098
|
+
exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9a-z][.+-]?)https?:\/\/(?=[\x21-\x7E])/y, (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.verify)(bracket, ns => ns.length > 0), (0, combinator_1.some)(source_1.unescsource, /([-+*=~^_/])\1|[,.;:!?]{2}|[-+*=~^_,.;:!?]?(?=[\\"`\[\](){}<>()[]{}|]|[^\x21-\x7E]|$)/y)]), undefined, [[/[^\x21-\x7E]|\$/y, 9]])), false, [3 | 0 /* Backtrack.autolink */]), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.convert)(url => `{ ${url} }`, link_1.unsafelink, false))), ({
|
|
6120
6099
|
context: {
|
|
6121
6100
|
source
|
|
6122
6101
|
}
|
|
@@ -6157,7 +6136,7 @@ exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/[([{
|
|
|
6157
6136
|
return indexA.test(str) ? [[as[0], str, cs[0]]] : [[(0, dom_1.html)('span', {
|
|
6158
6137
|
class: 'paren'
|
|
6159
6138
|
}, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))]];
|
|
6160
|
-
}, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 |
|
|
6139
|
+
}, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 | 64 /* Backtrack.bracket */]), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ')', [[')', 1]]))), (0, source_1.str)(')'), true, ([as, bs = [], cs], {
|
|
6161
6140
|
source,
|
|
6162
6141
|
position,
|
|
6163
6142
|
range = 0
|
|
@@ -6175,24 +6154,24 @@ exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/[([{
|
|
|
6175
6154
|
} = context;
|
|
6176
6155
|
const head = position - range;
|
|
6177
6156
|
if (context.linebreak !== 0 || source[position] !== '{') {
|
|
6178
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
6157
|
+
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
|
|
6179
6158
|
} else {
|
|
6180
6159
|
context.state ^= 8 /* State.link */;
|
|
6181
|
-
const result = !(0, combinator_1.isBacktrack)(context, [1 |
|
|
6160
|
+
const result = !(0, combinator_1.isBacktrack)(context, [1 | 16 /* Backtrack.link */]) ? (0, link_1.textlink)({
|
|
6182
6161
|
context
|
|
6183
6162
|
}) : undefined;
|
|
6184
6163
|
context.position = position;
|
|
6185
6164
|
if (!result) {
|
|
6186
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
6165
|
+
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
|
|
6187
6166
|
}
|
|
6188
6167
|
context.state ^= 8 /* State.link */;
|
|
6189
6168
|
context.range = range;
|
|
6190
6169
|
}
|
|
6191
6170
|
}
|
|
6192
6171
|
return [(0, array_1.push)((0, array_1.unshift)(as, bs), cs)];
|
|
6193
|
-
}, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 |
|
|
6172
|
+
}, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 | 64 /* Backtrack.bracket */]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (0, source_1.str)(']'), true, undefined, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, undefined, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 | 64 /* Backtrack.bracket */]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, undefined, ([as, bs = []]) => [(0, array_1.unshift)(as, bs)]),
|
|
6194
6173
|
// 同一行内でしか閉じない以外括弧と同じ挙動
|
|
6195
|
-
(0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '"', [['"', 2, false]]))), (0, source_1.str)('"'), true, ([as, bs = [], cs], context) => context.linebreak === 0 ? [(0, array_1.push)((0, array_1.unshift)(as, bs), cs)] : (context.position -= 1, [(0, array_1.unshift)(as, bs)]), ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 |
|
|
6174
|
+
(0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '"', [['"', 2, false]]))), (0, source_1.str)('"'), true, ([as, bs = [], cs], context) => context.linebreak === 0 ? [(0, array_1.push)((0, array_1.unshift)(as, bs), cs)] : (context.position -= 1, [(0, array_1.unshift)(as, bs)]), ([as, bs = []]) => [(0, array_1.unshift)(as, bs)], [2 | 64 /* Backtrack.bracket */])])));
|
|
6196
6175
|
|
|
6197
6176
|
/***/ },
|
|
6198
6177
|
|
|
@@ -6214,7 +6193,7 @@ exports.code = (0, combinator_1.open)(/(?=`)/y, (0, combinator_1.match)(/(`+)(?!
|
|
|
6214
6193
|
}, format(body))]] : body ? [[(0, dom_1.html)('code', {
|
|
6215
6194
|
class: 'invalid',
|
|
6216
6195
|
...(0, util_1.invalid)('code', 'syntax', `Missing the closing symbol "${opener}"`)
|
|
6217
|
-
}, whole)]] : [[opener]], true), false, [3 |
|
|
6196
|
+
}, whole)]] : [[opener]], true), false, [3 | 64 /* Backtrack.bracket */]);
|
|
6218
6197
|
function format(text) {
|
|
6219
6198
|
return text.length > 2 && text[0] === ' ' && text[1] === '`' && text.at(-1) === ' ' ? text.slice(1, -1) : text;
|
|
6220
6199
|
}
|
|
@@ -6437,7 +6416,7 @@ const array_1 = __webpack_require__(6876);
|
|
|
6437
6416
|
const dom_1 = __webpack_require__(394);
|
|
6438
6417
|
exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(32 /* State.index */, (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)((0, source_1.str)('[#'), (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.inits)([inline_1.inline, exports.signature]), ']', [[']', 1]])))), (0, source_1.str)(']'), false, ([, bs], context) => context.linebreak === 0 && (0, visibility_1.trimBlankNodeEnd)(bs).length > 0 ? [[(0, dom_1.html)('a', {
|
|
6439
6418
|
'data-index': dataindex(bs)
|
|
6440
|
-
}, (0, dom_1.defrag)(bs))]] : undefined, undefined, [3 |
|
|
6419
|
+
}, (0, dom_1.defrag)(bs))]] : undefined, undefined, [3 | 64 /* Backtrack.bracket */])), ns => {
|
|
6441
6420
|
if (ns.length === 1) {
|
|
6442
6421
|
const el = ns[0];
|
|
6443
6422
|
return [(0, dom_1.define)(el, {
|
|
@@ -6450,13 +6429,13 @@ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(32 /*
|
|
|
6450
6429
|
return ns;
|
|
6451
6430
|
}
|
|
6452
6431
|
})));
|
|
6453
|
-
exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|', (0, combinator_1.surround)((0, source_1.str)(/\|(?!\\?\s)/y), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, (0, combinator_1.some)(source_1.txt, /(?:[
|
|
6432
|
+
exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|', (0, combinator_1.surround)((0, source_1.str)(/\|(?!\\?\s)/y), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, (0, combinator_1.some)(source_1.txt, /(?:[$"`\[\](){}<>()[]{}])/y)]), ']'), /(?=])/y, false, ([, ns], context) => {
|
|
6454
6433
|
const index = (0, indexee_1.identity)('index', undefined, ns.join(''))?.slice(7);
|
|
6455
|
-
return index ? [[(0, dom_1.html)('span', {
|
|
6434
|
+
return index && context.linebreak === 0 ? [[(0, dom_1.html)('span', {
|
|
6456
6435
|
class: 'indexer',
|
|
6457
6436
|
'data-index': index
|
|
6458
6437
|
})]] : undefined;
|
|
6459
|
-
}, ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)])));
|
|
6438
|
+
}, ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)], [3 | 64 /* Backtrack.bracket */])));
|
|
6460
6439
|
function dataindex(ns) {
|
|
6461
6440
|
if (ns.length === 0) return;
|
|
6462
6441
|
for (let i = ns.length; i--;) {
|
|
@@ -6626,7 +6605,7 @@ const dom_1 = __webpack_require__(394);
|
|
|
6626
6605
|
// 複合生成インデクスを手動で同期させるより最初から重複のない
|
|
6627
6606
|
// テキストまたはインデクスを付けて同期が必要な機会を減らすのが
|
|
6628
6607
|
// 継続的編集において最も簡便となる。
|
|
6629
|
-
exports.indexer = (0, combinator_1.surround)(/\s
|
|
6608
|
+
exports.indexer = (0, combinator_1.surround)(/\s\[(?=\|\S)/y, (0, combinator_1.union)([index_1.signature, (0, combinator_1.focus)(/\|(?=\])/y, () => [[(0, dom_1.html)('span', {
|
|
6630
6609
|
class: 'indexer',
|
|
6631
6610
|
'data-index': ''
|
|
6632
6611
|
})]])]), /\]\s*$/y);
|
|
@@ -6648,7 +6627,7 @@ const source_1 = __webpack_require__(8745);
|
|
|
6648
6627
|
const dom_1 = __webpack_require__(394);
|
|
6649
6628
|
const body = (0, source_1.str)(/\$[A-Za-z]*(?:(?:-[A-Za-z][0-9A-Za-z]*)+|-(?:(?:0|[1-9][0-9]*)\.)*(?:0|[1-9][0-9]*)(?![0-9A-Za-z]))/y);
|
|
6650
6629
|
exports.segment = (0, combinator_1.clear)((0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body]));
|
|
6651
|
-
exports.label = (0, combinator_1.constraint)(16 /* State.label */, (0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']', false, undefined, undefined, [1 |
|
|
6630
|
+
exports.label = (0, combinator_1.constraint)(16 /* State.label */, (0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']', false, undefined, undefined, [1 | 64 /* Backtrack.bracket */, 1]), body]), ([text]) => [(0, dom_1.html)('a', {
|
|
6652
6631
|
class: 'label',
|
|
6653
6632
|
'data-label': text.slice(text[1] === '-' ? 0 : 1).toLowerCase()
|
|
6654
6633
|
}, text)]));
|
|
@@ -6696,7 +6675,7 @@ exports.placeholder = (0, combinator_1.lazy)(() => (0, combinator_1.surround)(
|
|
|
6696
6675
|
(0, source_1.str)(/\[[:^|]/y), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])))), (0, source_1.str)(']'), false, (_, context) => [[(0, dom_1.html)('span', {
|
|
6697
6676
|
class: 'invalid',
|
|
6698
6677
|
...(0, util_1.invalid)('extension', 'syntax', `Invalid start symbol or linebreak`)
|
|
6699
|
-
}, context.source.slice(context.position - context.range, context.position))]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)], [3 |
|
|
6678
|
+
}, context.source.slice(context.position - context.range, context.position))]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)], [3 | 64 /* Backtrack.bracket */]));
|
|
6700
6679
|
|
|
6701
6680
|
/***/ },
|
|
6702
6681
|
|
|
@@ -6718,7 +6697,7 @@ const util_1 = __webpack_require__(4992);
|
|
|
6718
6697
|
const memoize_1 = __webpack_require__(6925);
|
|
6719
6698
|
const array_1 = __webpack_require__(6876);
|
|
6720
6699
|
const dom_1 = __webpack_require__(394);
|
|
6721
|
-
const tags =
|
|
6700
|
+
const tags = ['wbr', 'bdo', 'bdi'];
|
|
6722
6701
|
const attrspecs = {
|
|
6723
6702
|
wbr: {},
|
|
6724
6703
|
bdo: {
|
|
@@ -6740,7 +6719,7 @@ function elem(tag, content, as, bs, cs, context) {
|
|
|
6740
6719
|
if (bs.length === 0) return ielem('content', `Missing the content`, context);
|
|
6741
6720
|
if (!(0, visibility_1.isLooseNodeStart)(bs)) return ielem('content', `Missing the visible content in the same line`, context);
|
|
6742
6721
|
}
|
|
6743
|
-
const attrs = attributes('html', attrspecs[tag], as.slice(1, as.at(-1) === '>' ? -
|
|
6722
|
+
const attrs = attributes('html', attrspecs[tag], as.slice(1, as.at(-1) === '>' ? -1 : as.length));
|
|
6744
6723
|
if (/(?<!\S)invalid(?!\S)/.test(attrs['class'] ?? '')) return ielem('attribute', 'Invalid HTML attribute', context);
|
|
6745
6724
|
if (as.at(-1) !== '>') return ielem('tag', `Missing the closing symbol ">"`, context);
|
|
6746
6725
|
return (0, dom_1.html)(tag, attrs, (0, dom_1.defrag)(bs));
|
|
@@ -6757,10 +6736,11 @@ function attributes(syntax, spec, params) {
|
|
|
6757
6736
|
const attrs = {};
|
|
6758
6737
|
for (let i = 0; i < params.length; ++i) {
|
|
6759
6738
|
const param = params[i].trimStart();
|
|
6739
|
+
if (param === '') continue;
|
|
6760
6740
|
const name = param.split('=', 1)[0];
|
|
6761
6741
|
const value = param !== name ? param.slice(name.length + 2, -1).replace(/\\(.?)/g, '$1') : undefined;
|
|
6762
|
-
invalidation ||= !spec || name in attrs;
|
|
6763
|
-
if (spec && name in spec && !spec[name]) continue;
|
|
6742
|
+
invalidation ||= name === '' || !spec || name in attrs;
|
|
6743
|
+
if (name === '' || spec && name in spec && !spec[name]) continue;
|
|
6764
6744
|
spec?.[name]?.includes(value) || spec?.[name]?.length === 0 && value !== undefined ? attrs[name] = value ?? '' : invalidation ||= !!spec;
|
|
6765
6745
|
(0, array_1.splice)(params, i--, 1);
|
|
6766
6746
|
}
|
|
@@ -6774,7 +6754,7 @@ function attributes(syntax, spec, params) {
|
|
|
6774
6754
|
exports.attributes = attributes;
|
|
6775
6755
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element
|
|
6776
6756
|
// [...document.querySelectorAll('tbody > tr > td:first-child')].map(el => el.textContent.slice(1, -1))
|
|
6777
|
-
const TAGS =
|
|
6757
|
+
const TAGS = ["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "h1", "h2", "h3", "h4", "h5", "h6", "hgroup", "main", "nav", "section", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "menu", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "summary", "slot", "template", "acronym", "applet", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "param", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp"];
|
|
6778
6758
|
|
|
6779
6759
|
/***/ },
|
|
6780
6760
|
|
|
@@ -6791,7 +6771,7 @@ exports.htmlentity = exports.unsafehtmlentity = void 0;
|
|
|
6791
6771
|
const combinator_1 = __webpack_require__(3484);
|
|
6792
6772
|
const util_1 = __webpack_require__(4992);
|
|
6793
6773
|
const dom_1 = __webpack_require__(394);
|
|
6794
|
-
exports.unsafehtmlentity = (0, combinator_1.
|
|
6774
|
+
exports.unsafehtmlentity = (0, combinator_1.focus)(/&(?:[0-9A-Za-z]+;?)?/y,
|
|
6795
6775
|
//({ source }) => [[parser(source) ?? `${Command.Error}${source}`], '']));
|
|
6796
6776
|
({
|
|
6797
6777
|
context
|
|
@@ -6801,7 +6781,7 @@ exports.unsafehtmlentity = (0, combinator_1.validate)('&', (0, combinator_1.focu
|
|
|
6801
6781
|
} = context;
|
|
6802
6782
|
context.position += source.length;
|
|
6803
6783
|
return source.length > 1 && source.at(-1) === ';' ? [[parser(source) ?? source]] : [[source]];
|
|
6804
|
-
})
|
|
6784
|
+
});
|
|
6805
6785
|
exports.htmlentity = (0, combinator_1.fmap)((0, combinator_1.union)([exports.unsafehtmlentity]), ([text]) => [length === 1 || text.at(-1) !== ';' ? text : (0, dom_1.html)('span', {
|
|
6806
6786
|
class: 'invalid',
|
|
6807
6787
|
...(0, util_1.invalid)('htmlentity', 'syntax', 'Invalid HTML entity')
|
|
@@ -6875,7 +6855,7 @@ exports.italic = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('///',
|
|
|
6875
6855
|
Object.defineProperty(exports, "__esModule", ({
|
|
6876
6856
|
value: true
|
|
6877
6857
|
}));
|
|
6878
|
-
exports.decode = exports.resolve = exports.option = exports.uri = exports.unsafelink = exports.
|
|
6858
|
+
exports.decode = exports.resolve = exports.option = exports.uri = exports.unsafelink = exports.medialink = exports.textlink = void 0;
|
|
6879
6859
|
const combinator_1 = __webpack_require__(3484);
|
|
6880
6860
|
const inline_1 = __webpack_require__(7973);
|
|
6881
6861
|
const html_1 = __webpack_require__(5013);
|
|
@@ -6889,20 +6869,20 @@ const optspec = {
|
|
|
6889
6869
|
rel: ['nofollow']
|
|
6890
6870
|
};
|
|
6891
6871
|
Object.setPrototypeOf(optspec, null);
|
|
6892
|
-
exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */, (0, combinator_1.creation)(10, (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.subsequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])), ']', true, ([, ns = []], context) => context.linebreak === 0 ? [(0, array_1.push)(ns, ["\u001F" /* Command.Separator */])] : undefined, undefined, [3 | 64 /* Backtrack.
|
|
6872
|
+
exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */, (0, combinator_1.creation)(10, (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.subsequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])), ']', true, ([, ns = []], context) => context.linebreak === 0 ? [(0, array_1.push)(ns, ["\u001F" /* Command.Separator */])] : undefined, undefined, [3 | 64 /* Backtrack.bracket */, 3 | 16 /* Backtrack.link */, 2 | 8 /* Backtrack.ruby */])),
|
|
6893
6873
|
// `{ `と`{`で個別にバックトラックが発生し+1nされる。
|
|
6894
6874
|
// 自己再帰的にパースしてもオプションの不要なパースによる計算量の増加により相殺される。
|
|
6895
6875
|
(0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /[^\S\n]*}/y, false, undefined, ([as, bs], context) => {
|
|
6896
6876
|
if (!bs) return;
|
|
6897
6877
|
const head = context.position - context.range;
|
|
6898
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
6878
|
+
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
|
|
6899
6879
|
return [(0, array_1.push)((0, array_1.unshift)(as, bs), ["\u0018" /* Command.Cancel */])];
|
|
6900
|
-
}, [3 |
|
|
6880
|
+
}, [3 | 16 /* Backtrack.link */]))]), ([content, params], context) => {
|
|
6901
6881
|
if (content.at(-1) === "\u001F" /* Command.Separator */) {
|
|
6902
6882
|
content.pop();
|
|
6903
6883
|
if (params === undefined) {
|
|
6904
6884
|
const head = context.position - context.range;
|
|
6905
|
-
return void (0, combinator_1.setBacktrack)(context, [2 |
|
|
6885
|
+
return void (0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
|
|
6906
6886
|
}
|
|
6907
6887
|
} else {
|
|
6908
6888
|
params = content;
|
|
@@ -6919,7 +6899,6 @@ exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /
|
|
|
6919
6899
|
return [[parse((0, dom_1.defrag)(content), params, context)]];
|
|
6920
6900
|
}))))));
|
|
6921
6901
|
exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */ | 4 /* State.media */, (0, combinator_1.validate)(/[[{]/y, (0, combinator_1.creation)(10, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.reverse)((0, combinator_1.sequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.union)([inline_1.media, inline_1.shortmedia]), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /[^\S\n]*}/y))])), ([params, content = []], context) => [[parse((0, dom_1.defrag)(content), params, context)]]))))));
|
|
6922
|
-
exports.linemedialink = (0, combinator_1.surround)(/(?<=^|[\r\n])/y, (0, combinator_1.union)([exports.medialink]), /(?=[^\S\n]*(?:$|\n))/y);
|
|
6923
6902
|
exports.unsafelink = (0, combinator_1.lazy)(() => (0, combinator_1.creation)(10, (0, combinator_1.bind)((0, combinator_1.reverse)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([source_1.unescsource]), ']'), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /[^\S\n]*}/y))])), ([params, content = []], context) => [[parse((0, dom_1.defrag)(content), params, context)]])));
|
|
6924
6903
|
exports.uri = (0, combinator_1.union)([(0, combinator_1.open)(/[^\S\n]+/y, (0, source_1.str)(/\S+/y)), (0, source_1.str)(/[^\s{}]+/y)]);
|
|
6925
6904
|
exports.option = (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/[^\S\n]+nofollow(?=[^\S\n]|})/y), () => [` rel="nofollow"`]), (0, source_1.str)(/[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|})/yi), (0, source_1.str)(/[^\S\n]+[^\s{}]+/y)]);
|
|
@@ -7064,7 +7043,7 @@ const source_1 = __webpack_require__(8745);
|
|
|
7064
7043
|
const util_1 = __webpack_require__(4992);
|
|
7065
7044
|
const dom_1 = __webpack_require__(394);
|
|
7066
7045
|
const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![a-z])|:\/\//i;
|
|
7067
|
-
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
7046
|
+
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.union)([(0, combinator_1.surround)(/\$(?={)/y, (0, combinator_1.precedence)(5, bracket), '$', false, undefined, undefined, [3 | 64 /* Backtrack.bracket */]), (0, combinator_1.surround)(/\$(?![\s{}])/y, (0, combinator_1.precedence)(2, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(source_1.escsource, /\s?\$|[`"{}\n]/y), (0, combinator_1.precedence)(5, bracket)]))), /\$(?![-0-9A-Za-z])/y, false, undefined, undefined, [3 | 64 /* Backtrack.bracket */])]), ({
|
|
7068
7047
|
context: {
|
|
7069
7048
|
source,
|
|
7070
7049
|
caches: {
|
|
@@ -7079,7 +7058,7 @@ exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('$', (0,
|
|
|
7079
7058
|
class: 'invalid',
|
|
7080
7059
|
translate: 'no',
|
|
7081
7060
|
...(0, util_1.invalid)('math', 'content', `"${source.match(forbiddenCommand)[0]}" command is forbidden`)
|
|
7082
|
-
}, source)]]))
|
|
7061
|
+
}, source)]]));
|
|
7083
7062
|
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.escsource, /[{}$\n]/y)]))), (0, source_1.str)('}'), true));
|
|
7084
7063
|
|
|
7085
7064
|
/***/ },
|
|
@@ -7093,7 +7072,7 @@ const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, sour
|
|
|
7093
7072
|
Object.defineProperty(exports, "__esModule", ({
|
|
7094
7073
|
value: true
|
|
7095
7074
|
}));
|
|
7096
|
-
exports.
|
|
7075
|
+
exports.media = void 0;
|
|
7097
7076
|
const parser_1 = __webpack_require__(605);
|
|
7098
7077
|
const combinator_1 = __webpack_require__(3484);
|
|
7099
7078
|
const link_1 = __webpack_require__(3628);
|
|
@@ -7111,12 +7090,12 @@ const optspec = {
|
|
|
7111
7090
|
rel: undefined
|
|
7112
7091
|
};
|
|
7113
7092
|
Object.setPrototypeOf(optspec, null);
|
|
7114
|
-
exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.
|
|
7093
|
+
exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.creation)(10, (0, combinator_1.open)('!', (0, combinator_1.bind)((0, combinator_1.verify)((0, combinator_1.fmap)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']')), ']', true, ([, ns = []], context) => context.linebreak === 0 ? [ns] : undefined, undefined, [3 | 4 /* Backtrack.escbracket */])), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), /[^\S\n]*}/y, false, undefined, ([as, bs], context) => {
|
|
7115
7094
|
if (!bs) return;
|
|
7116
7095
|
const head = context.position - context.range;
|
|
7117
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
7096
|
+
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
|
|
7118
7097
|
return [(0, array_1.push)((0, array_1.unshift)(as, bs), ["\u0018" /* Command.Cancel */])];
|
|
7119
|
-
}, [3 |
|
|
7098
|
+
}, [3 | 16 /* Backtrack.link */]))]), ([as, bs]) => bs ? [[as.join('').trim() || as.join('')], bs] : [[''], as]), ([[text]]) => text === '' || text.trim() !== ''), ([[text], params], context) => {
|
|
7120
7099
|
if (params.at(-1) === "\u0018" /* Command.Cancel */) {
|
|
7121
7100
|
params.pop();
|
|
7122
7101
|
return [[(0, dom_1.html)('span', {
|
|
@@ -7157,8 +7136,7 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* S
|
|
|
7157
7136
|
target: '_blank'
|
|
7158
7137
|
}, [el])];
|
|
7159
7138
|
})((0, parser_1.subinput)(`{ ${INSECURE_URI}${params.join('')} }`, context));
|
|
7160
|
-
})))))
|
|
7161
|
-
exports.linemedia = (0, combinator_1.surround)(/(?<=^|[\r\n])/y, (0, combinator_1.union)([exports.media]), /(?=[^\S\n]*(?:$|\n))/y);
|
|
7139
|
+
})))));
|
|
7162
7140
|
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true, undefined, () => [[]], [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true, undefined, () => [[]], [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true, undefined, () => [[]], [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, source_1.txt]), '"')), (0, source_1.str)('"'), true, undefined, () => [[]], [3 | 4 /* Backtrack.escbracket */])])));
|
|
7163
7141
|
const option = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, combinator_1.open)(/[^\S\n]+/y, (0, source_1.str)(/[1-9][0-9]*/y)), (0, source_1.str)(/[x:]/y), (0, source_1.str)(/[1-9][0-9]*(?=[^\S\n]|})/y), false, ([[a], [b], [c]]) => [b === 'x' ? [`width="${a}"`, `height="${c}"`] : [`aspect-ratio="${a}/${c}"`]]), link_1.option]));
|
|
7164
7142
|
function sanitize(target, uri) {
|
|
@@ -7223,7 +7201,7 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
|
|
|
7223
7201
|
return [[(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, dom_1.defrag)((0, visibility_1.trimBlankNodeEnd)(ns)))])]];
|
|
7224
7202
|
} else {
|
|
7225
7203
|
const head = position - range;
|
|
7226
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
7204
|
+
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head, 2);
|
|
7227
7205
|
}
|
|
7228
7206
|
}, ([as, bs], context) => {
|
|
7229
7207
|
if (!bs) return;
|
|
@@ -7236,9 +7214,9 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
|
|
|
7236
7214
|
} = context;
|
|
7237
7215
|
const head = position - range;
|
|
7238
7216
|
if (source[position] !== ']') {
|
|
7239
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
7217
|
+
(0, combinator_1.setBacktrack)(context, [2 | 64 /* Backtrack.bracket */], head, 2);
|
|
7240
7218
|
} else if (linebreak !== 0) {
|
|
7241
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
7219
|
+
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head, 2);
|
|
7242
7220
|
} else {
|
|
7243
7221
|
if (state & 128 /* State.annotation */) {
|
|
7244
7222
|
(0, array_1.push)(bs, [source[position]]);
|
|
@@ -7246,23 +7224,23 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
|
|
|
7246
7224
|
context.position += 1;
|
|
7247
7225
|
let result;
|
|
7248
7226
|
if (source[context.position] !== '{') {
|
|
7249
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
7227
|
+
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head + 1);
|
|
7250
7228
|
result = [[]];
|
|
7251
7229
|
} else {
|
|
7252
|
-
result = !(0, combinator_1.isBacktrack)(context, [1 |
|
|
7230
|
+
result = !(0, combinator_1.isBacktrack)(context, [1 | 16 /* Backtrack.link */]) ? (0, link_1.textlink)({
|
|
7253
7231
|
context
|
|
7254
7232
|
}) : undefined;
|
|
7255
7233
|
context.range = range;
|
|
7256
7234
|
if (!result) {
|
|
7257
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
7235
|
+
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head + 1);
|
|
7258
7236
|
result = [[]];
|
|
7259
7237
|
}
|
|
7260
7238
|
}
|
|
7261
7239
|
if (context.position === source.length) {
|
|
7262
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
7240
|
+
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
|
|
7263
7241
|
} else {
|
|
7264
7242
|
const next = (0, combinator_1.surround)('', (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]), (0, source_1.str)(']'), true, ([, cs = [], ds]) => [(0, array_1.push)(cs, ds)], ([, cs = []]) => {
|
|
7265
|
-
(0, combinator_1.setBacktrack)(context, [2 |
|
|
7243
|
+
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
|
|
7266
7244
|
return [cs];
|
|
7267
7245
|
})({
|
|
7268
7246
|
context
|
|
@@ -7274,7 +7252,7 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
|
|
|
7274
7252
|
context.position = position;
|
|
7275
7253
|
}
|
|
7276
7254
|
return state & 128 /* State.annotation */ ? [(0, array_1.unshift)(as, bs)] : undefined;
|
|
7277
|
-
}, [
|
|
7255
|
+
}, [1 | 64 /* Backtrack.bracket */, 3 | 32 /* Backtrack.doublebracket */])));
|
|
7278
7256
|
// Chicago-Style
|
|
7279
7257
|
const abbr = (0, combinator_1.surround)((0, source_1.str)('^'), (0, combinator_1.union)([(0, source_1.str)(/(?=[A-Z])(?:[0-9A-Za-z]'?|(?:[-.:]|\.?\??,? ?)(?!['\-.:?, ]))+/y)]), /\|?(?=]])|\|/y, true, ([, ns], context) => {
|
|
7280
7258
|
const {
|
|
@@ -7325,14 +7303,21 @@ exports.remark = void 0;
|
|
|
7325
7303
|
const combinator_1 = __webpack_require__(3484);
|
|
7326
7304
|
const inline_1 = __webpack_require__(7973);
|
|
7327
7305
|
const source_1 = __webpack_require__(8745);
|
|
7328
|
-
const
|
|
7306
|
+
const util_1 = __webpack_require__(4992);
|
|
7329
7307
|
const array_1 = __webpack_require__(6876);
|
|
7330
7308
|
const dom_1 = __webpack_require__(394);
|
|
7331
|
-
exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
7309
|
+
exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.fallback)((0, combinator_1.surround)((0, source_1.str)(/\[%(?=\s)/y), (0, combinator_1.precedence)(4, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /\s%\]/y, [[/\s%\]/y, 4]]))), (0, combinator_1.close)(source_1.text, (0, source_1.str)(`%]`)), true, ([as, bs = [], cs]) => [[(0, dom_1.html)('span', {
|
|
7332
7310
|
class: 'remark'
|
|
7333
7311
|
}, [(0, dom_1.html)('input', {
|
|
7334
7312
|
type: 'checkbox'
|
|
7335
|
-
}), (0, dom_1.html)('span', (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))])]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)]), (
|
|
7313
|
+
}), (0, dom_1.html)('span', (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))])]], ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)]), (0, combinator_1.focus)(/\[%+(?=\s)/y, ({
|
|
7314
|
+
context: {
|
|
7315
|
+
source
|
|
7316
|
+
}
|
|
7317
|
+
}) => [[(0, dom_1.html)('span', {
|
|
7318
|
+
class: 'invalid',
|
|
7319
|
+
...(0, util_1.invalid)('remark', 'syntax', 'Invalid start symbol')
|
|
7320
|
+
}, source)]])));
|
|
7336
7321
|
|
|
7337
7322
|
/***/ },
|
|
7338
7323
|
|
|
@@ -7356,10 +7341,10 @@ const dom_1 = __webpack_require__(394);
|
|
|
7356
7341
|
exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.bind)((0, combinator_1.inits)([(0, combinator_1.dup)((0, combinator_1.surround)('[', text, ']', false, ([, ns]) => {
|
|
7357
7342
|
ns && ns.at(-1) === '' && ns.pop();
|
|
7358
7343
|
return (0, visibility_1.isTightNodeStart)(ns) ? [ns] : undefined;
|
|
7359
|
-
}, undefined, [
|
|
7344
|
+
}, undefined, [1 | 64 /* Backtrack.bracket */, 3 | 8 /* Backtrack.ruby */])), (0, combinator_1.dup)((0, combinator_1.surround)('(', text, ')', false, undefined, undefined, [1 | 64 /* Backtrack.bracket */, 3 | 8 /* Backtrack.ruby */]))]), ([texts, rubies], context) => {
|
|
7360
7345
|
if (rubies === undefined) {
|
|
7361
7346
|
const head = context.position - context.range;
|
|
7362
|
-
return void (0, combinator_1.setBacktrack)(context, [2 |
|
|
7347
|
+
return void (0, combinator_1.setBacktrack)(context, [2 | 8 /* Backtrack.ruby */], head);
|
|
7363
7348
|
}
|
|
7364
7349
|
switch (true) {
|
|
7365
7350
|
case rubies.length <= texts.length:
|
|
@@ -7383,7 +7368,7 @@ const text = input => {
|
|
|
7383
7368
|
for (let {
|
|
7384
7369
|
position
|
|
7385
7370
|
} = context; position < source.length; position = context.position) {
|
|
7386
|
-
if (
|
|
7371
|
+
if (/[$"`\[\](){}<>()[]{}]|\\?\n/yi.test(source.slice(position, position + 2))) break;
|
|
7387
7372
|
switch (source[position]) {
|
|
7388
7373
|
case '&':
|
|
7389
7374
|
{
|
|
@@ -7440,7 +7425,7 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
7440
7425
|
const url_1 = __webpack_require__(2129);
|
|
7441
7426
|
const media_1 = __webpack_require__(7478);
|
|
7442
7427
|
exports.shortmedia = (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.rewrite)((0, combinator_1.open)('!', url_1.url), (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media]), false)));
|
|
7443
|
-
exports.lineshortmedia = (0, combinator_1.focus)(/(?<=^|[\r\n])
|
|
7428
|
+
exports.lineshortmedia = (0, combinator_1.focus)(/(?<=^|[\r\n])!https?:\/\/\S+(?=[^\S\n]*(?:$|\n))/y, (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media]), false));
|
|
7444
7429
|
|
|
7445
7430
|
/***/ },
|
|
7446
7431
|
|
|
@@ -7485,7 +7470,7 @@ exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, s
|
|
|
7485
7470
|
}, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))]], ([, bs], context) => bs && [[(0, dom_1.html)('span', {
|
|
7486
7471
|
class: 'invalid',
|
|
7487
7472
|
...(0, util_1.invalid)('template', 'syntax', `Missing the closing symbol "}}"`)
|
|
7488
|
-
}, context.source.slice(context.position - context.range, context.position))]], [3 |
|
|
7473
|
+
}, context.source.slice(context.position - context.range, context.position))]], [3 | 32 /* Backtrack.doublebracket */, 3 | 4 /* Backtrack.escbracket */]));
|
|
7489
7474
|
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')')), (0, source_1.str)(')'), true, undefined, () => [[]], [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ']')), (0, source_1.str)(']'), true, undefined, () => [[]], [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), (0, source_1.str)('}'), true, undefined, () => [[]], [3 | 4 /* Backtrack.escbracket */]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)(source_1.escsource, '"', [['"', 2, false]]))), (0, source_1.str)('"'), true, ([as, bs = [], cs], context) => context.linebreak === 0 ? [(0, array_1.push)((0, array_1.unshift)(as, bs), cs)] : (context.position -= 1, [(0, array_1.unshift)(as, bs)]), ([as, bs]) => bs && [(0, array_1.unshift)(as, bs)], [3 | 4 /* Backtrack.escbracket */])]));
|
|
7490
7475
|
|
|
7491
7476
|
/***/ },
|
|
@@ -7816,7 +7801,33 @@ const extension_1 = __webpack_require__(6193);
|
|
|
7816
7801
|
const source_1 = __webpack_require__(8745);
|
|
7817
7802
|
exports.MAX_SEGMENT_SIZE = 100_000; // 100,000 bytes (Max value size of FDB)
|
|
7818
7803
|
exports.MAX_INPUT_SIZE = exports.MAX_SEGMENT_SIZE * 10;
|
|
7819
|
-
const parser = (0, combinator_1.union)([
|
|
7804
|
+
const parser = (0, combinator_1.union)([input => {
|
|
7805
|
+
const {
|
|
7806
|
+
context: {
|
|
7807
|
+
source,
|
|
7808
|
+
position
|
|
7809
|
+
}
|
|
7810
|
+
} = input;
|
|
7811
|
+
if (position === source.length) return;
|
|
7812
|
+
switch (source.slice(position, position + 3)) {
|
|
7813
|
+
case '~~~':
|
|
7814
|
+
return (0, extension_1.segment)(input);
|
|
7815
|
+
case '```':
|
|
7816
|
+
return (0, codeblock_1.segment)(input);
|
|
7817
|
+
}
|
|
7818
|
+
switch (source.slice(position, position + 2)) {
|
|
7819
|
+
case '$$':
|
|
7820
|
+
return (0, mathblock_1.segment)(input);
|
|
7821
|
+
case '[$':
|
|
7822
|
+
return (0, extension_1.segment)(input);
|
|
7823
|
+
}
|
|
7824
|
+
switch (source[position]) {
|
|
7825
|
+
case '#':
|
|
7826
|
+
return (0, heading_1.segment)(input);
|
|
7827
|
+
case '$':
|
|
7828
|
+
return (0, extension_1.segment)(input);
|
|
7829
|
+
}
|
|
7830
|
+
}, (0, combinator_1.some)(source_1.contentline, exports.MAX_SEGMENT_SIZE + 1), (0, combinator_1.some)(source_1.emptyline, exports.MAX_SEGMENT_SIZE + 1)]);
|
|
7820
7831
|
function* segment(source) {
|
|
7821
7832
|
if (!validate(source, exports.MAX_INPUT_SIZE)) return yield `${"\u0007" /* Command.Error */}Too large input over ${exports.MAX_INPUT_SIZE.toLocaleString('en')} bytes.\n${source.slice(0, 1001)}`;
|
|
7822
7833
|
const context = {
|
|
@@ -7938,6 +7949,7 @@ exports.escsource = void 0;
|
|
|
7938
7949
|
const combinator_1 = __webpack_require__(3484);
|
|
7939
7950
|
const text_1 = __webpack_require__(5655);
|
|
7940
7951
|
const dom_1 = __webpack_require__(394);
|
|
7952
|
+
const delimiter = /(?=[\\$"`\[\](){}\r\n]|\s(?:\$)|:\/\/)/g;
|
|
7941
7953
|
const escsource = ({
|
|
7942
7954
|
context
|
|
7943
7955
|
}) => {
|
|
@@ -7973,11 +7985,9 @@ const escsource = ({
|
|
|
7973
7985
|
return [[(0, dom_1.html)('br')]];
|
|
7974
7986
|
default:
|
|
7975
7987
|
if (context.sequential) return [[char]];
|
|
7976
|
-
text_1.nonAlphanumeric.lastIndex = position + 1;
|
|
7977
7988
|
text_1.nonWhitespace.lastIndex = position + 1;
|
|
7978
|
-
text_1.ASCII.lastIndex = position + 1;
|
|
7979
7989
|
const b = (0, text_1.isBlank)(source, position);
|
|
7980
|
-
let i = b ? text_1.nonWhitespace.test(source) ? text_1.nonWhitespace.lastIndex - 1 : source.length : (0, text_1.
|
|
7990
|
+
let i = b ? text_1.nonWhitespace.test(source) ? text_1.nonWhitespace.lastIndex - 1 : source.length : (0, text_1.next)(source, position, delimiter);
|
|
7981
7991
|
i -= position;
|
|
7982
7992
|
(0, combinator_1.consume)(i - 1, context);
|
|
7983
7993
|
context.position += i - 1;
|
|
@@ -8090,13 +8100,11 @@ exports.strs = strs;
|
|
|
8090
8100
|
Object.defineProperty(exports, "__esModule", ({
|
|
8091
8101
|
value: true
|
|
8092
8102
|
}));
|
|
8093
|
-
exports.
|
|
8103
|
+
exports.isBlank = exports.backToEmailHead = exports.backToUrlHead = exports.next = exports.linebreak = exports.txt = exports.text = exports.nonWhitespace = exports.delimiter = void 0;
|
|
8094
8104
|
const combinator_1 = __webpack_require__(3484);
|
|
8095
8105
|
const dom_1 = __webpack_require__(394);
|
|
8096
|
-
exports.
|
|
8106
|
+
exports.delimiter = /(?=[\\!@#$&"`\[\](){}<>()[]{}*%|\r\n]|([+~=])\1|\/{3}|\s(?:\\?(?:$|\s)|[$%])|:\/\/)/g;
|
|
8097
8107
|
exports.nonWhitespace = /[\S\r\n]/g;
|
|
8098
|
-
exports.nonAlphanumeric = /[^0-9A-Za-z]/g;
|
|
8099
|
-
exports.ASCII = /[\x00-\x7F()[]{}]/g;
|
|
8100
8108
|
const text = input => {
|
|
8101
8109
|
const {
|
|
8102
8110
|
context
|
|
@@ -8130,11 +8138,9 @@ const text = input => {
|
|
|
8130
8138
|
return [[(0, dom_1.html)('br')]];
|
|
8131
8139
|
default:
|
|
8132
8140
|
if (context.sequential) return [[char]];
|
|
8133
|
-
exports.nonAlphanumeric.lastIndex = position + 1;
|
|
8134
8141
|
exports.nonWhitespace.lastIndex = position + 1;
|
|
8135
|
-
exports.ASCII.lastIndex = position + 1;
|
|
8136
8142
|
const b = isBlank(source, position);
|
|
8137
|
-
let i = b ? exports.nonWhitespace.test(source) ? exports.nonWhitespace.lastIndex - 1 : source.length :
|
|
8143
|
+
let i = b ? exports.nonWhitespace.test(source) ? exports.nonWhitespace.lastIndex - 1 : source.length : next(source, position, exports.delimiter);
|
|
8138
8144
|
const lineend = false || b && i === source.length || b && source[i] === '\n' || b && source[i] === '\\' && source[i + 1] === '\n';
|
|
8139
8145
|
i -= position;
|
|
8140
8146
|
i = lineend ? i : i - +b || 1;
|
|
@@ -8149,6 +8155,80 @@ const text = input => {
|
|
|
8149
8155
|
exports.text = text;
|
|
8150
8156
|
exports.txt = (0, combinator_1.union)([exports.text]);
|
|
8151
8157
|
exports.linebreak = (0, combinator_1.focus)(/[\r\n]/y, (0, combinator_1.union)([exports.text]));
|
|
8158
|
+
function next(source, position, delimiter) {
|
|
8159
|
+
delimiter.lastIndex = position + 1;
|
|
8160
|
+
delimiter.test(source);
|
|
8161
|
+
let index = delimiter.lastIndex;
|
|
8162
|
+
if (index === 0) return source.length;
|
|
8163
|
+
const char = source[index];
|
|
8164
|
+
switch (char) {
|
|
8165
|
+
case ':':
|
|
8166
|
+
index = backToUrlHead(source, position, index);
|
|
8167
|
+
break;
|
|
8168
|
+
case '@':
|
|
8169
|
+
index = backToEmailHead(source, position, index);
|
|
8170
|
+
break;
|
|
8171
|
+
}
|
|
8172
|
+
return index;
|
|
8173
|
+
}
|
|
8174
|
+
exports.next = next;
|
|
8175
|
+
function backToUrlHead(source, position, index) {
|
|
8176
|
+
const delim = index;
|
|
8177
|
+
let state = false;
|
|
8178
|
+
let offset = 0;
|
|
8179
|
+
for (let i = index; --i > position;) {
|
|
8180
|
+
index = i;
|
|
8181
|
+
const char = source[i];
|
|
8182
|
+
if (state) switch (char) {
|
|
8183
|
+
case '.':
|
|
8184
|
+
case '+':
|
|
8185
|
+
case '-':
|
|
8186
|
+
state = false;
|
|
8187
|
+
offset = 1;
|
|
8188
|
+
continue;
|
|
8189
|
+
}
|
|
8190
|
+
if (isAlphanumeric(char)) {
|
|
8191
|
+
state = true;
|
|
8192
|
+
offset = 0;
|
|
8193
|
+
continue;
|
|
8194
|
+
}
|
|
8195
|
+
break;
|
|
8196
|
+
}
|
|
8197
|
+
if (index === position + 1 && offset === 0 && isAlphanumeric(source[index - 1])) {
|
|
8198
|
+
return delim;
|
|
8199
|
+
}
|
|
8200
|
+
return index + offset;
|
|
8201
|
+
}
|
|
8202
|
+
exports.backToUrlHead = backToUrlHead;
|
|
8203
|
+
function backToEmailHead(source, position, index) {
|
|
8204
|
+
const delim = index;
|
|
8205
|
+
let state = false;
|
|
8206
|
+
let offset = 0;
|
|
8207
|
+
for (let i = index; --i > position;) {
|
|
8208
|
+
index = i;
|
|
8209
|
+
const char = source[i];
|
|
8210
|
+
if (state) switch (char) {
|
|
8211
|
+
case '_':
|
|
8212
|
+
case '.':
|
|
8213
|
+
case '+':
|
|
8214
|
+
case '-':
|
|
8215
|
+
state = false;
|
|
8216
|
+
offset = 1;
|
|
8217
|
+
continue;
|
|
8218
|
+
}
|
|
8219
|
+
if (isAlphanumeric(char)) {
|
|
8220
|
+
state = true;
|
|
8221
|
+
offset = 0;
|
|
8222
|
+
continue;
|
|
8223
|
+
}
|
|
8224
|
+
break;
|
|
8225
|
+
}
|
|
8226
|
+
if (index === position + 1 && offset === 0 && isAlphanumeric(source[index - 1])) {
|
|
8227
|
+
return delim;
|
|
8228
|
+
}
|
|
8229
|
+
return index + offset;
|
|
8230
|
+
}
|
|
8231
|
+
exports.backToEmailHead = backToEmailHead;
|
|
8152
8232
|
const blank = /\s(?:$|\s|\\\n)/y;
|
|
8153
8233
|
function isBlank(source, position) {
|
|
8154
8234
|
blank.lastIndex = position;
|
|
@@ -8159,11 +8239,6 @@ function isAlphanumeric(char) {
|
|
|
8159
8239
|
if (char < '0' || '\x7F' < char) return false;
|
|
8160
8240
|
return '0' <= char && char <= '9' || 'a' <= char && char <= 'z' || 'A' <= char && char <= 'Z';
|
|
8161
8241
|
}
|
|
8162
|
-
exports.isAlphanumeric = isAlphanumeric;
|
|
8163
|
-
function isASCII(char) {
|
|
8164
|
-
return char <= '\x7F' || char === '(' || char === ')' || char === '[' || char === ']' || char === '{' || char === '}';
|
|
8165
|
-
}
|
|
8166
|
-
exports.isASCII = isASCII;
|
|
8167
8242
|
|
|
8168
8243
|
/***/ },
|
|
8169
8244
|
|
|
@@ -8176,10 +8251,11 @@ exports.isASCII = isASCII;
|
|
|
8176
8251
|
Object.defineProperty(exports, "__esModule", ({
|
|
8177
8252
|
value: true
|
|
8178
8253
|
}));
|
|
8179
|
-
exports.unescsource = void 0;
|
|
8254
|
+
exports.unescsource = exports.delimiter = void 0;
|
|
8180
8255
|
const combinator_1 = __webpack_require__(3484);
|
|
8181
8256
|
const text_1 = __webpack_require__(5655);
|
|
8182
8257
|
const dom_1 = __webpack_require__(394);
|
|
8258
|
+
exports.delimiter = /(?=(?=[\x00-\x7F])[^0-9A-Za-z]|(?<=[\x00-\x7F])[^\x00-\x7F])/g;
|
|
8183
8259
|
const unescsource = ({
|
|
8184
8260
|
context
|
|
8185
8261
|
}) => {
|
|
@@ -8204,11 +8280,9 @@ const unescsource = ({
|
|
|
8204
8280
|
return [[(0, dom_1.html)('br')]];
|
|
8205
8281
|
default:
|
|
8206
8282
|
if (context.sequential) return [[char]];
|
|
8207
|
-
text_1.nonAlphanumeric.lastIndex = position + 1;
|
|
8208
8283
|
text_1.nonWhitespace.lastIndex = position + 1;
|
|
8209
|
-
text_1.ASCII.lastIndex = position + 1;
|
|
8210
8284
|
const b = (0, text_1.isBlank)(source, position);
|
|
8211
|
-
let i = b ? text_1.nonWhitespace.test(source) ? text_1.nonWhitespace.lastIndex - 1 : source.length : (0, text_1.
|
|
8285
|
+
let i = b ? text_1.nonWhitespace.test(source) ? text_1.nonWhitespace.lastIndex - 1 : source.length : (0, text_1.next)(source, position, exports.delimiter);
|
|
8212
8286
|
i -= position;
|
|
8213
8287
|
(0, combinator_1.consume)(i - 1, context);
|
|
8214
8288
|
context.position += i - 1;
|
|
@@ -8362,35 +8436,19 @@ exports.trimBlankNodeEnd = exports.trimBlankEnd = exports.trimBlankStart = expor
|
|
|
8362
8436
|
const parser_1 = __webpack_require__(605);
|
|
8363
8437
|
const combinator_1 = __webpack_require__(3484);
|
|
8364
8438
|
const htmlentity_1 = __webpack_require__(470);
|
|
8365
|
-
const source_1 = __webpack_require__(8745);
|
|
8366
8439
|
const normalize_1 = __webpack_require__(4490);
|
|
8367
8440
|
const array_1 = __webpack_require__(6876);
|
|
8368
8441
|
var blank;
|
|
8369
8442
|
(function (blank) {
|
|
8370
|
-
blank.line = new RegExp(
|
|
8443
|
+
blank.line = new RegExp(
|
|
8444
|
+
// TODO: 行全体をエスケープ
|
|
8445
|
+
/^(?:[^\S\r\n])*(?!\s)(\\?[^\S\r\n]|&IHN;|<wbr[^\S\n]*>|\\$)+$/mg.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'gm');
|
|
8371
8446
|
blank.start = new RegExp(/(?:\\?[^\S\r\n]|&IHN;|<wbr[^\S\n]*>)+/y.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'y');
|
|
8372
8447
|
})(blank || (exports.blank = blank = {}));
|
|
8373
8448
|
function visualize(parser) {
|
|
8374
|
-
return (0, combinator_1.
|
|
8375
|
-
source,
|
|
8376
|
-
position
|
|
8377
|
-
}) => position === source.length && hasVisible(ns)), false), (0, combinator_1.some)((0, combinator_1.union)([source_1.linebreak, source_1.unescsource]))]);
|
|
8449
|
+
return (0, combinator_1.convert)(source => source.replace(blank.line, `${"\u001B" /* Command.Escape */}$1`), parser, false);
|
|
8378
8450
|
}
|
|
8379
8451
|
exports.visualize = visualize;
|
|
8380
|
-
function hasVisible(nodes) {
|
|
8381
|
-
for (let i = 0; i < nodes.length; ++i) {
|
|
8382
|
-
const node = nodes[i];
|
|
8383
|
-
if (typeof node === 'string') {
|
|
8384
|
-
if (node && node.trimStart()) return true;
|
|
8385
|
-
} else {
|
|
8386
|
-
if (node.innerText.trimStart()) return true;
|
|
8387
|
-
if (node.classList.contains('reference')) return true;
|
|
8388
|
-
//if (state & State.media ^ State.media &&
|
|
8389
|
-
// (node.classList.contains('media') || node.getElementsByClassName('media')[0])) return true;
|
|
8390
|
-
}
|
|
8391
|
-
}
|
|
8392
|
-
return false;
|
|
8393
|
-
}
|
|
8394
8452
|
function blankWith(starts, delimiter) {
|
|
8395
8453
|
if (delimiter === undefined) return blankWith('', starts);
|
|
8396
8454
|
return new RegExp(String.raw`(?:(?=${starts})(?:\\?\s|&(?:${normalize_1.invisibleHTMLEntityNames.join('|')});|<wbr[^\S\n]*>)${
|
|
@@ -8403,6 +8461,7 @@ function tightStart(parser, except) {
|
|
|
8403
8461
|
return input => isTightStart(input, except) ? parser(input) : undefined;
|
|
8404
8462
|
}
|
|
8405
8463
|
exports.tightStart = tightStart;
|
|
8464
|
+
const wbr = /<wbr[^\S\n]*>/y;
|
|
8406
8465
|
function isTightStart(input, except) {
|
|
8407
8466
|
const {
|
|
8408
8467
|
context
|
|
@@ -8430,8 +8489,9 @@ function isTightStart(input, except) {
|
|
|
8430
8489
|
context.position = position;
|
|
8431
8490
|
return true;
|
|
8432
8491
|
case '<':
|
|
8492
|
+
wbr.lastIndex = position;
|
|
8433
8493
|
switch (true) {
|
|
8434
|
-
case source.length - position >= 5 && source.startsWith('<wbr', position) && (source[position + 5] === '>' ||
|
|
8494
|
+
case source.length - position >= 5 && source.startsWith('<wbr', position) && (source[position + 5] === '>' || wbr.test(source)):
|
|
8435
8495
|
return false;
|
|
8436
8496
|
}
|
|
8437
8497
|
return true;
|
|
@@ -8494,11 +8554,12 @@ function trimBlankStart(parser) {
|
|
|
8494
8554
|
source,
|
|
8495
8555
|
position
|
|
8496
8556
|
} = context;
|
|
8557
|
+
if (position === source.length) return;
|
|
8497
8558
|
const reg = blank.start;
|
|
8498
8559
|
reg.lastIndex = position;
|
|
8499
8560
|
reg.test(source);
|
|
8500
8561
|
context.position = reg.lastIndex || position;
|
|
8501
|
-
return parser(input);
|
|
8562
|
+
return context.position === source.length ? [[]] : parser(input);
|
|
8502
8563
|
});
|
|
8503
8564
|
}
|
|
8504
8565
|
exports.trimBlankStart = trimBlankStart;
|