securemark 0.256.0 → 0.257.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 +6 -0
- package/dist/index.js +195 -143
- package/markdown.d.ts +18 -11
- package/package.json +1 -1
- package/src/combinator/control/manipulation/context.ts +13 -2
- package/src/combinator/control/manipulation/resource.ts +36 -2
- package/src/combinator/control/manipulation/surround.ts +6 -6
- package/src/combinator/data/parser/inits.ts +1 -1
- package/src/combinator/data/parser/sequence.ts +1 -1
- package/src/combinator/data/parser/some.ts +16 -38
- package/src/combinator/data/parser.ts +34 -18
- package/src/debug.test.ts +2 -2
- package/src/parser/api/bind.ts +9 -11
- package/src/parser/api/parse.test.ts +48 -11
- package/src/parser/block.ts +1 -1
- package/src/parser/inline/annotation.test.ts +6 -5
- package/src/parser/inline/annotation.ts +8 -5
- package/src/parser/inline/autolink/url.ts +6 -6
- package/src/parser/inline/bracket.test.ts +11 -7
- package/src/parser/inline/bracket.ts +10 -10
- package/src/parser/inline/comment.test.ts +4 -3
- package/src/parser/inline/comment.ts +4 -4
- package/src/parser/inline/deletion.ts +3 -3
- package/src/parser/inline/emphasis.ts +3 -3
- package/src/parser/inline/emstrong.ts +4 -5
- package/src/parser/inline/extension/index.test.ts +1 -0
- package/src/parser/inline/extension/index.ts +8 -7
- package/src/parser/inline/extension/indexer.ts +3 -5
- package/src/parser/inline/extension/label.ts +1 -1
- package/src/parser/inline/extension/placeholder.test.ts +1 -0
- package/src/parser/inline/extension/placeholder.ts +4 -4
- package/src/parser/inline/html.test.ts +2 -0
- package/src/parser/inline/html.ts +5 -5
- package/src/parser/inline/insertion.ts +3 -3
- package/src/parser/inline/link.test.ts +1 -0
- package/src/parser/inline/link.ts +6 -6
- package/src/parser/inline/mark.ts +3 -3
- package/src/parser/inline/math.test.ts +21 -14
- package/src/parser/inline/math.ts +4 -15
- package/src/parser/inline/media.test.ts +0 -2
- package/src/parser/inline/media.ts +6 -6
- package/src/parser/inline/reference.test.ts +5 -5
- package/src/parser/inline/reference.ts +18 -6
- package/src/parser/inline/ruby.ts +29 -27
- package/src/parser/inline/strong.ts +3 -3
- package/src/parser/inline/template.ts +4 -4
- package/src/parser/inline.test.ts +11 -8
- package/src/parser/util.ts +17 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.
|
|
1
|
+
/*! securemark v0.257.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"));
|
|
@@ -2099,7 +2099,7 @@ exports.isEmpty = isEmpty;
|
|
|
2099
2099
|
Object.defineProperty(exports, "__esModule", ({
|
|
2100
2100
|
value: true
|
|
2101
2101
|
}));
|
|
2102
|
-
exports.context = exports.reset = exports.guard = void 0;
|
|
2102
|
+
exports.precedence = exports.context = exports.reset = exports.guard = void 0;
|
|
2103
2103
|
|
|
2104
2104
|
const global_1 = __webpack_require__(4128);
|
|
2105
2105
|
|
|
@@ -2155,6 +2155,18 @@ const inherit = (0, assign_1.template)((prop, target, source) => {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
});
|
|
2157
2157
|
|
|
2158
|
+
function precedence(precedence, parser) {
|
|
2159
|
+
return (source, context) => {
|
|
2160
|
+
const p = context.precedence;
|
|
2161
|
+
context.precedence = precedence;
|
|
2162
|
+
const result = parser(source, context);
|
|
2163
|
+
context.precedence = p;
|
|
2164
|
+
return result;
|
|
2165
|
+
};
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2168
|
+
exports.precedence = precedence;
|
|
2169
|
+
|
|
2158
2170
|
/***/ }),
|
|
2159
2171
|
|
|
2160
2172
|
/***/ 7957:
|
|
@@ -2420,7 +2432,7 @@ exports.recover = recover;
|
|
|
2420
2432
|
Object.defineProperty(exports, "__esModule", ({
|
|
2421
2433
|
value: true
|
|
2422
2434
|
}));
|
|
2423
|
-
exports.creator = void 0;
|
|
2435
|
+
exports.recursion = exports.uncreator = exports.creator = void 0;
|
|
2424
2436
|
|
|
2425
2437
|
function creator(cost, parser) {
|
|
2426
2438
|
if (typeof cost === 'function') return creator(1, cost);
|
|
@@ -2431,8 +2443,8 @@ function creator(cost, parser) {
|
|
|
2431
2443
|
recursion: 1
|
|
2432
2444
|
}
|
|
2433
2445
|
} = context;
|
|
2434
|
-
if (resources.budget <= 0) throw new Error('Too many creations
|
|
2435
|
-
if (resources.recursion <= 0) throw new Error('Too much recursion
|
|
2446
|
+
if (resources.budget <= 0) throw new Error('Too many creations');
|
|
2447
|
+
if (resources.recursion <= 0) throw new Error('Too much recursion');
|
|
2436
2448
|
--resources.recursion;
|
|
2437
2449
|
const result = parser(source, context);
|
|
2438
2450
|
++resources.recursion;
|
|
@@ -2447,6 +2459,49 @@ function creator(cost, parser) {
|
|
|
2447
2459
|
|
|
2448
2460
|
exports.creator = creator;
|
|
2449
2461
|
|
|
2462
|
+
function uncreator(cost, parser) {
|
|
2463
|
+
if (typeof cost === 'function') return uncreator(1, cost);
|
|
2464
|
+
return (source, context) => {
|
|
2465
|
+
const {
|
|
2466
|
+
resources = {
|
|
2467
|
+
budget: 1,
|
|
2468
|
+
recursion: 1
|
|
2469
|
+
}
|
|
2470
|
+
} = context;
|
|
2471
|
+
if (resources.budget <= 0) throw new Error('Too many creations');
|
|
2472
|
+
if (resources.recursion <= 0) throw new Error('Too much recursion');
|
|
2473
|
+
++resources.recursion;
|
|
2474
|
+
const result = parser(source, context);
|
|
2475
|
+
--resources.recursion;
|
|
2476
|
+
|
|
2477
|
+
if (result) {
|
|
2478
|
+
resources.budget += cost;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
return result;
|
|
2482
|
+
};
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
exports.uncreator = uncreator;
|
|
2486
|
+
|
|
2487
|
+
function recursion(cost, parser) {
|
|
2488
|
+
if (typeof cost === 'function') return recursion(1, cost);
|
|
2489
|
+
return (source, context) => {
|
|
2490
|
+
const {
|
|
2491
|
+
resources = {
|
|
2492
|
+
recursion: 1
|
|
2493
|
+
}
|
|
2494
|
+
} = context;
|
|
2495
|
+
if (resources.recursion <= 0) throw new Error('Too much recursion');
|
|
2496
|
+
--resources.recursion;
|
|
2497
|
+
const result = parser(source, context);
|
|
2498
|
+
++resources.recursion;
|
|
2499
|
+
return result;
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
exports.recursion = recursion;
|
|
2504
|
+
|
|
2450
2505
|
/***/ }),
|
|
2451
2506
|
|
|
2452
2507
|
/***/ 1109:
|
|
@@ -2561,7 +2616,7 @@ function surround(opener, parser, closer, optional = false, f, g) {
|
|
|
2561
2616
|
const rr = (0, parser_1.eval)(res3);
|
|
2562
2617
|
const rest = (0, parser_1.exec)(res3, r_);
|
|
2563
2618
|
if (rest.length === lmr_.length) return;
|
|
2564
|
-
return rr ? f ? f([rl, rm, rr], rest, context) : [(0, array_1.push)((0, array_1.unshift)(rl, rm ?? []), rr), rest] : g ? g([rl, rm], rest, context) : global_1.undefined;
|
|
2619
|
+
return rr ? f ? f([rl, rm, rr], rest, context) : [(0, array_1.push)((0, array_1.unshift)(rl, rm ?? []), rr), rest] : g ? g([rl, rm, mr_], rest, context) : global_1.undefined;
|
|
2565
2620
|
};
|
|
2566
2621
|
}
|
|
2567
2622
|
|
|
@@ -2685,7 +2740,7 @@ exports.fmap = fmap;
|
|
|
2685
2740
|
/***/ }),
|
|
2686
2741
|
|
|
2687
2742
|
/***/ 6728:
|
|
2688
|
-
/***/ ((__unused_webpack_module, exports
|
|
2743
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
2689
2744
|
|
|
2690
2745
|
"use strict";
|
|
2691
2746
|
|
|
@@ -2695,42 +2750,49 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2695
2750
|
}));
|
|
2696
2751
|
exports.check = exports.exec = exports.eval = exports.Delimiters = void 0;
|
|
2697
2752
|
|
|
2698
|
-
const global_1 = __webpack_require__(4128);
|
|
2699
|
-
|
|
2700
2753
|
class Delimiters {
|
|
2701
2754
|
constructor() {
|
|
2702
2755
|
this.matchers = [];
|
|
2703
|
-
this.
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2756
|
+
this.registry = {};
|
|
2757
|
+
this.length = 0;
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
push(...delimiters) {
|
|
2761
|
+
for (let i = 0; i < delimiters.length; ++i) {
|
|
2762
|
+
const delimiter = delimiters[i];
|
|
2763
|
+
const {
|
|
2764
|
+
signature,
|
|
2765
|
+
matcher,
|
|
2766
|
+
precedence = 1
|
|
2767
|
+
} = delimiter;
|
|
2768
|
+
|
|
2769
|
+
if (!this.registry[signature]) {
|
|
2770
|
+
this.matchers.unshift([this.length, signature, precedence, matcher]);
|
|
2771
|
+
this.registry[signature] = true;
|
|
2772
|
+
}
|
|
2712
2773
|
|
|
2713
|
-
|
|
2714
|
-
this.matchers.unshift(() => global_1.undefined);
|
|
2715
|
-
} else {
|
|
2716
|
-
this.matchers.unshift(matcher);
|
|
2717
|
-
this.record[signature] = !escape;
|
|
2774
|
+
++this.length;
|
|
2718
2775
|
}
|
|
2719
2776
|
}
|
|
2720
2777
|
|
|
2721
|
-
pop() {
|
|
2722
|
-
|
|
2778
|
+
pop(count = 1) {
|
|
2779
|
+
for (let i = 0; i < count; ++i) {
|
|
2780
|
+
if (--this.length === this.matchers[0][0]) {
|
|
2781
|
+
this.registry[this.matchers.shift()[1]] = false;
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2723
2784
|
}
|
|
2724
2785
|
|
|
2725
|
-
match(source) {
|
|
2786
|
+
match(source, precedence = 1) {
|
|
2726
2787
|
const {
|
|
2727
2788
|
matchers
|
|
2728
2789
|
} = this;
|
|
2729
2790
|
|
|
2730
2791
|
for (let i = 0; i < matchers.length; ++i) {
|
|
2731
|
-
switch (matchers[i](source)) {
|
|
2792
|
+
switch (matchers[i][3](source)) {
|
|
2732
2793
|
case true:
|
|
2733
|
-
return true;
|
|
2794
|
+
if (precedence < matchers[i][2]) return true;
|
|
2795
|
+
continue;
|
|
2734
2796
|
|
|
2735
2797
|
case false:
|
|
2736
2798
|
return false;
|
|
@@ -2851,7 +2913,7 @@ exports.sequence = sequence;
|
|
|
2851
2913
|
Object.defineProperty(exports, "__esModule", ({
|
|
2852
2914
|
value: true
|
|
2853
2915
|
}));
|
|
2854
|
-
exports.
|
|
2916
|
+
exports.some = void 0;
|
|
2855
2917
|
|
|
2856
2918
|
const global_1 = __webpack_require__(4128);
|
|
2857
2919
|
|
|
@@ -2887,29 +2949,28 @@ const matcher = (0, memoize_1.memoize)(pattern => {
|
|
|
2887
2949
|
}
|
|
2888
2950
|
}, signature);
|
|
2889
2951
|
|
|
2890
|
-
function some(parser, until,
|
|
2891
|
-
if (typeof until === 'number') return some(parser, global_1.undefined,
|
|
2952
|
+
function some(parser, until, deeps = [], limit = -1) {
|
|
2953
|
+
if (typeof until === 'number') return some(parser, global_1.undefined, deeps, until);
|
|
2892
2954
|
const match = matcher(until);
|
|
2893
|
-
const
|
|
2894
|
-
signature: signature(
|
|
2895
|
-
matcher: matcher(
|
|
2896
|
-
|
|
2955
|
+
const delimiters = deeps.map(([delimiter, precedence]) => ({
|
|
2956
|
+
signature: signature(delimiter),
|
|
2957
|
+
matcher: matcher(delimiter),
|
|
2958
|
+
precedence
|
|
2959
|
+
}));
|
|
2897
2960
|
return (source, context) => {
|
|
2898
2961
|
if (source === '') return;
|
|
2899
2962
|
let rest = source;
|
|
2900
2963
|
let nodes;
|
|
2901
2964
|
|
|
2902
|
-
if (
|
|
2903
|
-
// bracket > link > media | bracket
|
|
2904
|
-
// bracket > index > bracket
|
|
2965
|
+
if (delimiters.length > 0) {
|
|
2905
2966
|
context.delimiters ??= new parser_1.Delimiters();
|
|
2906
|
-
context.delimiters.push(
|
|
2967
|
+
context.delimiters.push(...delimiters);
|
|
2907
2968
|
}
|
|
2908
2969
|
|
|
2909
2970
|
while (true) {
|
|
2910
2971
|
if (rest === '') break;
|
|
2911
2972
|
if (match(rest)) break;
|
|
2912
|
-
if (context.delimiters?.match(rest)) break;
|
|
2973
|
+
if (context.delimiters?.match(rest, context.precedence)) break;
|
|
2913
2974
|
const result = parser(rest, context);
|
|
2914
2975
|
if (!result) break;
|
|
2915
2976
|
nodes = nodes ? (0, array_1.push)(nodes, (0, parser_1.eval)(result)) : (0, parser_1.eval)(result);
|
|
@@ -2917,8 +2978,8 @@ function some(parser, until, deep, limit = -1) {
|
|
|
2917
2978
|
if (limit >= 0 && source.length - rest.length > limit) break;
|
|
2918
2979
|
}
|
|
2919
2980
|
|
|
2920
|
-
if (
|
|
2921
|
-
context.delimiters.pop();
|
|
2981
|
+
if (delimiters.length > 0) {
|
|
2982
|
+
context.delimiters.pop(delimiters.length);
|
|
2922
2983
|
}
|
|
2923
2984
|
|
|
2924
2985
|
return nodes && rest.length < source.length ? [nodes, rest] : global_1.undefined;
|
|
@@ -2927,32 +2988,6 @@ function some(parser, until, deep, limit = -1) {
|
|
|
2927
2988
|
|
|
2928
2989
|
exports.some = some;
|
|
2929
2990
|
|
|
2930
|
-
function escape(parser, delim) {
|
|
2931
|
-
const delimiter = {
|
|
2932
|
-
signature: signature(delim),
|
|
2933
|
-
matcher: source => source.slice(0, delim.length) !== delim && global_1.undefined,
|
|
2934
|
-
escape: true
|
|
2935
|
-
};
|
|
2936
|
-
return (source, context) => {
|
|
2937
|
-
if (source === '') return;
|
|
2938
|
-
|
|
2939
|
-
if (context) {
|
|
2940
|
-
context.delimiters ??= new parser_1.Delimiters();
|
|
2941
|
-
context.delimiters.push(delimiter);
|
|
2942
|
-
}
|
|
2943
|
-
|
|
2944
|
-
const result = parser(source, context);
|
|
2945
|
-
|
|
2946
|
-
if (context.delimiters) {
|
|
2947
|
-
context.delimiters.pop();
|
|
2948
|
-
}
|
|
2949
|
-
|
|
2950
|
-
return result;
|
|
2951
|
-
};
|
|
2952
|
-
}
|
|
2953
|
-
|
|
2954
|
-
exports.escape = escape;
|
|
2955
|
-
|
|
2956
2991
|
/***/ }),
|
|
2957
2992
|
|
|
2958
2993
|
/***/ 7005:
|
|
@@ -3154,8 +3189,6 @@ exports.bind = void 0;
|
|
|
3154
3189
|
|
|
3155
3190
|
const global_1 = __webpack_require__(4128);
|
|
3156
3191
|
|
|
3157
|
-
const alias_1 = __webpack_require__(5406);
|
|
3158
|
-
|
|
3159
3192
|
const parser_1 = __webpack_require__(6728);
|
|
3160
3193
|
|
|
3161
3194
|
const header_1 = __webpack_require__(5702);
|
|
@@ -3177,11 +3210,9 @@ const url_1 = __webpack_require__(2261);
|
|
|
3177
3210
|
const array_1 = __webpack_require__(8112);
|
|
3178
3211
|
|
|
3179
3212
|
function bind(target, settings) {
|
|
3180
|
-
|
|
3181
|
-
host: settings.host ?? new url_1.ReadonlyURL(global_1.location.pathname, global_1.location.origin)
|
|
3182
|
-
|
|
3183
|
-
chunk: global_1.undefined
|
|
3184
|
-
});
|
|
3213
|
+
let context = { ...settings,
|
|
3214
|
+
host: settings.host ?? new url_1.ReadonlyURL(global_1.location.pathname, global_1.location.origin)
|
|
3215
|
+
};
|
|
3185
3216
|
if (context.host?.origin === 'null') throw new Error(`Invalid host: ${context.host.href}`);
|
|
3186
3217
|
const blocks = [];
|
|
3187
3218
|
const adds = [];
|
|
@@ -3195,12 +3226,13 @@ function bind(target, settings) {
|
|
|
3195
3226
|
};
|
|
3196
3227
|
|
|
3197
3228
|
function* parse(source) {
|
|
3198
|
-
if (settings.chunk && revision) throw new Error('Chunks cannot be updated
|
|
3229
|
+
if (settings.chunk && revision) throw new Error('Chunks cannot be updated');
|
|
3199
3230
|
const url = (0, header_2.headers)(source).find(field => field.toLowerCase().startsWith('url:'))?.slice(4).trim() ?? '';
|
|
3200
|
-
source = (0, normalize_1.normalize)((0, segment_1.validate)(source, segment_1.MAX_INPUT_SIZE) ? source : source.slice(0, segment_1.MAX_INPUT_SIZE + 1));
|
|
3201
|
-
|
|
3231
|
+
source = (0, normalize_1.normalize)((0, segment_1.validate)(source, segment_1.MAX_INPUT_SIZE) ? source : source.slice(0, segment_1.MAX_INPUT_SIZE + 1)); // Change the object identity.
|
|
3232
|
+
|
|
3233
|
+
context = { ...context,
|
|
3202
3234
|
url: url ? new url_1.ReadonlyURL(url) : global_1.undefined
|
|
3203
|
-
}
|
|
3235
|
+
};
|
|
3204
3236
|
const rev = revision = Symbol();
|
|
3205
3237
|
const sourceSegments = [];
|
|
3206
3238
|
|
|
@@ -3637,7 +3669,7 @@ const random_1 = __webpack_require__(7325);
|
|
|
3637
3669
|
exports.block = (0, combinator_1.creator)(error((0, combinator_1.reset)({
|
|
3638
3670
|
resources: {
|
|
3639
3671
|
budget: 50 * 1000,
|
|
3640
|
-
recursion:
|
|
3672
|
+
recursion: 20 + 1
|
|
3641
3673
|
}
|
|
3642
3674
|
}, (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]))));
|
|
3643
3675
|
|
|
@@ -5370,11 +5402,13 @@ const combinator_1 = __webpack_require__(2087);
|
|
|
5370
5402
|
|
|
5371
5403
|
const inline_1 = __webpack_require__(1160);
|
|
5372
5404
|
|
|
5405
|
+
const reference_1 = __webpack_require__(3555);
|
|
5406
|
+
|
|
5373
5407
|
const util_1 = __webpack_require__(9437);
|
|
5374
5408
|
|
|
5375
5409
|
const dom_1 = __webpack_require__(3252);
|
|
5376
5410
|
|
|
5377
|
-
exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.
|
|
5411
|
+
exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.recursion)((0, combinator_1.precedence)(6, (0, combinator_1.validate)('((', (0, combinator_1.surround)('((', (0, combinator_1.guard)(context => context.syntax?.inline?.annotation ?? true, (0, combinator_1.context)({
|
|
5378
5412
|
syntax: {
|
|
5379
5413
|
inline: {
|
|
5380
5414
|
annotation: false,
|
|
@@ -5389,9 +5423,9 @@ exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0,
|
|
|
5389
5423
|
}
|
|
5390
5424
|
},
|
|
5391
5425
|
delimiters: global_1.undefined
|
|
5392
|
-
}, (0, util_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', /^\\?\n
|
|
5426
|
+
}, (0, util_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[/^\\?\n/, 9], [')', 3], ['))', 6]])))), '))', false, ([, ns], rest) => [[(0, dom_1.html)('sup', {
|
|
5393
5427
|
class: 'annotation'
|
|
5394
|
-
}, [(0, dom_1.html)('span', (0, util_1.trimNodeEnd)((0, dom_1.defrag)(ns)))])]))));
|
|
5428
|
+
}, [(0, dom_1.html)('span', (0, util_1.trimNodeEnd)((0, dom_1.defrag)(ns)))])], rest], ([, ns, rest], next) => next[0] === ')' ? global_1.undefined : (0, reference_1.optimize)('((', ns, rest)))))));
|
|
5395
5429
|
|
|
5396
5430
|
/***/ }),
|
|
5397
5431
|
|
|
@@ -5650,15 +5684,11 @@ const link_1 = __webpack_require__(9628);
|
|
|
5650
5684
|
|
|
5651
5685
|
const source_1 = __webpack_require__(6743);
|
|
5652
5686
|
|
|
5687
|
+
const util_1 = __webpack_require__(9437);
|
|
5688
|
+
|
|
5653
5689
|
const closer = /^[-+*=~^,.;:!?]*(?=["`|\[\](){}<>]|\\?$)/;
|
|
5654
|
-
exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['http://', 'https://'], (0, combinator_1.rewrite)((0, combinator_1.open)(/^https?:\/\/(?=[\x21-\x7E])/, (0, combinator_1.focus)(/^[\x21-\x7E]+/, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.unescsource, closer)])))), (0, combinator_1.
|
|
5655
|
-
|
|
5656
|
-
inline: {
|
|
5657
|
-
link: true
|
|
5658
|
-
}
|
|
5659
|
-
}
|
|
5660
|
-
}, (0, combinator_1.convert)(url => `{ ${url} }`, (0, combinator_1.union)([link_1.link]))))));
|
|
5661
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.surround)('(', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')'), ')', true), (0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']'), ']', true), (0, combinator_1.surround)('{', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}'), '}', true), (0, combinator_1.surround)('"', (0, combinator_1.some)(source_1.unescsource, '"'), '"', true)])));
|
|
5690
|
+
exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['http://', 'https://'], (0, combinator_1.rewrite)((0, combinator_1.open)(/^https?:\/\/(?=[\x21-\x7E])/, (0, combinator_1.focus)(/^[\x21-\x7E]+/, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.unescsource, closer)])))), (0, combinator_1.convert)(url => `{ ${url} }`, (0, util_1.clean)((0, combinator_1.union)([link_1.link]))))));
|
|
5691
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.precedence)(3, (0, combinator_1.union)([(0, combinator_1.surround)('(', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')'), ')', true), (0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']'), ']', true), (0, combinator_1.surround)('{', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}'), '}', true), (0, combinator_1.surround)('"', (0, combinator_1.precedence)(8, (0, combinator_1.some)(source_1.unescsource, '"')), '"', true)]))));
|
|
5662
5692
|
|
|
5663
5693
|
/***/ }),
|
|
5664
5694
|
|
|
@@ -5686,12 +5716,12 @@ const dom_1 = __webpack_require__(3252);
|
|
|
5686
5716
|
const array_1 = __webpack_require__(8112);
|
|
5687
5717
|
|
|
5688
5718
|
const index = /^[0-9A-Za-z]+(?:(?:[.-]|, )[0-9A-Za-z]+)*/;
|
|
5689
|
-
exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)(0, (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, source_1.str)(index), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)(inline_1.inline, ')'), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
5719
|
+
exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)(0, (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(3, (0, source_1.str)(index)), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(3, (0, combinator_1.some)(inline_1.inline, ')', [[')', 3]])), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
5690
5720
|
class: 'paren'
|
|
5691
|
-
}, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('('), (0, source_1.str)(new RegExp(index.source.replace(', ', '[,、]').replace(/[09AZaz.]|\-(?!\w)/g, c => c.trimStart() && String.fromCharCode(c.charCodeAt(0) + 0xFEE0)))), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)(inline_1.inline, ')'), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
5721
|
+
}, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)([''], (0, array_1.unshift)(as, bs)), rest]), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(3, (0, source_1.str)(new RegExp(index.source.replace(', ', '[,、]').replace(/[09AZaz.]|\-(?!\w)/g, c => c.trimStart() && String.fromCharCode(c.charCodeAt(0) + 0xFEE0))))), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(3, (0, combinator_1.some)(inline_1.inline, ')', [[')', 3]])), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
5692
5722
|
class: 'paren'
|
|
5693
|
-
}, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)(inline_1.inline, ']'), (0, source_1.str)(']'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)(inline_1.inline, '}'), (0, source_1.str)('}'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), // Control media blinking in editing rather than control confusion of pairs of quote marks.
|
|
5694
|
-
(0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.some)(inline_1.inline, '"', '"'), (0, source_1.str)('"'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest])])));
|
|
5723
|
+
}, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(3, (0, combinator_1.some)(inline_1.inline, ']', [[']', 3]])), (0, source_1.str)(']'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)([''], (0, array_1.unshift)(as, bs)), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(3, (0, combinator_1.some)(inline_1.inline, '}', [['}', 3]])), (0, source_1.str)('}'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), // Control media blinking in editing rather than control confusion of pairs of quote marks.
|
|
5724
|
+
(0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(8, (0, combinator_1.some)(inline_1.inline, '"', [['"', 8]])), (0, source_1.str)('"'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest])])));
|
|
5695
5725
|
|
|
5696
5726
|
/***/ }),
|
|
5697
5727
|
|
|
@@ -5743,11 +5773,11 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
5743
5773
|
|
|
5744
5774
|
const array_1 = __webpack_require__(8112);
|
|
5745
5775
|
|
|
5746
|
-
exports.comment = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.
|
|
5776
|
+
exports.comment = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[%', (0, combinator_1.creator)((0, combinator_1.precedence)(4, (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}\]`), [[new RegExp(String.raw`^\s+${fence}\]`), 4]]), (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', {
|
|
5747
5777
|
class: 'comment'
|
|
5748
5778
|
}, [(0, dom_1.html)('input', {
|
|
5749
5779
|
type: 'checkbox'
|
|
5750
|
-
}), (0, dom_1.html)('span', (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))])], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), ([, fence]) => fence.length, [])))));
|
|
5780
|
+
}), (0, dom_1.html)('span', (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))])], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), ([, fence]) => fence.length, []))))));
|
|
5751
5781
|
|
|
5752
5782
|
/***/ }),
|
|
5753
5783
|
|
|
@@ -5774,7 +5804,7 @@ const dom_1 = __webpack_require__(3252);
|
|
|
5774
5804
|
|
|
5775
5805
|
const array_1 = __webpack_require__(8112);
|
|
5776
5806
|
|
|
5777
|
-
exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('~~'), (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('\n', '~~')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '~'), true)])), (0, source_1.str)('~~'), false, ([, bs], rest) => [[(0, dom_1.html)('del', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
|
|
5807
|
+
exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.precedence)(2, (0, combinator_1.surround)((0, source_1.str)('~~'), (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('\n', '~~')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '~'), true)])), (0, source_1.str)('~~'), false, ([, bs], rest) => [[(0, dom_1.html)('del', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]))));
|
|
5778
5808
|
|
|
5779
5809
|
/***/ }),
|
|
5780
5810
|
|
|
@@ -5805,7 +5835,7 @@ const dom_1 = __webpack_require__(3252);
|
|
|
5805
5835
|
|
|
5806
5836
|
const array_1 = __webpack_require__(8112);
|
|
5807
5837
|
|
|
5808
|
-
exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('*'), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([emstrong_1.emstrong, strong_1.strong, exports.emphasis]))])), '*'), (0, source_1.str)('*'), false, ([, bs], rest) => [[(0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
|
|
5838
|
+
exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.precedence)(1, (0, combinator_1.surround)((0, source_1.str)('*'), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([emstrong_1.emstrong, strong_1.strong, exports.emphasis]))])), '*'), (0, source_1.str)('*'), false, ([, bs], rest) => [[(0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]))));
|
|
5809
5839
|
|
|
5810
5840
|
/***/ }),
|
|
5811
5841
|
|
|
@@ -5838,7 +5868,7 @@ const array_1 = __webpack_require__(8112);
|
|
|
5838
5868
|
|
|
5839
5869
|
const substrong = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('**')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([exports.emstrong, strong_1.strong]))])));
|
|
5840
5870
|
const subemphasis = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([exports.emstrong, strong_1.strong, emphasis_1.emphasis]))])));
|
|
5841
|
-
exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('***'), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)]))), (0, source_1.str)(/^\*{1,3}/), false, ([, bs, cs], rest, context) => {
|
|
5871
|
+
exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.precedence)(1, (0, combinator_1.surround)((0, source_1.str)('***'), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)]))), (0, source_1.str)(/^\*{1,3}/), false, ([, bs, cs], rest, context) => {
|
|
5842
5872
|
switch (cs[0]) {
|
|
5843
5873
|
case '***':
|
|
5844
5874
|
return [[(0, dom_1.html)('em', [(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))])], rest];
|
|
@@ -5849,7 +5879,7 @@ exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, co
|
|
|
5849
5879
|
case '*':
|
|
5850
5880
|
return (0, combinator_1.bind)(substrong, (ds, rest) => rest.slice(0, 2) === '**' ? [[(0, dom_1.html)('strong', (0, array_1.unshift)([(0, dom_1.html)('em', (0, dom_1.defrag)(bs))], (0, dom_1.defrag)(ds)))], rest.slice(2)] : [(0, array_1.unshift)(['**', (0, dom_1.html)('em', (0, dom_1.defrag)(bs))], ds), rest])(rest, context) ?? [['**', (0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest];
|
|
5851
5881
|
}
|
|
5852
|
-
}, ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
|
|
5882
|
+
}, ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]))));
|
|
5853
5883
|
|
|
5854
5884
|
/***/ }),
|
|
5855
5885
|
|
|
@@ -5939,7 +5969,7 @@ const util_1 = __webpack_require__(9437);
|
|
|
5939
5969
|
|
|
5940
5970
|
const dom_1 = __webpack_require__(3252);
|
|
5941
5971
|
|
|
5942
|
-
exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
5972
|
+
exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[#', (0, combinator_1.creator)((0, combinator_1.precedence)(3, (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)('[#', (0, combinator_1.guard)(context => context.syntax?.inline?.index ?? true, (0, util_1.startTight)((0, combinator_1.context)({
|
|
5943
5973
|
syntax: {
|
|
5944
5974
|
inline: {
|
|
5945
5975
|
annotation: false,
|
|
@@ -5951,16 +5981,16 @@ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combi
|
|
|
5951
5981
|
autolink: false
|
|
5952
5982
|
}
|
|
5953
5983
|
}
|
|
5954
|
-
}, (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
|
|
5984
|
+
}, (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/, 9], [']', 3]])), true)))), ']', false, ([, ns], rest) => [[(0, dom_1.html)('a', (0, dom_1.defrag)(ns))], rest])), ([el]) => [(0, dom_1.define)(el, {
|
|
5955
5985
|
id: el.id ? null : global_1.undefined,
|
|
5956
5986
|
class: 'index',
|
|
5957
5987
|
href: el.id ? `#${el.id}` : global_1.undefined
|
|
5958
|
-
}, el.childNodes)]))));
|
|
5988
|
+
}, el.childNodes)])))));
|
|
5959
5989
|
const signature = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.fmap)((0, combinator_1.open)('|#', (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ']'))), ns => [(0, dom_1.html)('span', {
|
|
5960
5990
|
class: 'indexer',
|
|
5961
5991
|
'data-index': (0, indexee_1.identity)(ns.join('')).slice(6)
|
|
5962
5992
|
})])));
|
|
5963
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.some)(source_1.txt, '"'), (0, source_1.str)('"'), true)])));
|
|
5993
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(8, (0, combinator_1.some)(source_1.txt, '"')), (0, source_1.str)('"'), true)])));
|
|
5964
5994
|
|
|
5965
5995
|
/***/ }),
|
|
5966
5996
|
|
|
@@ -6061,15 +6091,11 @@ const combinator_1 = __webpack_require__(2087);
|
|
|
6061
6091
|
|
|
6062
6092
|
const index_1 = __webpack_require__(4479);
|
|
6063
6093
|
|
|
6094
|
+
const util_1 = __webpack_require__(9437);
|
|
6095
|
+
|
|
6064
6096
|
const dom_1 = __webpack_require__(3252);
|
|
6065
6097
|
|
|
6066
|
-
exports.indexer = (0, combinator_1.creator)((0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.surround)(/^\s+(?=\[#\S)/, (0, combinator_1.
|
|
6067
|
-
syntax: {
|
|
6068
|
-
inline: {
|
|
6069
|
-
index: true
|
|
6070
|
-
}
|
|
6071
|
-
}
|
|
6072
|
-
}, (0, combinator_1.union)([(0, combinator_1.focus)('[#]', () => [[(0, dom_1.html)('a', {
|
|
6098
|
+
exports.indexer = (0, combinator_1.creator)((0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.surround)(/^\s+(?=\[#\S)/, (0, util_1.clean)((0, combinator_1.union)([(0, combinator_1.focus)('[#]', () => [[(0, dom_1.html)('a', {
|
|
6073
6099
|
href: '#'
|
|
6074
6100
|
})], '']), index_1.index])), /^\s*$/), // Indexer is invisible but invalids must be visible.
|
|
6075
6101
|
([el]) => el.getElementsByClassName('invalid').length === 0), ([el]) => [(0, dom_1.html)('span', {
|
|
@@ -6100,7 +6126,7 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6100
6126
|
|
|
6101
6127
|
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]))/);
|
|
6102
6128
|
exports.segment = (0, combinator_1.clear)((0, combinator_1.validate)(['[$', '$'], (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])));
|
|
6103
|
-
exports.label = (0, combinator_1.
|
|
6129
|
+
exports.label = (0, combinator_1.validate)(['[$', '$'], (0, combinator_1.creator)((0, combinator_1.fmap)((0, combinator_1.guard)(context => context.syntax?.inline?.label ?? true, (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])), ([text]) => [(0, dom_1.html)('a', {
|
|
6104
6130
|
class: 'label',
|
|
6105
6131
|
'data-label': text.slice(text[1] === '-' ? 0 : 1).toLowerCase()
|
|
6106
6132
|
}, text)])));
|
|
@@ -6156,12 +6182,12 @@ const array_1 = __webpack_require__(8112); // Don't use the symbols already used
|
|
|
6156
6182
|
// All syntax surrounded by square brackets shouldn't contain line breaks.
|
|
6157
6183
|
|
|
6158
6184
|
|
|
6159
|
-
exports.placeholder = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6185
|
+
exports.placeholder = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[:', '[^'], (0, combinator_1.creator)((0, combinator_1.precedence)(3, (0, combinator_1.surround)((0, source_1.str)(/^\[[:^]/), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[/^\\?\n/, 9], [']', 3]])), (0, source_1.str)(']'), false, ([as, bs], rest) => [[(0, dom_1.html)('span', {
|
|
6160
6186
|
class: 'invalid',
|
|
6161
6187
|
'data-invalid-syntax': 'extension',
|
|
6162
6188
|
'data-invalid-type': 'syntax',
|
|
6163
6189
|
'data-invalid-message': `Reserved start symbol "${as[0][1]}" cannot be used in "[]"`
|
|
6164
|
-
}, (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]))));
|
|
6190
|
+
}, (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])))));
|
|
6165
6191
|
|
|
6166
6192
|
/***/ }),
|
|
6167
6193
|
|
|
@@ -6202,8 +6228,8 @@ const attrspecs = {
|
|
|
6202
6228
|
};
|
|
6203
6229
|
global_1.Object.setPrototypeOf(attrspecs, null);
|
|
6204
6230
|
global_1.Object.values(attrspecs).forEach(o => global_1.Object.setPrototypeOf(o, null));
|
|
6205
|
-
exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6206
|
-
/^<(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)(?=[^\S\n]|>)/, source => [[source], '']), (0, combinator_1.match)(new RegExp(String.raw`^<(${TAGS.join('|')})(?=[^\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\n]*>/), true), (0, combinator_1.subsequence)([(0, combinator_1.focus)(/^[^\S\n]*\n/, (0, combinator_1.some)(inline_1.inline)), (0, combinator_1.some)((0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('\n', `</${tag}>`)), true))]), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], rest) => [[elem(tag, as, bs, cs)], rest], ([as, bs = []], rest) => [[elem(tag, as, bs, [])], 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\n]*>/), true), (0, combinator_1.subsequence)([(0, combinator_1.focus)(/^[^\S\n]*\n/, (0, combinator_1.some)(inline_1.inline)), (0, combinator_1.some)(inline_1.inline, `</${tag}
|
|
6231
|
+
exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('<', (0, combinator_1.validate)(/^<[a-z]+(?=[^\S\n]|>)/, (0, combinator_1.creator)((0, combinator_1.precedence)(5, (0, combinator_1.union)([(0, combinator_1.focus)('<wbr>', () => [[(0, dom_1.html)('wbr')], '']), (0, combinator_1.focus)( // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
|
|
6232
|
+
/^<(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)(?=[^\S\n]|>)/, source => [[source], '']), (0, combinator_1.match)(new RegExp(String.raw`^<(${TAGS.join('|')})(?=[^\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\n]*>/), true), (0, combinator_1.subsequence)([(0, combinator_1.focus)(/^[^\S\n]*\n/, (0, combinator_1.some)(inline_1.inline)), (0, combinator_1.some)((0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('\n', `</${tag}>`), [[(0, util_1.blankWith)('\n', `</${tag}>`), 5]]), true))]), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], rest) => [[elem(tag, as, bs, cs)], rest], ([as, bs = []], rest) => [[elem(tag, as, bs, [])], 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\n]*>/), true), (0, combinator_1.subsequence)([(0, combinator_1.focus)(/^[^\S\n]*\n/, (0, combinator_1.some)(inline_1.inline)), (0, combinator_1.some)(inline_1.inline, `</${tag}>`, [[`</${tag}>`, 5]])]), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], rest) => [[elem(tag, as, bs, cs)], rest], ([as, bs = []], rest) => [[elem(tag, as, bs, [])], rest]), ([, tag]) => tag, new cache_1.Cache(10000)))]))))));
|
|
6207
6233
|
exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|>)/)]); // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
|
|
6208
6234
|
// [...document.querySelectorAll('tbody > tr > td:first-child')].map(el => el.textContent.slice(1, -1))
|
|
6209
6235
|
|
|
@@ -6317,7 +6343,7 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6317
6343
|
|
|
6318
6344
|
const array_1 = __webpack_require__(8112);
|
|
6319
6345
|
|
|
6320
|
-
exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('++'), (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('\n', '++')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '+'), true)])), (0, source_1.str)('++'), false, ([, bs], rest) => [[(0, dom_1.html)('ins', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
|
|
6346
|
+
exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.precedence)(2, (0, combinator_1.surround)((0, source_1.str)('++'), (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('\n', '++')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '+'), true)])), (0, source_1.str)('++'), false, ([, bs], rest) => [[(0, dom_1.html)('ins', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]))));
|
|
6321
6347
|
|
|
6322
6348
|
/***/ }),
|
|
6323
6349
|
|
|
@@ -6356,7 +6382,7 @@ const optspec = {
|
|
|
6356
6382
|
rel: ['nofollow']
|
|
6357
6383
|
};
|
|
6358
6384
|
Object.setPrototypeOf(optspec, null);
|
|
6359
|
-
exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6385
|
+
exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'], (0, combinator_1.creator)(10, (0, combinator_1.precedence)(3, (0, combinator_1.bind)((0, combinator_1.guard)(context => context.syntax?.inline?.link ?? true, (0, combinator_1.reverse)((0, combinator_1.tails)([(0, combinator_1.context)({
|
|
6360
6386
|
syntax: {
|
|
6361
6387
|
inline: {
|
|
6362
6388
|
link: false
|
|
@@ -6375,14 +6401,14 @@ exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.creator)(10, (0, co
|
|
|
6375
6401
|
autolink: false
|
|
6376
6402
|
}
|
|
6377
6403
|
}
|
|
6378
|
-
}, (0, util_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, ']', /^\\?\n
|
|
6404
|
+
}, (0, util_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 3]]))), ']', 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) => {
|
|
6379
6405
|
content = (0, util_1.trimNodeEnd)(content);
|
|
6380
6406
|
if ((0, parser_1.eval)((0, combinator_1.some)(autolink_1.autolink)((0, util_1.stringify)(content), context))?.some(node => typeof node === 'object')) return;
|
|
6381
6407
|
const INSECURE_URI = params.shift();
|
|
6382
6408
|
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);
|
|
6383
6409
|
if (el.classList.contains('invalid')) return [[el], rest];
|
|
6384
6410
|
return [[(0, dom_1.define)(el, (0, html_1.attributes)('link', [], optspec, params))], rest];
|
|
6385
|
-
}))));
|
|
6411
|
+
})))));
|
|
6386
6412
|
exports.uri = (0, combinator_1.union)([(0, combinator_1.open)(/^[^\S\n]+/, (0, source_1.str)(/^\S+/)), (0, source_1.str)(/^[^\s{}]+/)]);
|
|
6387
6413
|
exports.option = (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+nofollow(?=[^\S\n]|})/), () => [` rel="nofollow"`]), (0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|})/), (0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[^\s{}]+/), opt => [` \\${opt.slice(1)}`])]);
|
|
6388
6414
|
|
|
@@ -6485,7 +6511,7 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6485
6511
|
|
|
6486
6512
|
const array_1 = __webpack_require__(8112);
|
|
6487
6513
|
|
|
6488
|
-
exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('=='), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('==')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '='), exports.mark)]))), (0, source_1.str)('=='), false, ([, bs], rest) => [[(0, dom_1.html)('mark', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
|
|
6514
|
+
exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.precedence)(2, (0, combinator_1.surround)((0, source_1.str)('=='), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('==')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '='), exports.mark)]))), (0, source_1.str)('=='), false, ([, bs], rest) => [[(0, dom_1.html)('mark', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]))));
|
|
6489
6515
|
|
|
6490
6516
|
/***/ }),
|
|
6491
6517
|
|
|
@@ -6506,9 +6532,9 @@ const source_1 = __webpack_require__(6743);
|
|
|
6506
6532
|
|
|
6507
6533
|
const dom_1 = __webpack_require__(3252);
|
|
6508
6534
|
|
|
6509
|
-
const syntax = /^(?:[
|
|
6535
|
+
const syntax = /^(?:[ ([](?!\$)|\\[\\{}$]?|[!#%&')\x2A-\x5A\]^_\x61-\x7A|~])+/;
|
|
6510
6536
|
const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![a-z])/i;
|
|
6511
|
-
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.
|
|
6537
|
+
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('$', (0, combinator_1.creator)((0, combinator_1.precedence)(7, (0, combinator_1.rewrite)((0, combinator_1.union)([(0, combinator_1.surround)('$', bracket, '$'), (0, combinator_1.surround)(/^\$(?![\s{}])/, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, source_1.str)(syntax)])), /^\$(?![0-9A-Za-z])/)]), (source, {
|
|
6512
6538
|
caches: {
|
|
6513
6539
|
math: cache
|
|
6514
6540
|
} = {}
|
|
@@ -6522,9 +6548,8 @@ exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combin
|
|
|
6522
6548
|
'data-invalid-syntax': 'math',
|
|
6523
6549
|
'data-invalid-type': 'content',
|
|
6524
6550
|
'data-invalid-message': `"${source.match(forbiddenCommand)[0]}" command is forbidden`
|
|
6525
|
-
}, source)], '']))));
|
|
6551
|
+
}, source)], ''])))));
|
|
6526
6552
|
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)('{', (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.escsource, /^(?:[{}$]|\\?\n)/)])), '}', true)));
|
|
6527
|
-
const quote = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)('``', (0, combinator_1.some)((0, combinator_1.union)([quote, bracket, (0, combinator_1.focus)(/^(?:\\[\\{}$]|`(?!`)|[^`{}"$\n\P{ASCII}])*/u, (0, source_1.str)(syntax))])), /^"?/, true)));
|
|
6528
6553
|
|
|
6529
6554
|
/***/ }),
|
|
6530
6555
|
|
|
@@ -6564,7 +6589,7 @@ const optspec = {
|
|
|
6564
6589
|
rel: global_1.undefined
|
|
6565
6590
|
};
|
|
6566
6591
|
Object.setPrototypeOf(optspec, null);
|
|
6567
|
-
exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6592
|
+
exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.creator)(10, (0, combinator_1.precedence)(3, (0, combinator_1.bind)((0, combinator_1.verify)((0, combinator_1.fmap)((0, combinator_1.open)('!', (0, combinator_1.guard)(context => context.syntax?.inline?.media ?? true, (0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']', [[/^\\?\n/, 9]]), ']', true)), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), /^[^\S\n]*}/))]))), ([as, bs]) => bs ? [[as.join('').trim() || as.join('')], bs] : [[''], as]), ([[text]]) => text === '' || text.trim() !== ''), ([[text], params], rest, context) => {
|
|
6568
6593
|
const INSECURE_URI = params.shift();
|
|
6569
6594
|
const url = new url_1.ReadonlyURL((0, link_1.resolve)(INSECURE_URI, context.host ?? global_1.location, context.url ?? context.host ?? global_1.location), context.host?.href || global_1.location.href);
|
|
6570
6595
|
let cache;
|
|
@@ -6586,8 +6611,8 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.creator)(10, (0, c
|
|
|
6586
6611
|
return (0, combinator_1.fmap)(link_1.link, ([link]) => [(0, dom_1.define)(link, {
|
|
6587
6612
|
target: '_blank'
|
|
6588
6613
|
}, [el])])(`{ ${INSECURE_URI}${params.join('')} }${rest}`, context);
|
|
6589
|
-
}))));
|
|
6590
|
-
const bracket = (0, combinator_1.lazy)(() => (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, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (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, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (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, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, source_1.txt]), '"'), (0, source_1.str)('"'), true)]));
|
|
6614
|
+
})))));
|
|
6615
|
+
const bracket = (0, combinator_1.lazy)(() => (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, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (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, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (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, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(8, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, source_1.txt]), '"')), (0, source_1.str)('"'), true)]));
|
|
6591
6616
|
const option = (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[1-9][0-9]*x[1-9][0-9]*(?=[^\S\n]|})/), ([opt]) => [` width="${opt.slice(1).split('x')[0]}"`, ` height="${opt.slice(1).split('x')[1]}"`]), (0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[1-9][0-9]*:[1-9][0-9]*(?=[^\S\n]|})/), ([opt]) => [` aspect-ratio="${opt.slice(1).split(':').join('/')}"`]), link_1.option]);
|
|
6592
6617
|
|
|
6593
6618
|
function sanitize(target, uri, alt) {
|
|
@@ -6641,7 +6666,7 @@ function sanitize(target, uri, alt) {
|
|
|
6641
6666
|
Object.defineProperty(exports, "__esModule", ({
|
|
6642
6667
|
value: true
|
|
6643
6668
|
}));
|
|
6644
|
-
exports.reference = void 0;
|
|
6669
|
+
exports.optimize = exports.reference = void 0;
|
|
6645
6670
|
|
|
6646
6671
|
const global_1 = __webpack_require__(4128);
|
|
6647
6672
|
|
|
@@ -6655,7 +6680,7 @@ const util_1 = __webpack_require__(9437);
|
|
|
6655
6680
|
|
|
6656
6681
|
const dom_1 = __webpack_require__(3252);
|
|
6657
6682
|
|
|
6658
|
-
exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6683
|
+
exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[[', (0, combinator_1.creator)((0, combinator_1.recursion)((0, combinator_1.precedence)(6, (0, combinator_1.surround)('[[', (0, combinator_1.guard)(context => context.syntax?.inline?.reference ?? true, (0, combinator_1.context)({
|
|
6659
6684
|
syntax: {
|
|
6660
6685
|
inline: {
|
|
6661
6686
|
annotation: false,
|
|
@@ -6669,7 +6694,7 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, c
|
|
|
6669
6694
|
}
|
|
6670
6695
|
},
|
|
6671
6696
|
delimiters: global_1.undefined
|
|
6672
|
-
}, (0, combinator_1.subsequence)([abbr, (0, combinator_1.open)((0, source_1.stropt)(/^(?=\^)/), (0, combinator_1.some)(inline_1.inline, ']', /^\\?\n
|
|
6697
|
+
}, (0, combinator_1.subsequence)([abbr, (0, combinator_1.open)((0, source_1.stropt)(/^(?=\^)/), (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 3], [']]', 6]])), (0, util_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 3], [']]', 6]]))]))), ']]', false, ([, ns], rest) => [[(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, util_1.trimNodeEnd)((0, dom_1.defrag)(ns)))])], rest], ([, ns, rest], next) => next[0] === ']' ? global_1.undefined : optimize('[[', ns, rest)))))));
|
|
6673
6698
|
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, '')]));
|
|
6674
6699
|
|
|
6675
6700
|
function attributes(ns) {
|
|
@@ -6686,6 +6711,19 @@ function attributes(ns) {
|
|
|
6686
6711
|
};
|
|
6687
6712
|
}
|
|
6688
6713
|
|
|
6714
|
+
function optimize(opener, ns, rest) {
|
|
6715
|
+
let count = 0;
|
|
6716
|
+
|
|
6717
|
+
for (let i = 0; i < ns.length - 1; i += 2) {
|
|
6718
|
+
if (ns[i] !== '' || ns[i + 1] !== opener[0]) break;
|
|
6719
|
+
++count;
|
|
6720
|
+
}
|
|
6721
|
+
|
|
6722
|
+
return [[opener[0].repeat(opener.length + count)], rest.slice(count)];
|
|
6723
|
+
}
|
|
6724
|
+
|
|
6725
|
+
exports.optimize = optimize;
|
|
6726
|
+
|
|
6689
6727
|
/***/ }),
|
|
6690
6728
|
|
|
6691
6729
|
/***/ 6705:
|
|
@@ -6715,19 +6753,18 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6715
6753
|
|
|
6716
6754
|
const array_1 = __webpack_require__(8112);
|
|
6717
6755
|
|
|
6718
|
-
exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6719
|
-
|
|
6720
|
-
tail.length === 0 && texts[texts.length - 1] === '' && texts.pop();
|
|
6756
|
+
exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0, combinator_1.creator)((0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.sequence)([(0, combinator_1.surround)('[', (0, combinator_1.focus)(/^(?:\\[^\n]|[^\\[\](){}"\n])+(?=]\()/, text), ']'), (0, combinator_1.surround)('(', (0, combinator_1.focus)(/^(?:\\[^\n]|[^\\[\](){}"\n])+(?=\))/, text), ')')]), ([texts]) => (0, util_1.isStartTightNodes)(texts)), ([texts, rubies]) => {
|
|
6757
|
+
texts[texts.length - 1] === '' && texts.pop();
|
|
6721
6758
|
|
|
6722
6759
|
switch (true) {
|
|
6723
6760
|
case rubies.length <= texts.length:
|
|
6724
|
-
return [
|
|
6761
|
+
return [(0, dom_1.html)('ruby', attributes(texts, rubies), (0, dom_1.defrag)(texts.reduce((acc, _, i) => (0, array_1.push)(acc, (0, array_1.unshift)([texts[i]], i < rubies.length && rubies[i] ? [(0, dom_1.html)('rp', '('), (0, dom_1.html)('rt', rubies[i]), (0, dom_1.html)('rp', ')')] : [(0, dom_1.html)('rt')])), [])))];
|
|
6725
6762
|
|
|
6726
6763
|
case texts.length === 1 && [...texts[0]].length >= rubies.length:
|
|
6727
|
-
return [
|
|
6764
|
+
return [(0, dom_1.html)('ruby', attributes(texts, rubies), (0, dom_1.defrag)([...texts[0]].reduce((acc, _, i, texts) => (0, array_1.push)(acc, (0, array_1.unshift)([texts[i]], i < rubies.length && rubies[i] ? [(0, dom_1.html)('rp', '('), (0, dom_1.html)('rt', rubies[i]), (0, dom_1.html)('rp', ')')] : [(0, dom_1.html)('rt')])), [])))];
|
|
6728
6765
|
|
|
6729
6766
|
default:
|
|
6730
|
-
return [
|
|
6767
|
+
return [(0, dom_1.html)('ruby', attributes(texts, rubies), (0, dom_1.defrag)((0, array_1.unshift)([texts.join(' ')], [(0, dom_1.html)('rp', '('), (0, dom_1.html)('rt', rubies.join(' ').trim()), (0, dom_1.html)('rp', ')')])))];
|
|
6731
6768
|
}
|
|
6732
6769
|
}))));
|
|
6733
6770
|
const text = (0, combinator_1.creator)((source, context) => {
|
|
@@ -6834,7 +6871,7 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6834
6871
|
|
|
6835
6872
|
const array_1 = __webpack_require__(8112);
|
|
6836
6873
|
|
|
6837
|
-
exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)((0, source_1.str)('**'), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('**')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([emstrong_1.emstrong, exports.strong]))])), '*'), (0, source_1.str)('**'), false, ([, bs], rest) => [[(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
|
|
6874
|
+
exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.precedence)(1, (0, combinator_1.surround)((0, source_1.str)('**'), (0, util_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, util_1.blankWith)('**')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([emstrong_1.emstrong, exports.strong]))])), '*'), (0, source_1.str)('**'), false, ([, bs], rest) => [[(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]))));
|
|
6838
6875
|
|
|
6839
6876
|
/***/ }),
|
|
6840
6877
|
|
|
@@ -6859,10 +6896,10 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6859
6896
|
|
|
6860
6897
|
const array_1 = __webpack_require__(8112);
|
|
6861
6898
|
|
|
6862
|
-
exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.rewrite)((0, combinator_1.surround)('{{', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}'), '}}', true), source => [[(0, dom_1.html)('span', {
|
|
6899
|
+
exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.precedence)(3, (0, combinator_1.rewrite)((0, combinator_1.surround)('{{', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}'), '}}', true), source => [[(0, dom_1.html)('span', {
|
|
6863
6900
|
class: 'template'
|
|
6864
|
-
}, source.replace(/\x1B/g, ''))], ''])));
|
|
6865
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')'), (0, source_1.str)(')'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ']'), (0, source_1.str)(']'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}'), (0, source_1.str)('}'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.some)(source_1.escsource, /^"|^\\?\n/), (0, source_1.str)('"'), true)]));
|
|
6901
|
+
}, source.replace(/\x1B/g, ''))], '']))));
|
|
6902
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')'), (0, source_1.str)(')'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ']'), (0, source_1.str)(']'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}'), (0, source_1.str)('}'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(8, (0, combinator_1.some)(source_1.escsource, /^"|^\\?\n/)), (0, source_1.str)('"'), true)]));
|
|
6866
6903
|
|
|
6867
6904
|
/***/ }),
|
|
6868
6905
|
|
|
@@ -7761,7 +7798,7 @@ exports.unescsource = (0, combinator_1.creator)(source => {
|
|
|
7761
7798
|
Object.defineProperty(exports, "__esModule", ({
|
|
7762
7799
|
value: true
|
|
7763
7800
|
}));
|
|
7764
|
-
exports.stringify = exports.trimNodeEnd = exports.trimBlankEnd = exports.trimBlankStart = exports.trimBlank = exports.isStartTightNodes = exports.isStartLooseNodes = exports.startTight = exports.startLoose = exports.visualize = exports.blankWith = exports.regBlankStart = void 0;
|
|
7801
|
+
exports.stringify = exports.trimNodeEnd = exports.trimBlankEnd = exports.trimBlankStart = exports.trimBlank = exports.isStartTightNodes = exports.isStartLooseNodes = exports.startTight = exports.startLoose = exports.visualize = exports.blankWith = exports.regBlankStart = exports.clean = void 0;
|
|
7765
7802
|
|
|
7766
7803
|
const global_1 = __webpack_require__(4128);
|
|
7767
7804
|
|
|
@@ -7779,6 +7816,21 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
7779
7816
|
|
|
7780
7817
|
const array_1 = __webpack_require__(8112);
|
|
7781
7818
|
|
|
7819
|
+
function clean(parser) {
|
|
7820
|
+
const clean = (0, memoize_1.memoize)(context => ({
|
|
7821
|
+
resources: context.resources,
|
|
7822
|
+
precedence: context.precedence,
|
|
7823
|
+
delimiters: context.delimiters,
|
|
7824
|
+
host: context.host,
|
|
7825
|
+
url: context.url,
|
|
7826
|
+
id: context.id,
|
|
7827
|
+
header: context.header,
|
|
7828
|
+
cache: context.caches
|
|
7829
|
+
}), new WeakMap());
|
|
7830
|
+
return (source, context) => parser(source, context.syntax ? clean(context) : context);
|
|
7831
|
+
}
|
|
7832
|
+
|
|
7833
|
+
exports.clean = clean;
|
|
7782
7834
|
exports.regBlankStart = new RegExp(/^(?:\\?[^\S\n]|&IHN;|<wbr>)+/.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`));
|
|
7783
7835
|
|
|
7784
7836
|
function blankWith(starting, delimiter) {
|