securemark 0.300.0 → 0.300.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.js +237 -161
- package/index.d.ts +1 -1
- package/markdown.d.ts +3 -10
- package/package.json +1 -1
- package/src/api/bind.ts +6 -6
- package/src/api/parse.ts +2 -2
- package/src/combinator/control/inits.ts +13 -4
- package/src/combinator/control/sequence.ts +3 -1
- package/src/combinator/control/state.ts +1 -10
- package/src/combinator/control/union.ts +16 -3
- package/src/combinator/parser.ts +18 -8
- package/src/combinator/process/fence.ts +23 -33
- package/src/combinator/process/line.ts +1 -1
- package/src/combinator/process/surround.ts +2 -0
- package/src/parser/block/codeblock.test.ts +0 -2
- package/src/parser/block/codeblock.ts +4 -4
- package/src/parser/block/extension/aside.test.ts +0 -1
- package/src/parser/block/extension/aside.ts +2 -2
- package/src/parser/block/extension/example.test.ts +0 -2
- package/src/parser/block/extension/example.ts +2 -2
- package/src/parser/block/extension/fig.ts +5 -7
- package/src/parser/block/extension/figure.test.ts +0 -4
- package/src/parser/block/extension/figure.ts +6 -7
- package/src/parser/block/extension/message.test.ts +0 -1
- package/src/parser/block/extension/message.ts +2 -2
- package/src/parser/block/extension/placeholder.ts +4 -4
- package/src/parser/block/extension/table.test.ts +0 -1
- package/src/parser/block/extension/table.ts +2 -8
- package/src/parser/block/extension.ts +1 -2
- package/src/parser/block/mathblock.test.ts +0 -2
- package/src/parser/block/mathblock.ts +4 -4
- package/src/parser/context.ts +9 -12
- package/src/parser/document.ts +1 -1
- package/src/parser/inline/autolink/url.ts +4 -4
- package/src/parser/inline/math.ts +1 -1
- package/src/parser/inline/media.ts +4 -4
- package/src/parser/inline/ruby.ts +45 -8
- package/src/parser/inline/template.ts +4 -4
- package/src/parser/source/escapable.ts +0 -1
- package/src/parser/source/text.ts +14 -43
- package/src/parser/source/unescapable.ts +0 -1
- package/src/parser/source/whitespace.ts +36 -0
- package/src/parser/source.ts +1 -0
- package/src/parser/visibility.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.300.
|
|
1
|
+
/*! securemark v0.300.2 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory(require("Prism"), require("DOMPurify"));
|
|
@@ -2461,9 +2461,10 @@ function bind(target, settings) {
|
|
|
2461
2461
|
for (; index < sourceSegments.length - last; ++index) {
|
|
2462
2462
|
const seg = sourceSegments[index];
|
|
2463
2463
|
options.segment = sourceSegmentAttrs[index] | 1 /* Segment.write */;
|
|
2464
|
-
for (const _ of (0, parser_1.run)(block_1.block,
|
|
2464
|
+
for (const _ of (0, parser_1.run)(block_1.block, new context_1.Input(options, seg), output)) {
|
|
2465
2465
|
yield {
|
|
2466
|
-
type: 'break'
|
|
2466
|
+
type: 'break',
|
|
2467
|
+
value: 'block'
|
|
2467
2468
|
};
|
|
2468
2469
|
}
|
|
2469
2470
|
const es = output.pop().foldl((acc, {
|
|
@@ -2519,7 +2520,8 @@ function bind(target, settings) {
|
|
|
2519
2520
|
};
|
|
2520
2521
|
}
|
|
2521
2522
|
yield {
|
|
2522
|
-
type: 'break'
|
|
2523
|
+
type: 'break',
|
|
2524
|
+
value: 'parser'
|
|
2523
2525
|
};
|
|
2524
2526
|
if (rev !== revision) return yield {
|
|
2525
2527
|
type: 'cancel'
|
|
@@ -2529,7 +2531,8 @@ function bind(target, settings) {
|
|
|
2529
2531
|
type: 'figure',
|
|
2530
2532
|
value: el
|
|
2531
2533
|
} : yield {
|
|
2532
|
-
type: 'break'
|
|
2534
|
+
type: 'break',
|
|
2535
|
+
value: 'figure'
|
|
2533
2536
|
};
|
|
2534
2537
|
if (rev !== revision) return yield {
|
|
2535
2538
|
type: 'cancel'
|
|
@@ -2540,7 +2543,8 @@ function bind(target, settings) {
|
|
|
2540
2543
|
type: 'note',
|
|
2541
2544
|
value: el
|
|
2542
2545
|
} : yield {
|
|
2543
|
-
type: 'break'
|
|
2546
|
+
type: 'break',
|
|
2547
|
+
value: 'note'
|
|
2544
2548
|
};
|
|
2545
2549
|
if (rev !== revision) return yield {
|
|
2546
2550
|
type: 'cancel'
|
|
@@ -2779,7 +2783,7 @@ function* parse(source, opts = {}, options) {
|
|
|
2779
2783
|
if (options.id?.match(/[^0-9a-z/-]/i)) throw new Error('Invalid ID: ID must be alphanumeric');
|
|
2780
2784
|
if (options.host?.origin === 'null') throw new Error(`Invalid host: ${options.host.href}`);
|
|
2781
2785
|
const output = new parser_1.Output();
|
|
2782
|
-
for (const _ of (0, parser_1.run)(document_1.document,
|
|
2786
|
+
for (const _ of (0, parser_1.run)(document_1.document, new context_1.Input(options, source), output)) yield;
|
|
2783
2787
|
return output.peek().head.value;
|
|
2784
2788
|
}
|
|
2785
2789
|
exports.parse = parse;
|
|
@@ -2878,20 +2882,28 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2878
2882
|
value: true
|
|
2879
2883
|
}));
|
|
2880
2884
|
exports.inits = void 0;
|
|
2885
|
+
const parser_1 = __webpack_require__(3360);
|
|
2881
2886
|
const union_1 = __webpack_require__(1226);
|
|
2882
2887
|
const sequence_1 = __webpack_require__(8880);
|
|
2883
|
-
const state_1 = __webpack_require__(9440);
|
|
2884
2888
|
function inits(parsers) {
|
|
2885
2889
|
switch (parsers.length) {
|
|
2886
2890
|
case 0:
|
|
2887
2891
|
return (_, output) => output.context;
|
|
2888
2892
|
case 1:
|
|
2889
|
-
return
|
|
2893
|
+
return parsers[0];
|
|
2890
2894
|
default:
|
|
2891
|
-
return parsers.reduceRight((acc, parser, i) => (0, sequence_1.sequence)([parser, i !== 0 ? acc : (0, union_1.union)([acc,
|
|
2895
|
+
return parsers.reduceRight((acc, parser, i) => (0, sequence_1.sequence)([parser, i !== 0 ? acc : (0, union_1.union)([acc, recovery])]));
|
|
2892
2896
|
}
|
|
2893
2897
|
}
|
|
2894
2898
|
exports.inits = inits;
|
|
2899
|
+
const recovery = (_, output) => {
|
|
2900
|
+
if (output.state) {
|
|
2901
|
+
output.state = true;
|
|
2902
|
+
// @ts-expect-error
|
|
2903
|
+
output.context ??= parser_1.Result.succ;
|
|
2904
|
+
}
|
|
2905
|
+
return output.context;
|
|
2906
|
+
};
|
|
2895
2907
|
|
|
2896
2908
|
/***/ },
|
|
2897
2909
|
|
|
@@ -2909,8 +2921,9 @@ const state_1 = __webpack_require__(9440);
|
|
|
2909
2921
|
function sequence(parsers) {
|
|
2910
2922
|
switch (parsers.length) {
|
|
2911
2923
|
case 0:
|
|
2924
|
+
return (_, output) => output.context;
|
|
2912
2925
|
case 1:
|
|
2913
|
-
return
|
|
2926
|
+
return parsers[0];
|
|
2914
2927
|
default:
|
|
2915
2928
|
return parsers.reduceRight((acc, parser) => (0, state_1.always)([parser, (0, state_1.success)(acc)]));
|
|
2916
2929
|
}
|
|
@@ -2979,7 +2992,7 @@ exports.some = some;
|
|
|
2979
2992
|
/***/ },
|
|
2980
2993
|
|
|
2981
2994
|
/***/ 9440
|
|
2982
|
-
(__unused_webpack_module, exports
|
|
2995
|
+
(__unused_webpack_module, exports) {
|
|
2983
2996
|
|
|
2984
2997
|
"use strict";
|
|
2985
2998
|
|
|
@@ -2987,8 +3000,7 @@ exports.some = some;
|
|
|
2987
3000
|
Object.defineProperty(exports, "__esModule", ({
|
|
2988
3001
|
value: true
|
|
2989
3002
|
}));
|
|
2990
|
-
exports.
|
|
2991
|
-
const parser_1 = __webpack_require__(3360);
|
|
3003
|
+
exports.force = exports.always = exports.failure = exports.success = exports.then = void 0;
|
|
2992
3004
|
function then(success, failure) {
|
|
2993
3005
|
return (input, output) => output.state ? success(input, output) : failure(input, output);
|
|
2994
3006
|
}
|
|
@@ -3009,14 +3021,6 @@ function force(parser) {
|
|
|
3009
3021
|
return (input, output) => input.position === input.source.length ? output.context : parser(input, output);
|
|
3010
3022
|
}
|
|
3011
3023
|
exports.force = force;
|
|
3012
|
-
function recovery(parser = () => parser_1.Result.succ) {
|
|
3013
|
-
return (input, output) => {
|
|
3014
|
-
output.state = true;
|
|
3015
|
-
output.context = parser_1.Result.succ;
|
|
3016
|
-
return parser(input, output);
|
|
3017
|
-
};
|
|
3018
|
-
}
|
|
3019
|
-
exports.recovery = recovery;
|
|
3020
3024
|
|
|
3021
3025
|
/***/ },
|
|
3022
3026
|
|
|
@@ -3068,18 +3072,29 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
3068
3072
|
value: true
|
|
3069
3073
|
}));
|
|
3070
3074
|
exports.union = void 0;
|
|
3075
|
+
const parser_1 = __webpack_require__(3360);
|
|
3071
3076
|
const state_1 = __webpack_require__(9440);
|
|
3072
3077
|
function union(parsers) {
|
|
3073
3078
|
switch (parsers.length) {
|
|
3074
3079
|
case 0:
|
|
3075
3080
|
return (_, output) => output.context;
|
|
3076
3081
|
case 1:
|
|
3077
|
-
return
|
|
3082
|
+
return parsers[0];
|
|
3078
3083
|
default:
|
|
3079
|
-
return parsers.reduceRight((acc, parser) => (0, state_1.always)([parser, (0, state_1.failure)(
|
|
3084
|
+
return parsers.reduceRight((acc, parser) => (0, state_1.always)([parser, (0, state_1.failure)(recovery(acc))]));
|
|
3080
3085
|
}
|
|
3081
3086
|
}
|
|
3082
3087
|
exports.union = union;
|
|
3088
|
+
function recovery(parser) {
|
|
3089
|
+
return (input, output) => {
|
|
3090
|
+
if (!output.state) {
|
|
3091
|
+
output.state = true;
|
|
3092
|
+
// @ts-expect-error
|
|
3093
|
+
output.context ??= parser_1.Result.succ;
|
|
3094
|
+
}
|
|
3095
|
+
return parser(input, output);
|
|
3096
|
+
};
|
|
3097
|
+
}
|
|
3083
3098
|
|
|
3084
3099
|
/***/ },
|
|
3085
3100
|
|
|
@@ -3822,16 +3837,23 @@ function* run(parser, input, output) {
|
|
|
3822
3837
|
time = Date.now();
|
|
3823
3838
|
}
|
|
3824
3839
|
if (output.state && output.error) {
|
|
3825
|
-
output.state
|
|
3826
|
-
|
|
3840
|
+
if (output.state) {
|
|
3841
|
+
output.state = false;
|
|
3842
|
+
// @ts-expect-error
|
|
3843
|
+
output.context = Result.fail;
|
|
3844
|
+
}
|
|
3827
3845
|
}
|
|
3828
3846
|
const input = scope.peek();
|
|
3829
3847
|
//assert(input.position <= input.source.length);
|
|
3830
|
-
const
|
|
3848
|
+
const parser = queue.pop();
|
|
3849
|
+
const result = parser(input, output);
|
|
3831
3850
|
if (result) {
|
|
3832
3851
|
//assert(result.every(f => f));
|
|
3833
|
-
output.state
|
|
3834
|
-
|
|
3852
|
+
if (!output.state) {
|
|
3853
|
+
output.state = true;
|
|
3854
|
+
// @ts-expect-error
|
|
3855
|
+
output.context ??= Result.succ;
|
|
3856
|
+
}
|
|
3835
3857
|
if (result.length !== 0) {
|
|
3836
3858
|
if (queue.length !== 0) {
|
|
3837
3859
|
queue.memory = input.memory;
|
|
@@ -3846,8 +3868,11 @@ function* run(parser, input, output) {
|
|
|
3846
3868
|
if (result === Result.skip) {
|
|
3847
3869
|
queue.length = 0;
|
|
3848
3870
|
}
|
|
3849
|
-
output.state
|
|
3850
|
-
|
|
3871
|
+
if (output.state) {
|
|
3872
|
+
output.state = false;
|
|
3873
|
+
// @ts-expect-error
|
|
3874
|
+
output.context = Result.fail;
|
|
3875
|
+
}
|
|
3851
3876
|
}
|
|
3852
3877
|
if (queue.length !== 0) continue;
|
|
3853
3878
|
Queue.dispose(queue);
|
|
@@ -4232,14 +4257,13 @@ exports.fence = void 0;
|
|
|
4232
4257
|
const parser_1 = __webpack_require__(3360);
|
|
4233
4258
|
const clock_1 = __webpack_require__(3803);
|
|
4234
4259
|
const line_1 = __webpack_require__(1599);
|
|
4235
|
-
function fence(opener, write,
|
|
4260
|
+
function fence(opener, write, separation = true) {
|
|
4236
4261
|
return (input, output) => {
|
|
4237
4262
|
const {
|
|
4238
|
-
source
|
|
4239
|
-
position
|
|
4263
|
+
source
|
|
4240
4264
|
} = input;
|
|
4241
|
-
if (position === source.length) return;
|
|
4242
|
-
opener.lastIndex = position;
|
|
4265
|
+
if (input.position === source.length) return;
|
|
4266
|
+
opener.lastIndex = input.position;
|
|
4243
4267
|
const matches = opener.exec(source);
|
|
4244
4268
|
if (!matches) return;
|
|
4245
4269
|
(0, clock_1.spend)(input, output, matches[0].length);
|
|
@@ -4252,34 +4276,26 @@ function fence(opener, write, limit, separation = true) {
|
|
|
4252
4276
|
input.position -= matches[0].length;
|
|
4253
4277
|
return;
|
|
4254
4278
|
}
|
|
4279
|
+
const {
|
|
4280
|
+
position
|
|
4281
|
+
} = input;
|
|
4255
4282
|
let body = '';
|
|
4256
4283
|
let closer = '';
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
if (input.position
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
if (!separation) {
|
|
4272
|
-
input.position += line.length;
|
|
4273
|
-
break;
|
|
4274
|
-
}
|
|
4275
|
-
overflow = line;
|
|
4276
|
-
}
|
|
4277
|
-
if (!overflow) {
|
|
4278
|
-
body += line;
|
|
4279
|
-
}
|
|
4280
|
-
input.position += line.length;
|
|
4284
|
+
for (input.position -= 1;;) {
|
|
4285
|
+
input.position = source.indexOf(`\n${delim}`, input.position) + 1 || source.length;
|
|
4286
|
+
if (!(0, line_1.isEmptyline)(source, input.position + delim.length)) continue;
|
|
4287
|
+
body = source.slice(position, input.position);
|
|
4288
|
+
closer = (0, line_1.firstline)(source, input.position);
|
|
4289
|
+
input.position += closer.length;
|
|
4290
|
+
break;
|
|
4291
|
+
}
|
|
4292
|
+
if (separation) for (; !(0, line_1.isEmptyline)(source, input.position);) {
|
|
4293
|
+
input.position = source.indexOf('\n', input.position) + 1 || source.length;
|
|
4294
|
+
}
|
|
4295
|
+
if (write) {
|
|
4296
|
+
const overflow = source.slice(position + body.length + closer.length, input.position);
|
|
4297
|
+
output.push(new parser_1.List([body, overflow, closer].map(str => new parser_1.Node(str))).import(new parser_1.List(matches.map(str => new parser_1.Node(str)))));
|
|
4281
4298
|
}
|
|
4282
|
-
write && output.push(new parser_1.List([body, overflow, closer].map(str => new parser_1.Node(str))).import(new parser_1.List(matches.map(str => new parser_1.Node(str)))));
|
|
4283
4299
|
return output.context;
|
|
4284
4300
|
};
|
|
4285
4301
|
}
|
|
@@ -4424,7 +4440,7 @@ exports.firstline = firstline;
|
|
|
4424
4440
|
const emptyline = /[^\S\r\n]*(?:$|\r?\n)/y;
|
|
4425
4441
|
function isEmptyline(source, position) {
|
|
4426
4442
|
emptyline.lastIndex = position;
|
|
4427
|
-
return source.length
|
|
4443
|
+
return position >= source.length || source[position] === '\n' || emptyline.test(source);
|
|
4428
4444
|
}
|
|
4429
4445
|
exports.isEmptyline = isEmptyline;
|
|
4430
4446
|
|
|
@@ -4670,6 +4686,7 @@ function surround(opener, parser, closer, optional = false, backtracks = [], f,
|
|
|
4670
4686
|
const o = output.pop();
|
|
4671
4687
|
if (!g) return;
|
|
4672
4688
|
output.state = true;
|
|
4689
|
+
// @ts-expect-error
|
|
4673
4690
|
output.context = parser_1.Result.succ;
|
|
4674
4691
|
return g([o, state ? m : undefined], input, output);
|
|
4675
4692
|
}
|
|
@@ -4692,6 +4709,7 @@ function surround(opener, parser, closer, optional = false, backtracks = [], f,
|
|
|
4692
4709
|
wbs && setBacktrack(input, wbs, position);
|
|
4693
4710
|
if (!g) return;
|
|
4694
4711
|
output.state = true;
|
|
4712
|
+
// @ts-expect-error
|
|
4695
4713
|
output.context = parser_1.Result.succ;
|
|
4696
4714
|
return g([o, state ? m : undefined], input, output);
|
|
4697
4715
|
}
|
|
@@ -4962,9 +4980,9 @@ const util_1 = __webpack_require__(4992);
|
|
|
4962
4980
|
const dom_1 = __webpack_require__(394);
|
|
4963
4981
|
const opener = /(`{3,})(?!`)([^\r\n]*)(?:$|\r?\n)/y;
|
|
4964
4982
|
const language = /^[0-9a-z]+(?:-[a-z][0-9a-z]*)*$/i;
|
|
4965
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false
|
|
4966
|
-
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false,
|
|
4967
|
-
exports.codeblock = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true
|
|
4983
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false));
|
|
4984
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false, false), false);
|
|
4985
|
+
exports.codeblock = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true), (input, output) => {
|
|
4968
4986
|
const [body, overflow, closer, opener, delim, param] = (0, util_1.unwrap)(output.pop());
|
|
4969
4987
|
const params = param.match(/(?:\\.?|\S)+/g)?.reduce((params, value, i) => {
|
|
4970
4988
|
let name;
|
|
@@ -4991,7 +5009,7 @@ exports.codeblock = (0, combinator_1.block)((0, combinator_1.inits)([(0, combina
|
|
|
4991
5009
|
class: 'invalid',
|
|
4992
5010
|
translate: 'no',
|
|
4993
5011
|
...(0, util_1.invalid)('codeblock', !closer || overflow ? 'fence' : 'argument', !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : params.invalid)
|
|
4994
|
-
}, `${opener}${body}${
|
|
5012
|
+
}, `${opener}${body}${closer}${overflow}`)));
|
|
4995
5013
|
return;
|
|
4996
5014
|
}
|
|
4997
5015
|
const src = body.slice(0, body.at(-2) === '\r' ? -2 : -1);
|
|
@@ -5062,7 +5080,7 @@ const message_1 = __webpack_require__(3949);
|
|
|
5062
5080
|
const aside_1 = __webpack_require__(6150);
|
|
5063
5081
|
const example_1 = __webpack_require__(6624);
|
|
5064
5082
|
const placeholder_1 = __webpack_require__(4091);
|
|
5065
|
-
exports.segment = (0, combinator_1.union)([fig_1.segment, figure_1.segment,
|
|
5083
|
+
exports.segment = (0, combinator_1.union)([fig_1.segment, figure_1.segment, placeholder_1.segment]);
|
|
5066
5084
|
exports.extension = (0, combinator_1.lazy)(() => (0, combinator_1.union)([
|
|
5067
5085
|
//figbase,
|
|
5068
5086
|
//fig,
|
|
@@ -5086,14 +5104,14 @@ const document_1 = __webpack_require__(5029);
|
|
|
5086
5104
|
const indexee_1 = __webpack_require__(7610);
|
|
5087
5105
|
const util_1 = __webpack_require__(4992);
|
|
5088
5106
|
const dom_1 = __webpack_require__(394);
|
|
5089
|
-
exports.aside = (0, combinator_1.block)((0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.inits)([(0, combinator_1.fence)(/(~{3,})aside(?!\S)([^\r\n]*)(?:$|\r?\n)/y, true
|
|
5107
|
+
exports.aside = (0, combinator_1.block)((0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.inits)([(0, combinator_1.fence)(/(~{3,})aside(?!\S)([^\r\n]*)(?:$|\r?\n)/y, true), (input, output) => {
|
|
5090
5108
|
const [body, overflow, closer, opener, delim, param] = (0, util_1.unwrap)(output.pop());
|
|
5091
5109
|
if (!closer || overflow || param.trimStart()) {
|
|
5092
5110
|
output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
5093
5111
|
class: 'invalid',
|
|
5094
5112
|
translate: 'no',
|
|
5095
5113
|
...(0, util_1.invalid)('aside', !closer || overflow ? 'fence' : 'argument', !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument')
|
|
5096
|
-
}, `${opener}${body}${
|
|
5114
|
+
}, `${opener}${body}${closer}${overflow}`)));
|
|
5097
5115
|
return;
|
|
5098
5116
|
}
|
|
5099
5117
|
input.memory = {
|
|
@@ -5156,13 +5174,13 @@ const document_1 = __webpack_require__(5029);
|
|
|
5156
5174
|
const mathblock_1 = __webpack_require__(4903);
|
|
5157
5175
|
const util_1 = __webpack_require__(4992);
|
|
5158
5176
|
const dom_1 = __webpack_require__(394);
|
|
5159
|
-
exports.example = (0, combinator_1.block)((0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.inits)([(0, combinator_1.fence)(/(~{3,})(?:example\/(\S+))?(?!\S)([^\r\n]*)(?:$|\r?\n)/y, true
|
|
5177
|
+
exports.example = (0, combinator_1.block)((0, combinator_1.recursion)(1 /* Recursion.block */, (0, combinator_1.inits)([(0, combinator_1.fence)(/(~{3,})(?:example\/(\S+))?(?!\S)([^\r\n]*)(?:$|\r?\n)/y, true), (input, output) => {
|
|
5160
5178
|
const [body, overflow, closer, opener, delim, type = 'markdown', param] = (0, util_1.unwrap)(output.pop());
|
|
5161
5179
|
if (!closer || overflow || param.trimStart()) return output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
5162
5180
|
class: 'invalid',
|
|
5163
5181
|
translate: 'no',
|
|
5164
5182
|
...(0, util_1.invalid)('example', !closer || overflow ? 'fence' : 'argument', !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument')
|
|
5165
|
-
}, `${opener}${body}${
|
|
5183
|
+
}, `${opener}${body}${closer}${overflow}`)));
|
|
5166
5184
|
switch (type) {
|
|
5167
5185
|
case 'markdown':
|
|
5168
5186
|
{
|
|
@@ -5240,10 +5258,9 @@ const figure_1 = __webpack_require__(4248);
|
|
|
5240
5258
|
const label_1 = __webpack_require__(2178);
|
|
5241
5259
|
const codeblock_1 = __webpack_require__(9194);
|
|
5242
5260
|
const mathblock_1 = __webpack_require__(4903);
|
|
5243
|
-
const table_1 = __webpack_require__(3646);
|
|
5244
|
-
const blockquote_1 = __webpack_require__(5885);
|
|
5245
5261
|
const placeholder_1 = __webpack_require__(4091);
|
|
5246
|
-
|
|
5262
|
+
const blockquote_1 = __webpack_require__(5885);
|
|
5263
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /(?!\S)[^\r\n]*\r?\n/y), false), (0, combinator_1.union)([codeblock_1.segment, mathblock_1.segment, placeholder_1.segment, blockquote_1.segment, (0, combinator_1.some)(source_1.contentline)])]), true, 6 /* Segment.fig */);
|
|
5247
5264
|
exports.fig = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.always)([(input, output) => {
|
|
5248
5265
|
const {
|
|
5249
5266
|
source
|
|
@@ -5310,8 +5327,8 @@ const codeblock_1 = __webpack_require__(9194);
|
|
|
5310
5327
|
const mathblock_1 = __webpack_require__(4903);
|
|
5311
5328
|
const example_1 = __webpack_require__(6624);
|
|
5312
5329
|
const table_2 = __webpack_require__(3646);
|
|
5313
|
-
const blockquote_1 = __webpack_require__(5885);
|
|
5314
5330
|
const placeholder_1 = __webpack_require__(4091);
|
|
5331
|
+
const blockquote_1 = __webpack_require__(5885);
|
|
5315
5332
|
const inline_1 = __webpack_require__(7973);
|
|
5316
5333
|
const visibility_1 = __webpack_require__(6364);
|
|
5317
5334
|
const util_1 = __webpack_require__(4992);
|
|
@@ -5319,24 +5336,24 @@ const memoize_1 = __webpack_require__(6925);
|
|
|
5319
5336
|
const dom_1 = __webpack_require__(394);
|
|
5320
5337
|
exports.segment = (0, combinator_1.block)((0, combinator_1.match)(/(~{3,})(?:figure )?(?=\[?\$)/y, (0, memoize_1.memoize)(([, fence], closer = new RegExp(String.raw`${fence}[^\S\r\n]*(?:$|\r?\n)`, 'y')) => (0, combinator_1.close)((0, combinator_1.sequence)([source_1.contentline, (0, combinator_1.inits)([
|
|
5321
5338
|
// All parsers which can include closing terms.
|
|
5322
|
-
(0, combinator_1.union)([codeblock_1.segment_, mathblock_1.segment_,
|
|
5339
|
+
(0, combinator_1.union)([codeblock_1.segment_, mathblock_1.segment_, placeholder_1.segment_, blockquote_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 - 1, [], 2 ** 4 - 1)), true, 8 /* Segment.figure */);
|
|
5323
5340
|
exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.scope)(({
|
|
5324
5341
|
source
|
|
5325
|
-
}) => 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)[^\r\n]*\r?\n/y)]), false), (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,
|
|
5342
|
+
}) => 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)[^\r\n]*\r?\n/y)]), false), (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, placeholder_1.placeholder, blockquote_1.blockquote, (0, combinator_1.line)(inline_1.media, false), (0, combinator_1.line)(inline_1.lineshortmedia, false)])), source_1.emptyline, (0, combinator_1.block)((0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))))])]), false), nodes => {
|
|
5326
5343
|
const [label, param, content, ...caption] = (0, util_1.unwrap)(nodes);
|
|
5327
5344
|
return new parser_1.List([new parser_1.Node((0, dom_1.html)('figure', attributes(label.getAttribute('data-label'), param, content, caption), [(0, dom_1.html)('figcaption', [(0, dom_1.html)('span', {
|
|
5328
5345
|
class: 'figindex'
|
|
5329
5346
|
}), (0, dom_1.html)('span', {
|
|
5330
5347
|
class: 'figtext'
|
|
5331
5348
|
}, (0, dom_1.defrag)(caption))]), (0, dom_1.html)('div', [content])]))]);
|
|
5332
|
-
})), (0, combinator_1.inits)([(0, combinator_1.fence)(/(~{3,})(?:figure(?=$|[ \r\n])|\[?\$)[^\r\n]*(?:$|\r?\n)/y, true
|
|
5349
|
+
})), (0, combinator_1.inits)([(0, combinator_1.fence)(/(~{3,})(?:figure(?=$|[ \r\n])|\[?\$)[^\r\n]*(?:$|\r?\n)/y, true), (_, output) => {
|
|
5333
5350
|
const [body, overflow, closer, opener, delim] = (0, util_1.unwrap)(output.pop());
|
|
5334
5351
|
const violation = !closer && ['fence', `Missing the closing delimiter "${delim}"`] || overflow && ['fence', `Invalid trailing line after the closing delimiter "${delim}"`] || !(0, label_1.test)(opener.match(/^~+(?:figure )?(\[?\$\S+)/)?.[1] ?? '') && ['label', 'Invalid label'] || /^~+(?:figure )?(\[?\$\S+)[^\S\r\n]+\S/.test(opener) && ['argument', 'Invalid argument'] || ['content', 'Invalid content'];
|
|
5335
5352
|
return output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
5336
5353
|
class: 'invalid',
|
|
5337
5354
|
translate: 'no',
|
|
5338
5355
|
...(0, util_1.invalid)('figure', violation[0], violation[1])
|
|
5339
|
-
}, `${opener}${body}${
|
|
5356
|
+
}, `${opener}${body}${closer}${overflow}`)));
|
|
5340
5357
|
}])));
|
|
5341
5358
|
function attributes(label, param, content, caption) {
|
|
5342
5359
|
const group = label.split('-', 1)[0];
|
|
@@ -5405,14 +5422,14 @@ const mediablock_1 = __webpack_require__(2583);
|
|
|
5405
5422
|
const paragraph_1 = __webpack_require__(4330);
|
|
5406
5423
|
const util_1 = __webpack_require__(4992);
|
|
5407
5424
|
const dom_1 = __webpack_require__(394);
|
|
5408
|
-
exports.message = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(/(~{3,})message\/(\S+)(?!\S)([^\r\n]*)(?:$|\r?\n)/y, true
|
|
5425
|
+
exports.message = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(/(~{3,})message\/(\S+)(?!\S)([^\r\n]*)(?:$|\r?\n)/y, true), (input, output) => {
|
|
5409
5426
|
const [body, overflow, closer, opener, delim, type, param] = (0, util_1.unwrap)(output.pop());
|
|
5410
5427
|
if (!closer || overflow || param.trimStart()) {
|
|
5411
5428
|
output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
5412
5429
|
class: 'invalid',
|
|
5413
5430
|
translate: 'no',
|
|
5414
5431
|
...(0, util_1.invalid)('message', !closer || overflow ? 'fence' : 'argument', !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument')
|
|
5415
|
-
}, `${opener}${body}${
|
|
5432
|
+
}, `${opener}${body}${closer}${overflow}`)));
|
|
5416
5433
|
return;
|
|
5417
5434
|
}
|
|
5418
5435
|
switch (type) {
|
|
@@ -5472,15 +5489,15 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
5472
5489
|
const util_1 = __webpack_require__(4992);
|
|
5473
5490
|
const dom_1 = __webpack_require__(394);
|
|
5474
5491
|
const opener = /(~{3,})(?!~)[^\r\n]*(?:$|\r?\n)/y;
|
|
5475
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false
|
|
5476
|
-
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false,
|
|
5477
|
-
exports.placeholder = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true
|
|
5492
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false));
|
|
5493
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false, false), false);
|
|
5494
|
+
exports.placeholder = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true), (_, output) => {
|
|
5478
5495
|
const [body, overflow, closer, opener, delim] = (0, util_1.unwrap)(output.pop());
|
|
5479
5496
|
return output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
5480
5497
|
class: 'invalid',
|
|
5481
5498
|
translate: 'no',
|
|
5482
5499
|
...(0, util_1.invalid)('extension', 'fence', !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument')
|
|
5483
|
-
}, `${opener}${body}${
|
|
5500
|
+
}, `${opener}${body}${closer}${overflow}`)));
|
|
5484
5501
|
}]));
|
|
5485
5502
|
|
|
5486
5503
|
/***/ },
|
|
@@ -5494,7 +5511,7 @@ exports.placeholder = (0, combinator_1.block)((0, combinator_1.inits)([(0, combi
|
|
|
5494
5511
|
Object.defineProperty(exports, "__esModule", ({
|
|
5495
5512
|
value: true
|
|
5496
5513
|
}));
|
|
5497
|
-
exports.table =
|
|
5514
|
+
exports.table = void 0;
|
|
5498
5515
|
const parser_1 = __webpack_require__(3360);
|
|
5499
5516
|
const combinator_1 = __webpack_require__(3484);
|
|
5500
5517
|
const inline_1 = __webpack_require__(7973);
|
|
@@ -5505,15 +5522,13 @@ const alias_1 = __webpack_require__(5413);
|
|
|
5505
5522
|
const array_1 = __webpack_require__(6876);
|
|
5506
5523
|
const dom_1 = __webpack_require__(394);
|
|
5507
5524
|
const opener = /(~{3,})table(?:\/(\S+))?(?!\S)([^\r\n]*)(?:$|\r?\n)/y;
|
|
5508
|
-
exports.
|
|
5509
|
-
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false, 10000, false), false);
|
|
5510
|
-
exports.table = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true, 10000), (_, output) => {
|
|
5525
|
+
exports.table = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true), (_, output) => {
|
|
5511
5526
|
const [body, overflow, closer, opener, delim, type, param] = (0, util_1.unwrap)(output.pop());
|
|
5512
5527
|
if (!closer || overflow || param.trimStart()) return output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
5513
5528
|
class: 'invalid',
|
|
5514
5529
|
translate: 'no',
|
|
5515
5530
|
...(0, util_1.invalid)('table', !closer || overflow ? 'fence' : 'argument', !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument')
|
|
5516
|
-
}, `${opener}${body}${
|
|
5531
|
+
}, `${opener}${body}${closer}${overflow}`)));
|
|
5517
5532
|
switch (type) {
|
|
5518
5533
|
case undefined:
|
|
5519
5534
|
case 'grid':
|
|
@@ -5850,9 +5865,9 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
5850
5865
|
const util_1 = __webpack_require__(4992);
|
|
5851
5866
|
const dom_1 = __webpack_require__(394);
|
|
5852
5867
|
const opener = /(\${2,})(?!\$)([^\r\n]*)(?:$|\r?\n)/y;
|
|
5853
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false
|
|
5854
|
-
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false,
|
|
5855
|
-
exports.mathblock = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true
|
|
5868
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false));
|
|
5869
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false, false), false);
|
|
5870
|
+
exports.mathblock = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true), ({
|
|
5856
5871
|
caches: {
|
|
5857
5872
|
math: cache = undefined
|
|
5858
5873
|
} = {}
|
|
@@ -5865,7 +5880,7 @@ exports.mathblock = (0, combinator_1.block)((0, combinator_1.inits)([(0, combina
|
|
|
5865
5880
|
class: 'invalid',
|
|
5866
5881
|
translate: 'no',
|
|
5867
5882
|
...(0, util_1.invalid)('mathblock', delim.length > 2 ? 'syntax' : !closer || overflow ? 'fence' : 'argument', delim.length > 2 ? 'Invalid syntax' : !closer ? `Missing the closing delimiter "${delim}"` : overflow ? `Invalid trailing line after the closing delimiter "${delim}"` : 'Invalid argument')
|
|
5868
|
-
}, `${opener}${body}${
|
|
5883
|
+
}, `${opener}${body}${closer}${overflow}`)));
|
|
5869
5884
|
}]));
|
|
5870
5885
|
|
|
5871
5886
|
/***/ },
|
|
@@ -6314,21 +6329,21 @@ function format(list) {
|
|
|
6314
6329
|
Object.defineProperty(exports, "__esModule", ({
|
|
6315
6330
|
value: true
|
|
6316
6331
|
}));
|
|
6317
|
-
exports.
|
|
6332
|
+
exports.Input = exports.input = void 0;
|
|
6318
6333
|
const parser_1 = __webpack_require__(3360);
|
|
6319
6334
|
function input(source, input = new Input()) {
|
|
6320
6335
|
return (0, parser_1.input)(source, input);
|
|
6321
6336
|
}
|
|
6322
6337
|
exports.input = input;
|
|
6323
6338
|
class Input extends parser_1.Input {
|
|
6324
|
-
constructor(options = {}) {
|
|
6339
|
+
constructor(options = {}, source) {
|
|
6325
6340
|
super(options);
|
|
6326
6341
|
this.recursion = new RecursionCounter(2);
|
|
6327
6342
|
const {
|
|
6328
6343
|
segment,
|
|
6329
6344
|
header,
|
|
6330
6345
|
local,
|
|
6331
|
-
|
|
6346
|
+
whitespace,
|
|
6332
6347
|
host,
|
|
6333
6348
|
url,
|
|
6334
6349
|
id,
|
|
@@ -6336,15 +6351,16 @@ class Input extends parser_1.Input {
|
|
|
6336
6351
|
caches,
|
|
6337
6352
|
test
|
|
6338
6353
|
} = options;
|
|
6354
|
+
this.source = source ?? options.source ?? '';
|
|
6339
6355
|
this.resources ??= {
|
|
6340
6356
|
clock: -1,
|
|
6341
6357
|
interval: 200,
|
|
6342
|
-
recursions: [10 || 0 /* Recursion.
|
|
6358
|
+
recursions: [10 || 0 /* Recursion.document */, 100 || 0 /* Recursion.block */, 100 || 0 /* Recursion.inline */, 100 || 0 /* Recursion.bracket */]
|
|
6343
6359
|
};
|
|
6344
6360
|
this.segment = segment ?? 0 /* Segment.unknown */;
|
|
6345
6361
|
this.header = header ?? true;
|
|
6346
6362
|
this.local = local ?? false;
|
|
6347
|
-
this.
|
|
6363
|
+
this.whitespace = whitespace ?? false;
|
|
6348
6364
|
this.host = host;
|
|
6349
6365
|
this.url = url;
|
|
6350
6366
|
this.id = id;
|
|
@@ -6371,9 +6387,6 @@ class RecursionCounter {
|
|
|
6371
6387
|
++this.index;
|
|
6372
6388
|
}
|
|
6373
6389
|
}
|
|
6374
|
-
exports.CmdRegExp = {
|
|
6375
|
-
Error: /\x07/g
|
|
6376
|
-
};
|
|
6377
6390
|
|
|
6378
6391
|
/***/ },
|
|
6379
6392
|
|
|
@@ -6408,7 +6421,7 @@ exports.document = (() => {
|
|
|
6408
6421
|
};
|
|
6409
6422
|
output.push();
|
|
6410
6423
|
return output.context;
|
|
6411
|
-
}, (0, combinator_1.recursion)(0 /* Recursion.
|
|
6424
|
+
}, (0, combinator_1.recursion)(0 /* Recursion.document */, (0, combinator_1.force)(() => loop)), (input, output) => {
|
|
6412
6425
|
const doc = (0, dom_1.frag)((0, util_1.unwrap)(output.pop()));
|
|
6413
6426
|
output.append(new parser_1.Node(doc));
|
|
6414
6427
|
if (input.test && !input.local) return output.context;
|
|
@@ -6940,7 +6953,7 @@ exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.focus)(/(?<=^|[\
|
|
|
6940
6953
|
input.position = source.length;
|
|
6941
6954
|
return output.append(new parser_1.Node((0, link_1.parse)(new parser_1.List(), new parser_1.List([new parser_1.Node(source.slice(position))]), input)));
|
|
6942
6955
|
})), (input, output) => output.append(new parser_1.Node(input.source.slice(input.position)))])])));
|
|
6943
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.backtrack)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(3 /* Recursion.
|
|
6956
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.backtrack)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')')), (0, source_1.str)(')'), true, [3 | 8 /* Backtrack.unescapable */]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']')), (0, source_1.str)(']'), true, [3 | 8 /* Backtrack.unescapable */]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}')), (0, source_1.str)('}'), true, [3 | 8 /* Backtrack.unescapable */]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)(source_1.unescsource, '"'))), (0, source_1.str)('"'), true, [3 | 8 /* Backtrack.unescapable */])])));
|
|
6944
6957
|
|
|
6945
6958
|
/***/ },
|
|
6946
6959
|
|
|
@@ -8002,7 +8015,7 @@ exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combin
|
|
|
8002
8015
|
translate: 'no',
|
|
8003
8016
|
...(0, util_1.invalid)('math', 'content', `"${source.match(forbiddenCommand)[0]}" command is forbidden`)
|
|
8004
8017
|
}, source)))));
|
|
8005
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.backtrack)((0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(3 /* Recursion.
|
|
8018
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.backtrack)((0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.escsource, /[{}$\r\n]|(?<=[0-9A-Za-z]):\/\/[[0-9A-Za-z]/y)]))), (0, source_1.str)('}'), true)));
|
|
8006
8019
|
|
|
8007
8020
|
/***/ },
|
|
8008
8021
|
|
|
@@ -8081,7 +8094,7 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* S
|
|
|
8081
8094
|
target: '_blank'
|
|
8082
8095
|
}, [el]))]);
|
|
8083
8096
|
})))));
|
|
8084
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(3 /* Recursion.
|
|
8097
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ')')), (0, source_1.str)(')'), true, [], undefined, () => parser_1.Result.succ), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']')), (0, source_1.str)(']'), true, [], undefined, () => parser_1.Result.succ), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), '}')), (0, source_1.str)('}'), true, [], undefined, () => parser_1.Result.succ), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, source_1.txt]), '"'))), (0, source_1.str)('"'), true, [], undefined, () => parser_1.Result.succ)]));
|
|
8085
8098
|
const option = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.backtrack)((0, combinator_1.surround)((0, combinator_1.open)(/ /y, (0, source_1.str)(/[1-9][0-9]*/y)), (0, source_1.str)(/[x:]/y), (0, source_1.str)(/[1-9][0-9]*(?=[ }])/y), false, [], ([[{
|
|
8086
8099
|
value: a
|
|
8087
8100
|
}], [{
|
|
@@ -8306,9 +8319,8 @@ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.backtrack)((0, comb
|
|
|
8306
8319
|
}) => acc ? acc + ' ' + value : value, '').trim())), new parser_1.Node((0, dom_1.html)('rp', ')'))])))))]);
|
|
8307
8320
|
}
|
|
8308
8321
|
})));
|
|
8309
|
-
const delimiter = /[$"`\[\](){}<>()[]{}|]|\\?\r?\n/y;
|
|
8310
8322
|
const text = (0, combinator_1.always)([(input, output) => {
|
|
8311
|
-
input.
|
|
8323
|
+
input.whitespace = true;
|
|
8312
8324
|
input.memory = {
|
|
8313
8325
|
position: 0,
|
|
8314
8326
|
state: false,
|
|
@@ -8319,7 +8331,7 @@ const text = (0, combinator_1.always)([(input, output) => {
|
|
|
8319
8331
|
const {
|
|
8320
8332
|
memory
|
|
8321
8333
|
} = input;
|
|
8322
|
-
input.
|
|
8334
|
+
input.whitespace = false;
|
|
8323
8335
|
return memory.state || memory.nodes.last.value.trimStart() !== '' ? output.import(memory.nodes) : undefined;
|
|
8324
8336
|
}]);
|
|
8325
8337
|
const loop = [(input, output) => {
|
|
@@ -8331,9 +8343,8 @@ const loop = [(input, output) => {
|
|
|
8331
8343
|
position
|
|
8332
8344
|
} = input;; position = input.position) {
|
|
8333
8345
|
if (position === source.length) return parser_1.Result.skip;
|
|
8334
|
-
|
|
8335
|
-
if (
|
|
8336
|
-
if (source[position].trimStart() !== '') break;
|
|
8346
|
+
if (isDelimiter(source, position)) return parser_1.Result.skip;
|
|
8347
|
+
if (!(0, source_1.isWhitespace)(source[position])) break;
|
|
8337
8348
|
memory.state ||= memory.nodes.last.value.trimStart() !== '';
|
|
8338
8349
|
memory.nodes.push(new parser_1.Node(''));
|
|
8339
8350
|
input.position += 1;
|
|
@@ -8354,6 +8365,44 @@ function* zip(a, b) {
|
|
|
8354
8365
|
yield [ra.value, rb.value];
|
|
8355
8366
|
}
|
|
8356
8367
|
}
|
|
8368
|
+
function isDelimiter(source, position) {
|
|
8369
|
+
switch (source[position]) {
|
|
8370
|
+
case '$':
|
|
8371
|
+
case '"':
|
|
8372
|
+
case '`':
|
|
8373
|
+
case '[':
|
|
8374
|
+
case ']':
|
|
8375
|
+
case '(':
|
|
8376
|
+
case ')':
|
|
8377
|
+
case '{':
|
|
8378
|
+
case '}':
|
|
8379
|
+
case '<':
|
|
8380
|
+
case '>':
|
|
8381
|
+
case '(':
|
|
8382
|
+
case ')':
|
|
8383
|
+
case '[':
|
|
8384
|
+
case ']':
|
|
8385
|
+
case '{':
|
|
8386
|
+
case '}':
|
|
8387
|
+
case '|':
|
|
8388
|
+
return true;
|
|
8389
|
+
case '\\':
|
|
8390
|
+
switch (source[position + 1]) {
|
|
8391
|
+
case '\r':
|
|
8392
|
+
return source[position + 2] === '\n';
|
|
8393
|
+
case '\n':
|
|
8394
|
+
return true;
|
|
8395
|
+
default:
|
|
8396
|
+
return false;
|
|
8397
|
+
}
|
|
8398
|
+
case '\r':
|
|
8399
|
+
return source[position + 1] === '\n';
|
|
8400
|
+
case '\n':
|
|
8401
|
+
return true;
|
|
8402
|
+
default:
|
|
8403
|
+
return false;
|
|
8404
|
+
}
|
|
8405
|
+
}
|
|
8357
8406
|
|
|
8358
8407
|
/***/ },
|
|
8359
8408
|
|
|
@@ -8422,7 +8471,7 @@ exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.backtrack)((0,
|
|
|
8422
8471
|
class: 'invalid',
|
|
8423
8472
|
...(0, util_1.invalid)('template', 'syntax', `Missing the closing symbol "}}"`)
|
|
8424
8473
|
}, input.source.slice(input.position - input.range, input.position)))))));
|
|
8425
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(3 /* Recursion.
|
|
8474
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')')), (0, source_1.str)(')'), true, [], undefined, ([as, bs], _, output) => bs && output.import(as.import(bs))), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ']')), (0, source_1.str)(']'), true, [], undefined, ([as, bs], _, output) => bs && output.import(as.import(bs))), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), (0, source_1.str)('}'), true, [], undefined, ([as, bs], _, output) => bs && output.import(as.import(bs))), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(3 /* Recursion.bracket */, (0, combinator_1.some)(source_1.escsource, /["\n]/y, [['"', 2], ['\n', 3]]))), (0, source_1.str)('"'), true, [], undefined, ([as, bs], _, output) => bs && output.import(as.import(bs)))]));
|
|
8426
8475
|
|
|
8427
8476
|
/***/ },
|
|
8428
8477
|
|
|
@@ -8716,7 +8765,7 @@ exports.segment = segment;
|
|
|
8716
8765
|
Object.defineProperty(exports, "__esModule", ({
|
|
8717
8766
|
value: true
|
|
8718
8767
|
}));
|
|
8719
|
-
exports.anyline = exports.emptysegment = exports.emptyline = exports.contentline = exports.strs = exports.str = exports.unescsource = exports.escsource = exports.txt = exports.text = void 0;
|
|
8768
|
+
exports.anyline = exports.emptysegment = exports.emptyline = exports.contentline = exports.isWhitespace = exports.strs = exports.str = exports.unescsource = exports.escsource = exports.txt = exports.text = void 0;
|
|
8720
8769
|
var text_1 = __webpack_require__(5655);
|
|
8721
8770
|
Object.defineProperty(exports, "text", ({
|
|
8722
8771
|
enumerable: true,
|
|
@@ -8757,6 +8806,13 @@ Object.defineProperty(exports, "strs", ({
|
|
|
8757
8806
|
return str_1.strs;
|
|
8758
8807
|
}
|
|
8759
8808
|
}));
|
|
8809
|
+
var whitespace_1 = __webpack_require__(9009);
|
|
8810
|
+
Object.defineProperty(exports, "isWhitespace", ({
|
|
8811
|
+
enumerable: true,
|
|
8812
|
+
get: function () {
|
|
8813
|
+
return whitespace_1.isWhitespace;
|
|
8814
|
+
}
|
|
8815
|
+
}));
|
|
8760
8816
|
var line_1 = __webpack_require__(702);
|
|
8761
8817
|
Object.defineProperty(exports, "contentline", ({
|
|
8762
8818
|
enumerable: true,
|
|
@@ -8829,7 +8885,6 @@ const escsource = (input, output) => {
|
|
|
8829
8885
|
input.linebreak ||= source.length - position;
|
|
8830
8886
|
return output.append(new parser_1.Node((0, dom_1.html)('br'), 1 /* Flag.blank */));
|
|
8831
8887
|
default:
|
|
8832
|
-
if (input.sequential) return output.append(new parser_1.Node(char));
|
|
8833
8888
|
let i = seek(source, position);
|
|
8834
8889
|
i -= position;
|
|
8835
8890
|
(0, combinator_1.spend)(input, output, i - 1);
|
|
@@ -8998,6 +9053,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
8998
9053
|
exports.isAlphanumeric = exports.backToEmailHead = exports.backToUrlHead = exports.canSkip = exports.txt = exports.text = exports.nonWhitespace = void 0;
|
|
8999
9054
|
const parser_1 = __webpack_require__(3360);
|
|
9000
9055
|
const combinator_1 = __webpack_require__(3484);
|
|
9056
|
+
const whitespace_1 = __webpack_require__(9009);
|
|
9001
9057
|
const dom_1 = __webpack_require__(394);
|
|
9002
9058
|
exports.nonWhitespace = /[^ \t ]/g;
|
|
9003
9059
|
const text = (input, output) => {
|
|
@@ -9030,10 +9086,9 @@ const text = (input, output) => {
|
|
|
9030
9086
|
input.linebreak ||= source.length - position;
|
|
9031
9087
|
return output.append(new parser_1.Node((0, dom_1.html)('br'), 1 /* Flag.blank */));
|
|
9032
9088
|
default:
|
|
9033
|
-
if (input.sequential) return output.append(new parser_1.Node(char));
|
|
9034
9089
|
exports.nonWhitespace.lastIndex = position + 1;
|
|
9035
9090
|
const s = canSkip(source, position);
|
|
9036
|
-
let i = s ? exports.nonWhitespace.test(source) ? exports.nonWhitespace.lastIndex - 1 : source.length : next(source, position, state);
|
|
9091
|
+
let i = s ? exports.nonWhitespace.test(source) ? exports.nonWhitespace.lastIndex - 1 : source.length : next(source, position, input.whitespace, state);
|
|
9037
9092
|
const lineend = false || s && i === source.length || s && source[i] === '\r' || s && source[i] === '\n';
|
|
9038
9093
|
i -= position;
|
|
9039
9094
|
i = lineend ? i : i - +s || 1;
|
|
@@ -9047,26 +9102,13 @@ const text = (input, output) => {
|
|
|
9047
9102
|
exports.text = text;
|
|
9048
9103
|
exports.txt = (0, combinator_1.union)([exports.text]);
|
|
9049
9104
|
function canSkip(source, position) {
|
|
9050
|
-
if (!isWhitespace(source[position], false)) return false;
|
|
9105
|
+
if (!(0, whitespace_1.isWhitespace)(source[position], false)) return false;
|
|
9051
9106
|
if (position + 1 === source.length) return true;
|
|
9052
|
-
return isWhitespace(source[position + 1], true);
|
|
9107
|
+
return (0, whitespace_1.isWhitespace)(source[position + 1], true);
|
|
9053
9108
|
}
|
|
9054
9109
|
exports.canSkip = canSkip;
|
|
9055
|
-
function
|
|
9056
|
-
|
|
9057
|
-
case ' ':
|
|
9058
|
-
case '\t':
|
|
9059
|
-
case ' ':
|
|
9060
|
-
return true;
|
|
9061
|
-
case '\r':
|
|
9062
|
-
case '\n':
|
|
9063
|
-
return linebreak;
|
|
9064
|
-
default:
|
|
9065
|
-
return false;
|
|
9066
|
-
}
|
|
9067
|
-
}
|
|
9068
|
-
function next(source, position, state) {
|
|
9069
|
-
let index = seek(source, position, state);
|
|
9110
|
+
function next(source, position, space, state) {
|
|
9111
|
+
let index = seek(source, position, space, state);
|
|
9070
9112
|
if (index === source.length) return index;
|
|
9071
9113
|
const char = source[index];
|
|
9072
9114
|
switch (char) {
|
|
@@ -9136,7 +9178,7 @@ function isAlphanumeric(char) {
|
|
|
9136
9178
|
return 'A' <= char && char <= 'Z';
|
|
9137
9179
|
}
|
|
9138
9180
|
exports.isAlphanumeric = isAlphanumeric;
|
|
9139
|
-
function seek(source, position, state) {
|
|
9181
|
+
function seek(source, position, space, state) {
|
|
9140
9182
|
for (let i = position + 1; i < source.length; ++i) {
|
|
9141
9183
|
const char = source[i];
|
|
9142
9184
|
switch (char) {
|
|
@@ -9177,7 +9219,7 @@ function seek(source, position, state) {
|
|
|
9177
9219
|
if (source[i + 1] === char && source[i + 2] === char) return i;
|
|
9178
9220
|
continue;
|
|
9179
9221
|
case '%':
|
|
9180
|
-
if (source[i + 1] === ']' && isWhitespace(source[i - 1]
|
|
9222
|
+
if (source[i + 1] === ']' && (0, whitespace_1.isWhitespace)(source[i - 1])) return i;
|
|
9181
9223
|
continue;
|
|
9182
9224
|
case ':':
|
|
9183
9225
|
if (source[i + 1] === '/' && source[i + 2] === '/') return i;
|
|
@@ -9185,30 +9227,14 @@ function seek(source, position, state) {
|
|
|
9185
9227
|
case '&':
|
|
9186
9228
|
if (source[i + 1] !== ' ') return i;
|
|
9187
9229
|
continue;
|
|
9188
|
-
case ' ':
|
|
9189
|
-
case '\t':
|
|
9190
|
-
case ' ':
|
|
9191
|
-
if (i + 1 === source.length) return i;
|
|
9192
|
-
switch (source[i + 1]) {
|
|
9193
|
-
case ' ':
|
|
9194
|
-
case '\t':
|
|
9195
|
-
case '\r':
|
|
9196
|
-
case '\n':
|
|
9197
|
-
case ' ':
|
|
9198
|
-
return i;
|
|
9199
|
-
case '\\':
|
|
9200
|
-
if (i + 2 === source.length) return i;
|
|
9201
|
-
switch (source[i + 2]) {
|
|
9202
|
-
case ' ':
|
|
9203
|
-
case '\t':
|
|
9204
|
-
case '\r':
|
|
9205
|
-
case '\n':
|
|
9206
|
-
case ' ':
|
|
9207
|
-
return i;
|
|
9208
|
-
}
|
|
9209
|
-
}
|
|
9210
|
-
continue;
|
|
9211
9230
|
default:
|
|
9231
|
+
if (!(0, whitespace_1.isWhitespace)(char)) continue;
|
|
9232
|
+
if (space) return i;
|
|
9233
|
+
if (i + 1 === source.length) return i;
|
|
9234
|
+
if ((0, whitespace_1.isWhitespace)(source[i + 1])) return i;
|
|
9235
|
+
if (source[i + 1] !== '\\') continue;
|
|
9236
|
+
if (i + 2 === source.length) return i;
|
|
9237
|
+
if ((0, whitespace_1.isWhitespace)(source[i + 2])) return i;
|
|
9212
9238
|
continue;
|
|
9213
9239
|
}
|
|
9214
9240
|
}
|
|
@@ -9252,7 +9278,6 @@ const unescsource = (input, output) => {
|
|
|
9252
9278
|
input.linebreak ||= source.length - position;
|
|
9253
9279
|
return output.append(new parser_1.Node((0, dom_1.html)('br'), 1 /* Flag.blank */));
|
|
9254
9280
|
default:
|
|
9255
|
-
if (input.sequential) return output.append(new parser_1.Node(char));
|
|
9256
9281
|
text_1.nonWhitespace.lastIndex = position + 1;
|
|
9257
9282
|
let i = (0, text_1.canSkip)(source, position) ? text_1.nonWhitespace.test(source) ? text_1.nonWhitespace.lastIndex - 1 : source.length : next(source, position, state);
|
|
9258
9283
|
i -= position;
|
|
@@ -9338,6 +9363,56 @@ function category(char) {
|
|
|
9338
9363
|
|
|
9339
9364
|
/***/ },
|
|
9340
9365
|
|
|
9366
|
+
/***/ 9009
|
|
9367
|
+
(__unused_webpack_module, exports) {
|
|
9368
|
+
|
|
9369
|
+
"use strict";
|
|
9370
|
+
|
|
9371
|
+
|
|
9372
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
9373
|
+
value: true
|
|
9374
|
+
}));
|
|
9375
|
+
exports.isWhitespace = void 0;
|
|
9376
|
+
// https://util.unicode.org/UnicodeJsps/list-unicodeset.jsp?a=%5Cp%7BWhite_Space%7D&g=&i=
|
|
9377
|
+
// https://en.wikipedia.org/wiki/Whitespace_character
|
|
9378
|
+
// https://en.wikipedia.org/wiki/Newline
|
|
9379
|
+
function isWhitespace(char, linebreak = true) {
|
|
9380
|
+
switch (char) {
|
|
9381
|
+
case '\u0009':
|
|
9382
|
+
case '\u000B':
|
|
9383
|
+
case '\u000C':
|
|
9384
|
+
case '\u0020':
|
|
9385
|
+
case '\u0085':
|
|
9386
|
+
case '\u00A0':
|
|
9387
|
+
case '\u1680':
|
|
9388
|
+
case '\u2000':
|
|
9389
|
+
case '\u2001':
|
|
9390
|
+
case '\u2002':
|
|
9391
|
+
case '\u2003':
|
|
9392
|
+
case '\u2004':
|
|
9393
|
+
case '\u2005':
|
|
9394
|
+
case '\u2006':
|
|
9395
|
+
case '\u2007':
|
|
9396
|
+
case '\u2008':
|
|
9397
|
+
case '\u2009':
|
|
9398
|
+
case '\u200A':
|
|
9399
|
+
case '\u2028':
|
|
9400
|
+
case '\u2029':
|
|
9401
|
+
case '\u202F':
|
|
9402
|
+
case '\u205F':
|
|
9403
|
+
case '\u3000':
|
|
9404
|
+
return true;
|
|
9405
|
+
case '\u000A':
|
|
9406
|
+
case '\u000D':
|
|
9407
|
+
return linebreak;
|
|
9408
|
+
default:
|
|
9409
|
+
return false;
|
|
9410
|
+
}
|
|
9411
|
+
}
|
|
9412
|
+
exports.isWhitespace = isWhitespace;
|
|
9413
|
+
|
|
9414
|
+
/***/ },
|
|
9415
|
+
|
|
9341
9416
|
/***/ 4992
|
|
9342
9417
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
9343
9418
|
|
|
@@ -9415,6 +9490,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
9415
9490
|
exports.trimBlankNodeEnd = exports.trimBlankEnd = exports.trimBlank = exports.isNonblankNodeStart = exports.isNonblankFirstLine = exports.beforeNonblankWith = exports.blankWith = exports.afterNonblank = exports.beforeNonblank = exports.visualize = void 0;
|
|
9416
9491
|
const combinator_1 = __webpack_require__(3484);
|
|
9417
9492
|
const normalize_1 = __webpack_require__(5188);
|
|
9493
|
+
const source_1 = __webpack_require__(8745);
|
|
9418
9494
|
var blank;
|
|
9419
9495
|
(function (blank) {
|
|
9420
9496
|
blank.line = new RegExp(/((?:^|\n)[^\S\r\n]*(?=\S))((?:[^\S\r\n]|\\(?=$|\s)|&IBHN;|<wbr ?>)+(?=$|\r?\n))/g.source.replace('IBHN', `(?:${normalize_1.invisibleBlankHTMLEntityNames.join('|')})`), 'g');
|
|
@@ -9489,7 +9565,7 @@ function isNonblank({
|
|
|
9489
9565
|
case '\n':
|
|
9490
9566
|
return false;
|
|
9491
9567
|
default:
|
|
9492
|
-
return str.trimStart()
|
|
9568
|
+
return !(0, source_1.isWhitespace)(str.trimStart());
|
|
9493
9569
|
}
|
|
9494
9570
|
}
|
|
9495
9571
|
function trimBlank(parser) {
|