securemark 0.249.1 → 0.252.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/index.js +120 -141
- package/markdown.d.ts +9 -19
- package/package.json +3 -3
- package/src/combinator/control/manipulation/indent.ts +15 -12
- package/src/combinator/control/manipulation/match.ts +2 -3
- package/src/parser/api/parse.test.ts +12 -6
- package/src/parser/block/blockquote.test.ts +2 -2
- package/src/parser/block/dlist.test.ts +2 -1
- package/src/parser/block/dlist.ts +4 -4
- package/src/parser/block/extension/figure.ts +5 -7
- package/src/parser/block/extension/message.ts +0 -2
- package/src/parser/block/heading.test.ts +1 -0
- package/src/parser/block/heading.ts +4 -4
- package/src/parser/block/olist.ts +7 -6
- package/src/parser/block/paragraph.test.ts +10 -10
- package/src/parser/block/paragraph.ts +2 -2
- package/src/parser/block/reply.ts +2 -2
- package/src/parser/block/ulist.ts +4 -3
- package/src/parser/block.ts +0 -3
- package/src/parser/inline/annotation.ts +2 -2
- package/src/parser/inline/code.ts +1 -1
- package/src/parser/inline/comment.test.ts +44 -44
- package/src/parser/inline/comment.ts +2 -2
- package/src/parser/inline/extension/index.test.ts +4 -4
- package/src/parser/inline/extension/index.ts +4 -5
- package/src/parser/inline/extension/placeholder.test.ts +4 -4
- package/src/parser/inline/html.ts +3 -3
- package/src/parser/inline/link.ts +2 -2
- package/src/parser/inline/reference.test.ts +3 -3
- package/src/parser/inline/reference.ts +6 -6
- package/src/parser/inline.test.ts +2 -2
- package/src/parser/source/str.ts +2 -2
- package/src/parser/util.ts +15 -11
- package/src/parser/block/indentblock.test.ts +0 -30
- package/src/parser/block/indentblock.ts +0 -13
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.
|
|
1
|
+
/*! securemark v0.252.0 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory(require("DOMPurify"), require("Prism"));
|
|
@@ -386,7 +386,7 @@ class Cache {
|
|
|
386
386
|
LRU: new invlist_1.List(),
|
|
387
387
|
LFU: new invlist_1.List()
|
|
388
388
|
};
|
|
389
|
-
this.expiries = new heap_1.Heap();
|
|
389
|
+
this.expiries = new heap_1.Heap((a, b) => a.value.expiry - b.value.expiry);
|
|
390
390
|
this.stats = {
|
|
391
391
|
LRU: (0, tuple_1.tuple)(0, 0),
|
|
392
392
|
LFU: (0, tuple_1.tuple)(0, 0),
|
|
@@ -439,15 +439,15 @@ class Cache {
|
|
|
439
439
|
return this.SIZE;
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
-
evict(node,
|
|
442
|
+
evict(node, callback) {
|
|
443
443
|
const index = node.value;
|
|
444
444
|
callback &&= !!this.disposer;
|
|
445
|
-
record = callback ? record ?? this.memory.get(index.key) : record;
|
|
446
445
|
this.overlap -= +(index.region === 'LFU' && node.list === this.indexes.LRU);
|
|
446
|
+
index.enode && this.expiries.delete(index.enode);
|
|
447
447
|
node.delete();
|
|
448
448
|
this.memory.delete(index.key);
|
|
449
449
|
this.SIZE -= index.size;
|
|
450
|
-
callback && this.disposer?.(
|
|
450
|
+
callback && this.disposer?.(node.value.value, index.key);
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
ensure(margin, skip) {
|
|
@@ -463,7 +463,6 @@ class Cache {
|
|
|
463
463
|
|
|
464
464
|
switch (true) {
|
|
465
465
|
case (target = this.expiries.peek()) && target !== skip && target.value.expiry < (0, clock_1.now)():
|
|
466
|
-
target = this.expiries.extract();
|
|
467
466
|
break;
|
|
468
467
|
|
|
469
468
|
case LRU.length === 0:
|
|
@@ -486,7 +485,7 @@ class Cache {
|
|
|
486
485
|
target = LRU.last !== skip ? LRU.last : LRU.length >= 2 ? LRU.last.prev : LFU.last;
|
|
487
486
|
}
|
|
488
487
|
|
|
489
|
-
this.evict(target,
|
|
488
|
+
this.evict(target, true);
|
|
490
489
|
skip = skip?.list && skip;
|
|
491
490
|
size = skip?.value.size ?? 0;
|
|
492
491
|
}
|
|
@@ -502,11 +501,10 @@ class Cache {
|
|
|
502
501
|
}
|
|
503
502
|
|
|
504
503
|
const expiry = age === global_1.Infinity ? global_1.Infinity : (0, clock_1.now)() + age;
|
|
505
|
-
const
|
|
504
|
+
const node = this.memory.get(key);
|
|
506
505
|
|
|
507
|
-
if (
|
|
508
|
-
const
|
|
509
|
-
const val = record.value;
|
|
506
|
+
if (node) {
|
|
507
|
+
const val = node.value.value;
|
|
510
508
|
const index = node.value;
|
|
511
509
|
this.ensure(size, node);
|
|
512
510
|
this.SIZE += size - index.size;
|
|
@@ -514,13 +512,13 @@ class Cache {
|
|
|
514
512
|
index.expiry = expiry;
|
|
515
513
|
|
|
516
514
|
if (this.earlyExpiring && expiry !== global_1.Infinity) {
|
|
517
|
-
index.enode ? this.expiries.update(index.enode
|
|
515
|
+
index.enode ? this.expiries.update(index.enode) : index.enode = this.expiries.insert(node);
|
|
518
516
|
} else if (index.enode) {
|
|
519
517
|
this.expiries.delete(index.enode);
|
|
520
518
|
index.enode = void 0;
|
|
521
519
|
}
|
|
522
520
|
|
|
523
|
-
|
|
521
|
+
node.value.value = value;
|
|
524
522
|
this.disposer?.(val, key);
|
|
525
523
|
return true;
|
|
526
524
|
}
|
|
@@ -530,19 +528,16 @@ class Cache {
|
|
|
530
528
|
LRU
|
|
531
529
|
} = this.indexes;
|
|
532
530
|
this.SIZE += size;
|
|
533
|
-
|
|
531
|
+
this.memory.set(key, LRU.unshift({
|
|
534
532
|
key,
|
|
533
|
+
value,
|
|
535
534
|
size,
|
|
536
535
|
expiry,
|
|
537
536
|
region: 'LRU'
|
|
538
|
-
});
|
|
539
|
-
this.memory.set(key, {
|
|
540
|
-
inode: node,
|
|
541
|
-
value
|
|
542
|
-
});
|
|
537
|
+
}));
|
|
543
538
|
|
|
544
539
|
if (this.earlyExpiring && expiry !== global_1.Infinity) {
|
|
545
|
-
|
|
540
|
+
LRU.head.value.enode = this.expiries.insert(LRU.head);
|
|
546
541
|
}
|
|
547
542
|
|
|
548
543
|
return false;
|
|
@@ -554,32 +549,31 @@ class Cache {
|
|
|
554
549
|
}
|
|
555
550
|
|
|
556
551
|
get(key) {
|
|
557
|
-
const
|
|
558
|
-
if (!
|
|
559
|
-
const node = record.inode;
|
|
552
|
+
const node = this.memory.get(key);
|
|
553
|
+
if (!node) return;
|
|
560
554
|
const expiry = node.value.expiry;
|
|
561
555
|
|
|
562
556
|
if (expiry !== global_1.Infinity && expiry < (0, clock_1.now)()) {
|
|
563
|
-
this.evict(node,
|
|
557
|
+
this.evict(node, true);
|
|
564
558
|
return;
|
|
565
559
|
} // Optimization for memoize.
|
|
566
560
|
|
|
567
561
|
|
|
568
|
-
if (this.capacity > 3 && node === node.list.head) return
|
|
562
|
+
if (this.capacity > 3 && node === node.list.head) return node.value.value;
|
|
569
563
|
this.access(node);
|
|
570
564
|
this.slide();
|
|
571
|
-
return
|
|
565
|
+
return node.value.value;
|
|
572
566
|
}
|
|
573
567
|
|
|
574
568
|
has(key) {
|
|
575
569
|
//assert(this.memory.has(key) === (this.indexes.LFU.has(key) || this.indexes.LRU.has(key)));
|
|
576
570
|
//assert(this.memory.size === this.indexes.LFU.length + this.indexes.LRU.length);
|
|
577
|
-
const
|
|
578
|
-
if (!
|
|
579
|
-
const expiry =
|
|
571
|
+
const node = this.memory.get(key);
|
|
572
|
+
if (!node) return false;
|
|
573
|
+
const expiry = node.value.expiry;
|
|
580
574
|
|
|
581
575
|
if (expiry !== global_1.Infinity && expiry < (0, clock_1.now)()) {
|
|
582
|
-
this.evict(
|
|
576
|
+
this.evict(node, true);
|
|
583
577
|
return false;
|
|
584
578
|
}
|
|
585
579
|
|
|
@@ -587,9 +581,9 @@ class Cache {
|
|
|
587
581
|
}
|
|
588
582
|
|
|
589
583
|
delete(key) {
|
|
590
|
-
const
|
|
591
|
-
if (!
|
|
592
|
-
this.evict(
|
|
584
|
+
const node = this.memory.get(key);
|
|
585
|
+
if (!node) return false;
|
|
586
|
+
this.evict(node, this.settings.capture.delete === true);
|
|
593
587
|
return true;
|
|
594
588
|
}
|
|
595
589
|
|
|
@@ -606,7 +600,9 @@ class Cache {
|
|
|
606
600
|
this.memory = new global_1.Map();
|
|
607
601
|
|
|
608
602
|
for (const [key, {
|
|
609
|
-
value
|
|
603
|
+
value: {
|
|
604
|
+
value
|
|
605
|
+
}
|
|
610
606
|
}] of memory) {
|
|
611
607
|
this.disposer(value, key);
|
|
612
608
|
}
|
|
@@ -614,7 +610,9 @@ class Cache {
|
|
|
614
610
|
|
|
615
611
|
*[Symbol.iterator]() {
|
|
616
612
|
for (const [key, {
|
|
617
|
-
value
|
|
613
|
+
value: {
|
|
614
|
+
value
|
|
615
|
+
}
|
|
618
616
|
}] of this.memory) {
|
|
619
617
|
yield [key, value];
|
|
620
618
|
}
|
|
@@ -634,8 +632,9 @@ class Cache {
|
|
|
634
632
|
indexes
|
|
635
633
|
} = this;
|
|
636
634
|
const window = capacity;
|
|
637
|
-
LRU[0] + LFU[0]
|
|
638
|
-
|
|
635
|
+
const total = LRU[0] + LFU[0];
|
|
636
|
+
total === window && this.stats.slide();
|
|
637
|
+
if (total * 1000 % capacity || !LRU[1] || !LFU[1]) return;
|
|
639
638
|
const lenR = indexes.LRU.length;
|
|
640
639
|
const lenF = indexes.LFU.length;
|
|
641
640
|
const lenV = this.overlap;
|
|
@@ -942,13 +941,14 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
942
941
|
}));
|
|
943
942
|
exports.Heap = void 0;
|
|
944
943
|
|
|
945
|
-
const alias_1 = __webpack_require__(5406); //
|
|
944
|
+
const alias_1 = __webpack_require__(5406); // Min heap
|
|
946
945
|
|
|
947
946
|
|
|
948
947
|
const undefined = void 0;
|
|
949
948
|
|
|
950
949
|
class Heap {
|
|
951
|
-
constructor(stable = false) {
|
|
950
|
+
constructor(cmp = (a, b) => a > b ? 1 : a < b ? -1 : 0, stable = false) {
|
|
951
|
+
this.cmp = cmp;
|
|
952
952
|
this.stable = stable;
|
|
953
953
|
this.array = [];
|
|
954
954
|
this.$length = 0;
|
|
@@ -958,19 +958,19 @@ class Heap {
|
|
|
958
958
|
return this.$length;
|
|
959
959
|
}
|
|
960
960
|
|
|
961
|
-
insert(
|
|
961
|
+
insert(value, order = value) {
|
|
962
962
|
const array = this.array;
|
|
963
|
-
const node = array[this.$length] = [
|
|
964
|
-
upHeapify(array, this.$length);
|
|
963
|
+
const node = array[this.$length] = [order, value, this.$length++];
|
|
964
|
+
upHeapify(array, this.cmp, this.$length);
|
|
965
965
|
return node;
|
|
966
966
|
}
|
|
967
967
|
|
|
968
|
-
replace(
|
|
968
|
+
replace(value, order = value) {
|
|
969
969
|
const array = this.array;
|
|
970
|
-
if (this.$length === 0) return void this.insert(
|
|
970
|
+
if (this.$length === 0) return void this.insert(value, order);
|
|
971
971
|
const replaced = array[0][1];
|
|
972
|
-
array[0] = [
|
|
973
|
-
downHeapify(array, 1, this.$length, this.stable);
|
|
972
|
+
array[0] = [order, value, 0];
|
|
973
|
+
downHeapify(array, this.cmp, 1, this.$length, this.stable);
|
|
974
974
|
return replaced;
|
|
975
975
|
}
|
|
976
976
|
|
|
@@ -990,25 +990,24 @@ class Heap {
|
|
|
990
990
|
array[this.$length] = undefined;
|
|
991
991
|
index < this.$length && this.sort(array[index]);
|
|
992
992
|
|
|
993
|
-
if (array.length
|
|
994
|
-
array.splice(array.length / 2, array.length);
|
|
993
|
+
if (array.length >= 2 ** 16 && array.length >= this.$length * 2) {
|
|
994
|
+
array.splice(array.length / 2, array.length / 2);
|
|
995
995
|
}
|
|
996
996
|
|
|
997
997
|
return node[1];
|
|
998
998
|
}
|
|
999
999
|
|
|
1000
|
-
update(node,
|
|
1000
|
+
update(node, order = node[1], value = node[1]) {
|
|
1001
1001
|
const array = this.array;
|
|
1002
1002
|
if (array[node[2]] !== node) throw new Error('Invalid node');
|
|
1003
1003
|
node[1] = value;
|
|
1004
|
-
if (node[0] ===
|
|
1005
|
-
node[0] = priority;
|
|
1004
|
+
if (this.cmp(node[0], node[0] = order) === 0) return;
|
|
1006
1005
|
this.sort(node);
|
|
1007
1006
|
}
|
|
1008
1007
|
|
|
1009
1008
|
sort(node) {
|
|
1010
1009
|
const array = this.array;
|
|
1011
|
-
return upHeapify(array, node[2] + 1) || downHeapify(array, node[2] + 1, this.$length, this.stable);
|
|
1010
|
+
return upHeapify(array, this.cmp, node[2] + 1) || downHeapify(array, this.cmp, node[2] + 1, this.$length, this.stable);
|
|
1012
1011
|
}
|
|
1013
1012
|
|
|
1014
1013
|
peek() {
|
|
@@ -1024,13 +1023,13 @@ class Heap {
|
|
|
1024
1023
|
|
|
1025
1024
|
exports.Heap = Heap;
|
|
1026
1025
|
|
|
1027
|
-
function upHeapify(array, index) {
|
|
1028
|
-
const
|
|
1026
|
+
function upHeapify(array, cmp, index) {
|
|
1027
|
+
const order = array[index - 1][0];
|
|
1029
1028
|
let changed = false;
|
|
1030
1029
|
|
|
1031
1030
|
while (index > 1) {
|
|
1032
1031
|
const parent = (0, alias_1.floor)(index / 2);
|
|
1033
|
-
if (array[parent - 1][0]
|
|
1032
|
+
if (cmp(array[parent - 1][0], order) <= 0) break;
|
|
1034
1033
|
swap(array, index - 1, parent - 1);
|
|
1035
1034
|
index = parent;
|
|
1036
1035
|
changed ||= true;
|
|
@@ -1039,25 +1038,25 @@ function upHeapify(array, index) {
|
|
|
1039
1038
|
return changed;
|
|
1040
1039
|
}
|
|
1041
1040
|
|
|
1042
|
-
function downHeapify(array, index, length, stable) {
|
|
1041
|
+
function downHeapify(array, cmp, index, length, stable) {
|
|
1043
1042
|
let changed = false;
|
|
1044
1043
|
|
|
1045
1044
|
while (index < length) {
|
|
1046
1045
|
const left = index * 2;
|
|
1047
1046
|
const right = index * 2 + 1;
|
|
1048
|
-
let
|
|
1047
|
+
let min = index;
|
|
1049
1048
|
|
|
1050
|
-
if (left <= length && (stable ? array[left - 1][0]
|
|
1051
|
-
|
|
1049
|
+
if (left <= length && (stable ? cmp(array[left - 1][0], array[min - 1][0]) <= 0 : cmp(array[left - 1][0], array[min - 1][0]) < 0)) {
|
|
1050
|
+
min = left;
|
|
1052
1051
|
}
|
|
1053
1052
|
|
|
1054
|
-
if (right <= length && (stable ? array[right - 1][0]
|
|
1055
|
-
|
|
1053
|
+
if (right <= length && (stable ? cmp(array[right - 1][0], array[min - 1][0]) <= 0 : cmp(array[right - 1][0], array[min - 1][0]) < 0)) {
|
|
1054
|
+
min = right;
|
|
1056
1055
|
}
|
|
1057
1056
|
|
|
1058
|
-
if (
|
|
1059
|
-
swap(array, index - 1,
|
|
1060
|
-
index =
|
|
1057
|
+
if (min === index) break;
|
|
1058
|
+
swap(array, index - 1, min - 1);
|
|
1059
|
+
index = min;
|
|
1061
1060
|
changed ||= true;
|
|
1062
1061
|
}
|
|
1063
1062
|
|
|
@@ -2338,17 +2337,18 @@ const surround_1 = __webpack_require__(7130);
|
|
|
2338
2337
|
|
|
2339
2338
|
const memoize_1 = __webpack_require__(1808);
|
|
2340
2339
|
|
|
2341
|
-
function indent(parser, separation = false) {
|
|
2342
|
-
|
|
2343
|
-
|
|
2340
|
+
function indent(opener, parser, separation = false) {
|
|
2341
|
+
if (typeof opener === 'function') return indent(/^([ \t])\1*/, opener, parser);
|
|
2342
|
+
return (0, bind_1.bind)((0, block_1.block)((0, match_1.match)(opener, (0, memoize_1.memoize)(([indent]) => (0, some_1.some)((0, line_1.line)((0, surround_1.open)(indent, source => [[source], '']))), ([indent]) => indent.length * 2 + +(indent[0] === ' '), [])), separation), (lines, rest, context) => {
|
|
2343
|
+
const result = parser(trimBlockEnd(lines.join('')), context);
|
|
2344
2344
|
return result && (0, parser_1.exec)(result) === '' ? [(0, parser_1.eval)(result), rest] : global_1.undefined;
|
|
2345
2345
|
});
|
|
2346
2346
|
}
|
|
2347
2347
|
|
|
2348
2348
|
exports.indent = indent;
|
|
2349
2349
|
|
|
2350
|
-
function
|
|
2351
|
-
return
|
|
2350
|
+
function trimBlockEnd(block) {
|
|
2351
|
+
return block === '' || block[block.length - 1] !== '\n' ? block : block.slice(0, -1);
|
|
2352
2352
|
}
|
|
2353
2353
|
|
|
2354
2354
|
/***/ }),
|
|
@@ -2393,10 +2393,9 @@ function match(pattern, f) {
|
|
|
2393
2393
|
if (source === '') return;
|
|
2394
2394
|
const param = source.match(pattern);
|
|
2395
2395
|
if (!param) return;
|
|
2396
|
-
const
|
|
2397
|
-
const result = f(param)(rest, context);
|
|
2396
|
+
const result = f(param)(source, context);
|
|
2398
2397
|
if (!result) return;
|
|
2399
|
-
return (0, parser_1.exec)(result).length < source.length && (0, parser_1.exec)(result).length <=
|
|
2398
|
+
return (0, parser_1.exec)(result).length < source.length && (0, parser_1.exec)(result).length <= source.length ? result : global_1.undefined;
|
|
2400
2399
|
};
|
|
2401
2400
|
}
|
|
2402
2401
|
|
|
@@ -3633,8 +3632,6 @@ const dlist_1 = __webpack_require__(9373);
|
|
|
3633
3632
|
|
|
3634
3633
|
const table_1 = __webpack_require__(8717);
|
|
3635
3634
|
|
|
3636
|
-
const indentblock_1 = __webpack_require__(3565);
|
|
3637
|
-
|
|
3638
3635
|
const codeblock_1 = __webpack_require__(1849);
|
|
3639
3636
|
|
|
3640
3637
|
const mathblock_1 = __webpack_require__(3754);
|
|
@@ -3658,7 +3655,7 @@ exports.block = (0, combinator_1.creator)(error((0, combinator_1.reset)({
|
|
|
3658
3655
|
budget: 100 * 1000,
|
|
3659
3656
|
recursion: 200
|
|
3660
3657
|
}
|
|
3661
|
-
}, (0, combinator_1.union)([source_1.emptyline, horizontalrule_1.horizontalrule, heading_1.heading, ulist_1.ulist, olist_1.olist, ilist_1.ilist, dlist_1.dlist, table_1.table,
|
|
3658
|
+
}, (0, combinator_1.union)([source_1.emptyline, horizontalrule_1.horizontalrule, heading_1.heading, ulist_1.ulist, olist_1.olist, ilist_1.ilist, dlist_1.dlist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, extension_1.extension, sidefence_1.sidefence, blockquote_1.blockquote, reply_1.reply, paragraph_1.paragraph]))));
|
|
3662
3659
|
|
|
3663
3660
|
function error(parser) {
|
|
3664
3661
|
return (0, combinator_1.recover)((0, combinator_1.fallback)((0, combinator_1.open)('\x07', source => {
|
|
@@ -3833,8 +3830,8 @@ exports.dlist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, locale_
|
|
|
3833
3830
|
}
|
|
3834
3831
|
}
|
|
3835
3832
|
}, (0, combinator_1.some)(term)), (0, combinator_1.some)(desc)]))), es => [(0, dom_1.html)('dl', fillTrailingDescription(es))]))));
|
|
3836
|
-
const term = (0, combinator_1.creator)((0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.open)(/^~[^\S\n]+(?=\S)/, (0,
|
|
3837
|
-
const desc = (0, combinator_1.creator)((0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)(/^:[^\S\n]+(?=\S)|/, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, /^[~:][^\S\n]+\S/), (0,
|
|
3833
|
+
const term = (0, combinator_1.creator)((0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.open)(/^~[^\S\n]+(?=\S)/, (0, util_1.visualize)((0, util_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), ns => [(0, dom_1.html)('dt', (0, dom_1.defrag)(ns))]))));
|
|
3834
|
+
const desc = (0, combinator_1.creator)((0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)(/^:[^\S\n]+(?=\S)|/, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, /^[~:][^\S\n]+\S/), (0, util_1.visualize)((0, combinator_1.trimEnd)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('dd', (0, dom_1.defrag)(ns))]), false));
|
|
3838
3835
|
|
|
3839
3836
|
function fillTrailingDescription(es) {
|
|
3840
3837
|
return es.length > 0 && es[es.length - 1].tagName === 'DT' ? (0, array_1.push)(es, [(0, dom_1.html)('dd')]) : es;
|
|
@@ -4103,8 +4100,6 @@ const olist_1 = __webpack_require__(7471);
|
|
|
4103
4100
|
|
|
4104
4101
|
const table_1 = __webpack_require__(8717);
|
|
4105
4102
|
|
|
4106
|
-
const indentblock_1 = __webpack_require__(3565);
|
|
4107
|
-
|
|
4108
4103
|
const codeblock_1 = __webpack_require__(1849);
|
|
4109
4104
|
|
|
4110
4105
|
const mathblock_1 = __webpack_require__(3754);
|
|
@@ -4129,15 +4124,15 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
4129
4124
|
|
|
4130
4125
|
const array_1 = __webpack_require__(8112);
|
|
4131
4126
|
|
|
4132
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.match)(/^(~{3,})(?:figure[^\S\n]
|
|
4127
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.match)(/^(~{3,})(?:figure[^\S\n])?(?=\[?\$)/, (0, memoize_1.memoize)(([, fence], closer = new RegExp(String.raw`^${fence}[^\S\n]*(?:$|\n)`)) => (0, combinator_1.close)((0, combinator_1.sequence)([source_1.contentline, (0, combinator_1.inits)([// All parsers which can include closing terms.
|
|
4133
4128
|
(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, [])));
|
|
4134
|
-
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(/^~+(
|
|
4129
|
+
exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:\w+\s+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.sequence)([label_1.label, (0, source_1.str)(/^(?=\s).*\n/)])), (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([ulist_1.ulist, olist_1.olist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, example_1.example, table_2.table, blockquote_1.blockquote, placeholder_1.placeholder, (0, combinator_1.line)(inline_1.media), (0, combinator_1.line)(inline_1.shortmedia)])), source_1.emptyline, (0, combinator_1.block)((0, locale_1.localize)((0, combinator_1.context)({
|
|
4135
4130
|
syntax: {
|
|
4136
4131
|
inline: {
|
|
4137
4132
|
media: false
|
|
4138
4133
|
}
|
|
4139
4134
|
}
|
|
4140
|
-
}, (0,
|
|
4135
|
+
}, (0, util_1.visualize)((0, util_1.trimBlank)((0, combinator_1.trimEnd)((0, combinator_1.some)(inline_1.inline)))))))])])), ([label, param, content, ...caption]) => [(0, dom_1.html)('figure', attributes(label.getAttribute('data-label'), param, content, caption), [(0, dom_1.html)('figcaption', (0, array_1.unshift)([(0, dom_1.html)('span', {
|
|
4141
4136
|
class: 'figindex'
|
|
4142
4137
|
})], (0, dom_1.defrag)(caption))), (0, dom_1.html)('div', [content])])])), (0, combinator_1.fmap)((0, combinator_1.fence)(/^(~{3,})(?:figure|\[?\$\S*)(?!\S)[^\n]*(?:$|\n)/, 300), ([body, overflow, closer, opener, delim], _, context) => [(0, dom_1.html)('pre', {
|
|
4143
4138
|
class: 'invalid',
|
|
@@ -4266,8 +4261,6 @@ const ilist_1 = __webpack_require__(238);
|
|
|
4266
4261
|
|
|
4267
4262
|
const table_1 = __webpack_require__(8717);
|
|
4268
4263
|
|
|
4269
|
-
const indentblock_1 = __webpack_require__(3565);
|
|
4270
|
-
|
|
4271
4264
|
const codeblock_1 = __webpack_require__(1849);
|
|
4272
4265
|
|
|
4273
4266
|
const mathblock_1 = __webpack_require__(3754);
|
|
@@ -4328,7 +4321,7 @@ function title(type) {
|
|
|
4328
4321
|
} // Must not have indexed blocks.
|
|
4329
4322
|
|
|
4330
4323
|
|
|
4331
|
-
const content = (0, combinator_1.union)([source_1.emptyline, ulist_1.ulist, olist_1.olist, ilist_1.ilist, table_1.table,
|
|
4324
|
+
const content = (0, combinator_1.union)([source_1.emptyline, ulist_1.ulist, olist_1.olist, ilist_1.ilist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, sidefence_1.sidefence, blockquote_1.blockquote, paragraph_1.paragraph]);
|
|
4332
4325
|
|
|
4333
4326
|
/***/ }),
|
|
4334
4327
|
|
|
@@ -4671,13 +4664,13 @@ exports.heading = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segm
|
|
|
4671
4664
|
media: false
|
|
4672
4665
|
}
|
|
4673
4666
|
}
|
|
4674
|
-
}, (0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.open)((0, source_1.str)(/^##+/), (0,
|
|
4667
|
+
}, (0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.open)((0, source_1.str)(/^##+/), (0, util_1.visualize)((0, util_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), (0, combinator_1.open)((0, source_1.str)('#'), (0, combinator_1.context)({
|
|
4675
4668
|
syntax: {
|
|
4676
4669
|
inline: {
|
|
4677
4670
|
autolink: false
|
|
4678
4671
|
}
|
|
4679
4672
|
}
|
|
4680
|
-
}, (0,
|
|
4673
|
+
}, (0, util_1.visualize)((0, util_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline]))))), true)]), ([h, ...ns]) => [h.length <= 6 ? (0, dom_1.html)(`h${h.length}`, (0, dom_1.defrag)(ns)) : (0, dom_1.html)(`h6`, {
|
|
4681
4674
|
class: 'invalid',
|
|
4682
4675
|
'data-invalid-syntax': 'heading',
|
|
4683
4676
|
'data-invalid-type': 'syntax',
|
|
@@ -4744,29 +4737,6 @@ exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combin
|
|
|
4744
4737
|
|
|
4745
4738
|
/***/ }),
|
|
4746
4739
|
|
|
4747
|
-
/***/ 3565:
|
|
4748
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4749
|
-
|
|
4750
|
-
"use strict";
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
4754
|
-
value: true
|
|
4755
|
-
}));
|
|
4756
|
-
exports.indentblock = void 0;
|
|
4757
|
-
|
|
4758
|
-
const combinator_1 = __webpack_require__(2087);
|
|
4759
|
-
|
|
4760
|
-
const codeblock_1 = __webpack_require__(1849); // 空行を含むインデントブロックはインデントの違いによるセグメント分割の境界が視認不能となるため採用しない
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
exports.indentblock = (0, combinator_1.block)((0, combinator_1.validate)(/^(?: |\t)/, (0, combinator_1.indent)((0, combinator_1.convert)(source => {
|
|
4764
|
-
const fence = (source.match(/^`{3,}(?=[^\S\n]*$)/mg) ?? []).reduce((max, fence) => fence > max ? fence : max, '``') + '`';
|
|
4765
|
-
return `${fence}\n${source}\n${fence}`;
|
|
4766
|
-
}, (0, combinator_1.union)([codeblock_1.codeblock])), true)));
|
|
4767
|
-
|
|
4768
|
-
/***/ }),
|
|
4769
|
-
|
|
4770
4740
|
/***/ 3754:
|
|
4771
4741
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4772
4742
|
|
|
@@ -4828,6 +4798,8 @@ const inline_1 = __webpack_require__(1160);
|
|
|
4828
4798
|
|
|
4829
4799
|
const source_1 = __webpack_require__(6743);
|
|
4830
4800
|
|
|
4801
|
+
const util_1 = __webpack_require__(9437);
|
|
4802
|
+
|
|
4831
4803
|
const dom_1 = __webpack_require__(3252);
|
|
4832
4804
|
|
|
4833
4805
|
const memoize_1 = __webpack_require__(1808);
|
|
@@ -4835,8 +4807,8 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
4835
4807
|
const array_1 = __webpack_require__(8112);
|
|
4836
4808
|
|
|
4837
4809
|
const openers = {
|
|
4838
|
-
'.': /^(
|
|
4839
|
-
'(': /^\((
|
|
4810
|
+
'.': /^([0-9]+|[a-z]+|[A-Z]+)(?:-(?!-)[0-9]*)*(?![^\S\n])\.?(?=$|\s)/,
|
|
4811
|
+
'(': /^\(([0-9]*|[a-z]*)(?![^)\n])\)?(?:-(?!-)[0-9]*)*(?=$|\s)/
|
|
4840
4812
|
};
|
|
4841
4813
|
exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)([/^([0-9]+|[a-z]+|[A-Z]+)(?:-[0-9]+)*\.(?=[^\S\n]|\n[^\S\n]*\S)/, /^\(([0-9]+|[a-z]+)\)(?:-[0-9]+)*(?=[^\S\n]|\n[^\S\n]*\S)/], (0, combinator_1.context)({
|
|
4842
4814
|
syntax: {
|
|
@@ -4845,9 +4817,9 @@ exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combina
|
|
|
4845
4817
|
}
|
|
4846
4818
|
}
|
|
4847
4819
|
}, exports.olist_))));
|
|
4848
|
-
exports.olist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.match)(
|
|
4820
|
+
exports.olist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.match)(openers['.'], (0, memoize_1.memoize)(ms => list(type(ms[1]), '.'), ms => type(ms[1]).charCodeAt(0) || 0, [])), (0, combinator_1.match)(openers['('], (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => type(ms[1]).charCodeAt(0) || 0, []))])));
|
|
4849
4821
|
|
|
4850
|
-
const list = (type, form) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(heads[form], (0, combinator_1.trim)((0, combinator_1.subsequence)([ulist_1.checkbox, (0,
|
|
4822
|
+
const list = (type, form) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(heads[form], (0, combinator_1.trim)((0, combinator_1.subsequence)([ulist_1.checkbox, (0, util_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))])), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, exports.olist_, ilist_1.ilist_]))]), invalid), ns => [(0, dom_1.html)('li', {
|
|
4851
4823
|
'data-marker': ns[0]
|
|
4852
4824
|
}, (0, dom_1.defrag)((0, ulist_1.fillFirstLine)((0, array_1.shift)(ns)[1])))]), true)]))), es => [format((0, dom_1.html)('ol', es), type, form)]);
|
|
4853
4825
|
|
|
@@ -4970,7 +4942,7 @@ const util_1 = __webpack_require__(9437);
|
|
|
4970
4942
|
|
|
4971
4943
|
const dom_1 = __webpack_require__(3252);
|
|
4972
4944
|
|
|
4973
|
-
exports.paragraph = (0, combinator_1.block)((0, locale_1.localize)((0, combinator_1.fmap)((0,
|
|
4945
|
+
exports.paragraph = (0, combinator_1.block)((0, locale_1.localize)((0, combinator_1.fmap)((0, util_1.visualize)((0, combinator_1.trimEnd)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline])))), ns => [(0, dom_1.html)('p', (0, dom_1.defrag)(ns))])));
|
|
4974
4946
|
|
|
4975
4947
|
/***/ }),
|
|
4976
4948
|
|
|
@@ -5010,7 +4982,7 @@ const array_1 = __webpack_require__(8112);
|
|
|
5010
4982
|
*/
|
|
5011
4983
|
|
|
5012
4984
|
|
|
5013
|
-
exports.reply = (0, combinator_1.block)((0, combinator_1.validate)('>', (0, locale_1.localize)((0, combinator_1.fmap)((0, combinator_1.inits)([(0, combinator_1.some)((0, combinator_1.inits)([cite_1.cite, quote_1.quote])), (0, combinator_1.some)((0, combinator_1.subsequence)([(0, combinator_1.some)(quote_1.quote), (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, quote_1.syntax), (0,
|
|
4985
|
+
exports.reply = (0, combinator_1.block)((0, combinator_1.validate)('>', (0, locale_1.localize)((0, combinator_1.fmap)((0, combinator_1.inits)([(0, combinator_1.some)((0, combinator_1.inits)([cite_1.cite, quote_1.quote])), (0, combinator_1.some)((0, combinator_1.subsequence)([(0, combinator_1.some)(quote_1.quote), (0, combinator_1.fmap)((0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, quote_1.syntax), (0, util_1.visualize)((0, combinator_1.trimEnd)((0, combinator_1.some)(inline_1.inline)))), ns => (0, array_1.push)(ns, [(0, dom_1.html)('br')]))]))]), ns => [(0, dom_1.html)('p', (0, dom_1.defrag)((0, array_1.pop)(ns)[0]))]))));
|
|
5014
4986
|
|
|
5015
4987
|
/***/ }),
|
|
5016
4988
|
|
|
@@ -5227,12 +5199,14 @@ const ilist_1 = __webpack_require__(238);
|
|
|
5227
5199
|
|
|
5228
5200
|
const inline_1 = __webpack_require__(1160);
|
|
5229
5201
|
|
|
5202
|
+
const source_1 = __webpack_require__(6743);
|
|
5203
|
+
|
|
5204
|
+
const util_1 = __webpack_require__(9437);
|
|
5205
|
+
|
|
5230
5206
|
const dom_1 = __webpack_require__(3252);
|
|
5231
5207
|
|
|
5232
5208
|
const array_1 = __webpack_require__(8112);
|
|
5233
5209
|
|
|
5234
|
-
const source_1 = __webpack_require__(6743);
|
|
5235
|
-
|
|
5236
5210
|
exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^-(?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.context)({
|
|
5237
5211
|
syntax: {
|
|
5238
5212
|
inline: {
|
|
@@ -5240,7 +5214,7 @@ exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combina
|
|
|
5240
5214
|
}
|
|
5241
5215
|
}
|
|
5242
5216
|
}, exports.ulist_))));
|
|
5243
|
-
exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^-(?=$|\s)/, (0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/^-(?:$|\s)/, (0, combinator_1.trim)((0, combinator_1.subsequence)([exports.checkbox, (0,
|
|
5217
|
+
exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^-(?=$|\s)/, (0, combinator_1.some)((0, combinator_1.creator)((0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/^-(?:$|\s)/, (0, combinator_1.trim)((0, combinator_1.subsequence)([exports.checkbox, (0, util_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))])), true)), (0, combinator_1.indent)((0, combinator_1.union)([exports.ulist_, olist_1.olist_, ilist_1.ilist_]))]), invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)(fillFirstLine(ns)))]), true)])))), es => [format((0, dom_1.html)('ul', es))])));
|
|
5244
5218
|
exports.checkbox = (0, combinator_1.focus)(/^\[[xX ]\](?=$|\s)/, source => [[(0, dom_1.html)('span', {
|
|
5245
5219
|
class: 'checkbox'
|
|
5246
5220
|
}, source[1].trimStart() ? '☑' : '☐')], '']);
|
|
@@ -5450,7 +5424,7 @@ exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0,
|
|
|
5450
5424
|
}
|
|
5451
5425
|
},
|
|
5452
5426
|
delimiters: global_1.undefined
|
|
5453
|
-
}, (0, util_1.
|
|
5427
|
+
}, (0, util_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', /^\\?\n/)))), '))'), ns => [(0, dom_1.html)('sup', {
|
|
5454
5428
|
class: 'annotation'
|
|
5455
5429
|
}, (0, dom_1.defrag)(ns))]))));
|
|
5456
5430
|
|
|
@@ -5773,7 +5747,7 @@ const dom_1 = __webpack_require__(3252);
|
|
|
5773
5747
|
|
|
5774
5748
|
exports.code = (0, combinator_1.creator)((0, combinator_1.validate)('`', (0, combinator_1.match)(/^(`+)(?!`)([^\n]*?[^`\n])\1(?!`)/, ([whole,, body]) => rest => [[(0, dom_1.html)('code', {
|
|
5775
5749
|
'data-src': whole
|
|
5776
|
-
}, format(body))], rest])));
|
|
5750
|
+
}, format(body))], rest.slice(whole.length)])));
|
|
5777
5751
|
|
|
5778
5752
|
function format(text) {
|
|
5779
5753
|
return `${text[0]}${text[text.length - 1]}` === ' ' && text.trimStart() ? text.slice(1, -1) : text;
|
|
@@ -5804,7 +5778,7 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
5804
5778
|
|
|
5805
5779
|
const array_1 = __webpack_require__(8112);
|
|
5806
5780
|
|
|
5807
|
-
exports.comment = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.validate)('[
|
|
5781
|
+
exports.comment = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.validate)('[%', (0, combinator_1.match)(/^\[(%+)\s/, (0, memoize_1.memoize)(([, fence]) => (0, combinator_1.surround)((0, combinator_1.open)((0, source_1.str)(`[${fence}`), (0, combinator_1.some)(source_1.text, new RegExp(String.raw`^\s+${fence}\]|^\S`)), true), (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), new RegExp(String.raw`^\s+${fence}\]`)), (0, combinator_1.close)((0, combinator_1.some)(source_1.text, /^\S/), (0, source_1.str)(`${fence}]`)), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
5808
5782
|
class: 'comment'
|
|
5809
5783
|
}, [(0, dom_1.html)('input', {
|
|
5810
5784
|
type: 'checkbox'
|
|
@@ -6012,7 +5986,7 @@ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combi
|
|
|
6012
5986
|
autolink: false
|
|
6013
5987
|
}
|
|
6014
5988
|
}
|
|
6015
|
-
}, (0, combinator_1.open)((0, source_1.stropt)(
|
|
5989
|
+
}, (0, combinator_1.open)((0, source_1.stropt)(/^\|?/), (0, util_1.trimBlankEnd)((0, combinator_1.some)((0, combinator_1.union)([signature, inline_1.inline]), ']', /^\\?\n/)), true)))), ']'), ns => [(0, dom_1.html)('a', (0, dom_1.defrag)(ns))])), ([el]) => [(0, dom_1.define)(el, {
|
|
6016
5990
|
id: el.id ? null : global_1.undefined,
|
|
6017
5991
|
class: 'index',
|
|
6018
5992
|
href: el.id ? `#${el.id}` : global_1.undefined
|
|
@@ -6263,7 +6237,7 @@ const attrspec = {
|
|
|
6263
6237
|
};
|
|
6264
6238
|
global_1.Object.setPrototypeOf(attrspec, null);
|
|
6265
6239
|
global_1.Object.values(attrspec).forEach(o => global_1.Object.setPrototypeOf(o, null));
|
|
6266
|
-
exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.validate)('<', (0, combinator_1.validate)(/^<[a-z]+(?=[^\S\n]|>)/, (0, combinator_1.union)([(0, combinator_1.match)(
|
|
6240
|
+
exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.validate)('<', (0, combinator_1.validate)(/^<[a-z]+(?=[^\S\n]|>)/, (0, combinator_1.union)([(0, combinator_1.match)(/^<(wbr)(?=[^\S\n]|>)/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)(`<${tag}`, (0, combinator_1.some)((0, combinator_1.union)([exports.attribute])), /^\s*>/, true, ([, bs = []], rest) => [[(0, dom_1.html)(tag, attributes('html', [], attrspec[tag], bs))], rest]), ([, tag]) => tags.indexOf(tag), [])), (0, combinator_1.match)(/^<(sup|sub|small|bdo|bdi)(?=[^\S\n]|>)/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${tag}`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^\s*>/), true), (0, util_1.startLoose)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('\n', `</${tag}>`)), true)])), `</${tag}>`), (0, source_1.str)(`</${tag}>`), false, ([as, bs, cs], rest) => [[elem(tag, as, bs, cs)], rest]), ([, tag]) => tags.indexOf(tag), [])), (0, combinator_1.match)(/^<([a-z]+)(?=[^\S\n]|>)/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${tag}`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^\s*>/), true), (0, util_1.startLoose)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('\n', `</${tag}>`)), true)])), `</${tag}>`), (0, source_1.str)(`</${tag}>`), false, ([as, bs, cs], rest) => [[elem(tag, as, bs, cs)], rest]), ([, tag]) => tag, new cache_1.Cache(10000)))])))));
|
|
6267
6241
|
exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|>)/)]);
|
|
6268
6242
|
|
|
6269
6243
|
function elem(tag, as, bs, cs) {
|
|
@@ -6429,7 +6403,7 @@ exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.creator)(10, (0, co
|
|
|
6429
6403
|
autolink: false
|
|
6430
6404
|
}
|
|
6431
6405
|
}
|
|
6432
|
-
}, (0, util_1.
|
|
6406
|
+
}, (0, util_1.trimBlank)((0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/))), ']', true)]))), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))]))), ([params, content = []], rest, context) => {
|
|
6433
6407
|
if ((0, parser_1.eval)((0, combinator_1.some)(autolink_1.autolink)((0, util_1.stringify)(content), context))?.some(node => typeof node === 'object')) return;
|
|
6434
6408
|
const INSECURE_URI = params.shift();
|
|
6435
6409
|
const el = elem(INSECURE_URI, (0, dom_1.defrag)(content), new url_1.ReadonlyURL(resolve(INSECURE_URI, context.host ?? global_1.location, context.url ?? context.host ?? global_1.location), context.host?.href || global_1.location.href), context.host?.origin || global_1.location.origin);
|
|
@@ -6716,8 +6690,8 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, c
|
|
|
6716
6690
|
}
|
|
6717
6691
|
},
|
|
6718
6692
|
delimiters: global_1.undefined
|
|
6719
|
-
}, (0, combinator_1.subsequence)([abbr, (0, combinator_1.
|
|
6720
|
-
const abbr = (0, combinator_1.creator)((0, combinator_1.bind)((0, combinator_1.surround)('^', (0, combinator_1.union)([(0, source_1.str)(/^(?![0-9]+\s?[|\]])[0-9A-Za-z]+(?:(?:-|(?=\W)(?!'\d)'?(?!\.\d)\.?(?!,\S),? ?)[0-9A-Za-z]+)*(?:-|'?\.?,? ?)?/)]), /^\|?(?=]])|^\|[^\S\n]*/), ([source], rest) => [[(0, dom_1.html)('abbr', source)], rest.replace(util_1.
|
|
6693
|
+
}, (0, combinator_1.subsequence)([abbr, (0, combinator_1.open)((0, source_1.stropt)(/^(?=\^)/), (0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/)), (0, util_1.trimBlank)((0, combinator_1.some)(inline_1.inline, ']', /^\\?\n/))]))), ']]'), ns => [(0, dom_1.html)('sup', attributes(ns), (0, dom_1.defrag)(ns))]))));
|
|
6694
|
+
const abbr = (0, combinator_1.creator)((0, combinator_1.bind)((0, combinator_1.surround)('^', (0, combinator_1.union)([(0, source_1.str)(/^(?![0-9]+\s?[|\]])[0-9A-Za-z]+(?:(?:-|(?=\W)(?!'\d)'?(?!\.\d)\.?(?!,\S),? ?)[0-9A-Za-z]+)*(?:-|'?\.?,? ?)?/)]), /^\|?(?=]])|^\|[^\S\n]*/), ([source], rest) => [[(0, dom_1.html)('abbr', source)], rest.replace(util_1.regBlankStart, '')]));
|
|
6721
6695
|
|
|
6722
6696
|
function attributes(ns) {
|
|
6723
6697
|
return typeof ns[0] === 'object' && ns[0].tagName === 'ABBR' ? {
|
|
@@ -7615,11 +7589,11 @@ exports.str = str;
|
|
|
7615
7589
|
function stropt(pattern) {
|
|
7616
7590
|
return typeof pattern === 'string' ? (0, combinator_1.creator)(source => {
|
|
7617
7591
|
if (source === '') return;
|
|
7618
|
-
return source.slice(0, pattern.length) === pattern ? [[pattern], source.slice(pattern.length)] :
|
|
7592
|
+
return source.slice(0, pattern.length) === pattern ? [[pattern], source.slice(pattern.length)] : global_1.undefined;
|
|
7619
7593
|
}) : (0, combinator_1.creator)(source => {
|
|
7620
7594
|
if (source === '') return;
|
|
7621
7595
|
const m = source.match(pattern);
|
|
7622
|
-
return m ? [[m[0]], source.slice(m[0].length)] :
|
|
7596
|
+
return m ? [[m[0]], source.slice(m[0].length)] : global_1.undefined;
|
|
7623
7597
|
});
|
|
7624
7598
|
}
|
|
7625
7599
|
|
|
@@ -7776,7 +7750,7 @@ exports.unescsource = (0, combinator_1.creator)(source => {
|
|
|
7776
7750
|
Object.defineProperty(exports, "__esModule", ({
|
|
7777
7751
|
value: true
|
|
7778
7752
|
}));
|
|
7779
|
-
exports.stringify = exports.
|
|
7753
|
+
exports.stringify = exports.trimBlankEnd = exports.trimBlankStart = exports.trimBlank = exports.isStartTightNodes = exports.startTight = exports.startLoose = exports.visualize = exports.blankWith = exports.regBlankStart = void 0;
|
|
7780
7754
|
|
|
7781
7755
|
const global_1 = __webpack_require__(4128);
|
|
7782
7756
|
|
|
@@ -7794,7 +7768,7 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
7794
7768
|
|
|
7795
7769
|
const array_1 = __webpack_require__(8112);
|
|
7796
7770
|
|
|
7797
|
-
exports.
|
|
7771
|
+
exports.regBlankStart = new RegExp(String.raw`^(?:\\?[^\S\n]|&(?:${normalize_1.invisibleHTMLEntityNames.join('|')});|<wbr>)+`);
|
|
7798
7772
|
|
|
7799
7773
|
function blankWith(starting, delimiter) {
|
|
7800
7774
|
if (delimiter === global_1.undefined) return blankWith('', starting);
|
|
@@ -7837,7 +7811,7 @@ function startLoose(parser, except) {
|
|
|
7837
7811
|
|
|
7838
7812
|
exports.startLoose = startLoose;
|
|
7839
7813
|
const isStartLoose = (0, memoize_1.reduce)((source, context, except) => {
|
|
7840
|
-
return isStartTight(source.replace(exports.
|
|
7814
|
+
return isStartTight(source.replace(exports.regBlankStart, ''), context, except);
|
|
7841
7815
|
}, (source, _, except = '') => `${source}\x1E${except}`);
|
|
7842
7816
|
|
|
7843
7817
|
function startTight(parser, except) {
|
|
@@ -7922,15 +7896,23 @@ function isVisible(node, strpos) {
|
|
|
7922
7896
|
}
|
|
7923
7897
|
}
|
|
7924
7898
|
|
|
7925
|
-
function
|
|
7926
|
-
return (
|
|
7899
|
+
function trimBlank(parser) {
|
|
7900
|
+
return trimBlankStart(trimBlankEnd(parser));
|
|
7901
|
+
}
|
|
7902
|
+
|
|
7903
|
+
exports.trimBlank = trimBlank;
|
|
7904
|
+
|
|
7905
|
+
function trimBlankStart(parser) {
|
|
7906
|
+
return (0, combinator_1.convert)((0, memoize_1.reduce)(source => source.replace(exports.regBlankStart, '')), parser);
|
|
7927
7907
|
}
|
|
7928
7908
|
|
|
7929
|
-
exports.
|
|
7909
|
+
exports.trimBlankStart = trimBlankStart;
|
|
7910
|
+
|
|
7911
|
+
function trimBlankEnd(parser) {
|
|
7912
|
+
return (0, combinator_1.fmap)(parser, trimNodeEnd);
|
|
7913
|
+
}
|
|
7930
7914
|
|
|
7931
|
-
function
|
|
7932
|
-
return (0, combinator_1.convert)((0, memoize_1.reduce)(source => source.replace(exports.regBlankInlineStart, '')), parser);
|
|
7933
|
-
} //export function trimNode(nodes: (HTMLElement | string)[]): (HTMLElement | string)[] {
|
|
7915
|
+
exports.trimBlankEnd = trimBlankEnd; //export function trimNode(nodes: (HTMLElement | string)[]): (HTMLElement | string)[] {
|
|
7934
7916
|
// return trimNodeStart(trimNodeEnd(nodes));
|
|
7935
7917
|
//}
|
|
7936
7918
|
//function trimNodeStart(nodes: (HTMLElement | string)[]): (HTMLElement | string)[] {
|
|
@@ -7948,7 +7930,6 @@ function trimBlankInlineStart(parser) {
|
|
|
7948
7930
|
// return nodes;
|
|
7949
7931
|
//}
|
|
7950
7932
|
|
|
7951
|
-
|
|
7952
7933
|
function trimNodeEnd(nodes) {
|
|
7953
7934
|
const skip = nodes.length > 0 && typeof nodes[nodes.length - 1] === 'object' && nodes[nodes.length - 1]['className'] === 'indexer' ? [nodes.pop()] : [];
|
|
7954
7935
|
|
|
@@ -7968,8 +7949,6 @@ function trimNodeEnd(nodes) {
|
|
|
7968
7949
|
return (0, array_1.push)(nodes, skip);
|
|
7969
7950
|
}
|
|
7970
7951
|
|
|
7971
|
-
exports.trimNodeEnd = trimNodeEnd;
|
|
7972
|
-
|
|
7973
7952
|
function stringify(nodes) {
|
|
7974
7953
|
let acc = '';
|
|
7975
7954
|
|