securemark 0.300.0 → 0.300.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/index.js +197 -113
- package/package.json +1 -1
- package/src/api/bind.ts +2 -2
- 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 +3 -3
- package/src/combinator/process/surround.ts +2 -0
- package/src/parser/block/codeblock.test.ts +0 -2
- package/src/parser/block/codeblock.ts +3 -3
- package/src/parser/block/extension/aside.test.ts +0 -1
- package/src/parser/block/extension/aside.ts +1 -1
- package/src/parser/block/extension/example.test.ts +0 -2
- package/src/parser/block/extension/example.ts +1 -1
- package/src/parser/block/extension/figure.test.ts +0 -4
- package/src/parser/block/extension/figure.ts +1 -1
- package/src/parser/block/extension/message.test.ts +0 -1
- package/src/parser/block/extension/message.ts +1 -1
- package/src/parser/block/extension/placeholder.ts +3 -3
- package/src/parser/block/extension/table.test.ts +0 -1
- package/src/parser/block/extension/table.ts +3 -3
- package/src/parser/block/mathblock.test.ts +0 -2
- package/src/parser/block/mathblock.ts +3 -3
- 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.1 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory(require("Prism"), require("DOMPurify"));
|
|
@@ -2461,7 +2461,7 @@ 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
2466
|
type: 'break'
|
|
2467
2467
|
};
|
|
@@ -2779,7 +2779,7 @@ function* parse(source, opts = {}, options) {
|
|
|
2779
2779
|
if (options.id?.match(/[^0-9a-z/-]/i)) throw new Error('Invalid ID: ID must be alphanumeric');
|
|
2780
2780
|
if (options.host?.origin === 'null') throw new Error(`Invalid host: ${options.host.href}`);
|
|
2781
2781
|
const output = new parser_1.Output();
|
|
2782
|
-
for (const _ of (0, parser_1.run)(document_1.document,
|
|
2782
|
+
for (const _ of (0, parser_1.run)(document_1.document, new context_1.Input(options, source), output)) yield;
|
|
2783
2783
|
return output.peek().head.value;
|
|
2784
2784
|
}
|
|
2785
2785
|
exports.parse = parse;
|
|
@@ -2878,20 +2878,28 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2878
2878
|
value: true
|
|
2879
2879
|
}));
|
|
2880
2880
|
exports.inits = void 0;
|
|
2881
|
+
const parser_1 = __webpack_require__(3360);
|
|
2881
2882
|
const union_1 = __webpack_require__(1226);
|
|
2882
2883
|
const sequence_1 = __webpack_require__(8880);
|
|
2883
|
-
const state_1 = __webpack_require__(9440);
|
|
2884
2884
|
function inits(parsers) {
|
|
2885
2885
|
switch (parsers.length) {
|
|
2886
2886
|
case 0:
|
|
2887
2887
|
return (_, output) => output.context;
|
|
2888
2888
|
case 1:
|
|
2889
|
-
return
|
|
2889
|
+
return parsers[0];
|
|
2890
2890
|
default:
|
|
2891
|
-
return parsers.reduceRight((acc, parser, i) => (0, sequence_1.sequence)([parser, i !== 0 ? acc : (0, union_1.union)([acc,
|
|
2891
|
+
return parsers.reduceRight((acc, parser, i) => (0, sequence_1.sequence)([parser, i !== 0 ? acc : (0, union_1.union)([acc, recovery])]));
|
|
2892
2892
|
}
|
|
2893
2893
|
}
|
|
2894
2894
|
exports.inits = inits;
|
|
2895
|
+
const recovery = (_, output) => {
|
|
2896
|
+
if (output.state) {
|
|
2897
|
+
output.state = true;
|
|
2898
|
+
// @ts-expect-error
|
|
2899
|
+
output.context ??= parser_1.Result.succ;
|
|
2900
|
+
}
|
|
2901
|
+
return output.context;
|
|
2902
|
+
};
|
|
2895
2903
|
|
|
2896
2904
|
/***/ },
|
|
2897
2905
|
|
|
@@ -2909,8 +2917,9 @@ const state_1 = __webpack_require__(9440);
|
|
|
2909
2917
|
function sequence(parsers) {
|
|
2910
2918
|
switch (parsers.length) {
|
|
2911
2919
|
case 0:
|
|
2920
|
+
return (_, output) => output.context;
|
|
2912
2921
|
case 1:
|
|
2913
|
-
return
|
|
2922
|
+
return parsers[0];
|
|
2914
2923
|
default:
|
|
2915
2924
|
return parsers.reduceRight((acc, parser) => (0, state_1.always)([parser, (0, state_1.success)(acc)]));
|
|
2916
2925
|
}
|
|
@@ -2979,7 +2988,7 @@ exports.some = some;
|
|
|
2979
2988
|
/***/ },
|
|
2980
2989
|
|
|
2981
2990
|
/***/ 9440
|
|
2982
|
-
(__unused_webpack_module, exports
|
|
2991
|
+
(__unused_webpack_module, exports) {
|
|
2983
2992
|
|
|
2984
2993
|
"use strict";
|
|
2985
2994
|
|
|
@@ -2987,8 +2996,7 @@ exports.some = some;
|
|
|
2987
2996
|
Object.defineProperty(exports, "__esModule", ({
|
|
2988
2997
|
value: true
|
|
2989
2998
|
}));
|
|
2990
|
-
exports.
|
|
2991
|
-
const parser_1 = __webpack_require__(3360);
|
|
2999
|
+
exports.force = exports.always = exports.failure = exports.success = exports.then = void 0;
|
|
2992
3000
|
function then(success, failure) {
|
|
2993
3001
|
return (input, output) => output.state ? success(input, output) : failure(input, output);
|
|
2994
3002
|
}
|
|
@@ -3009,14 +3017,6 @@ function force(parser) {
|
|
|
3009
3017
|
return (input, output) => input.position === input.source.length ? output.context : parser(input, output);
|
|
3010
3018
|
}
|
|
3011
3019
|
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
3020
|
|
|
3021
3021
|
/***/ },
|
|
3022
3022
|
|
|
@@ -3068,18 +3068,29 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
3068
3068
|
value: true
|
|
3069
3069
|
}));
|
|
3070
3070
|
exports.union = void 0;
|
|
3071
|
+
const parser_1 = __webpack_require__(3360);
|
|
3071
3072
|
const state_1 = __webpack_require__(9440);
|
|
3072
3073
|
function union(parsers) {
|
|
3073
3074
|
switch (parsers.length) {
|
|
3074
3075
|
case 0:
|
|
3075
3076
|
return (_, output) => output.context;
|
|
3076
3077
|
case 1:
|
|
3077
|
-
return
|
|
3078
|
+
return parsers[0];
|
|
3078
3079
|
default:
|
|
3079
|
-
return parsers.reduceRight((acc, parser) => (0, state_1.always)([parser, (0, state_1.failure)(
|
|
3080
|
+
return parsers.reduceRight((acc, parser) => (0, state_1.always)([parser, (0, state_1.failure)(recovery(acc))]));
|
|
3080
3081
|
}
|
|
3081
3082
|
}
|
|
3082
3083
|
exports.union = union;
|
|
3084
|
+
function recovery(parser) {
|
|
3085
|
+
return (input, output) => {
|
|
3086
|
+
if (!output.state) {
|
|
3087
|
+
output.state = true;
|
|
3088
|
+
// @ts-expect-error
|
|
3089
|
+
output.context ??= parser_1.Result.succ;
|
|
3090
|
+
}
|
|
3091
|
+
return parser(input, output);
|
|
3092
|
+
};
|
|
3093
|
+
}
|
|
3083
3094
|
|
|
3084
3095
|
/***/ },
|
|
3085
3096
|
|
|
@@ -3822,16 +3833,23 @@ function* run(parser, input, output) {
|
|
|
3822
3833
|
time = Date.now();
|
|
3823
3834
|
}
|
|
3824
3835
|
if (output.state && output.error) {
|
|
3825
|
-
output.state
|
|
3826
|
-
|
|
3836
|
+
if (output.state) {
|
|
3837
|
+
output.state = false;
|
|
3838
|
+
// @ts-expect-error
|
|
3839
|
+
output.context = Result.fail;
|
|
3840
|
+
}
|
|
3827
3841
|
}
|
|
3828
3842
|
const input = scope.peek();
|
|
3829
3843
|
//assert(input.position <= input.source.length);
|
|
3830
|
-
const
|
|
3844
|
+
const parser = queue.pop();
|
|
3845
|
+
const result = parser(input, output);
|
|
3831
3846
|
if (result) {
|
|
3832
3847
|
//assert(result.every(f => f));
|
|
3833
|
-
output.state
|
|
3834
|
-
|
|
3848
|
+
if (!output.state) {
|
|
3849
|
+
output.state = true;
|
|
3850
|
+
// @ts-expect-error
|
|
3851
|
+
output.context ??= Result.succ;
|
|
3852
|
+
}
|
|
3835
3853
|
if (result.length !== 0) {
|
|
3836
3854
|
if (queue.length !== 0) {
|
|
3837
3855
|
queue.memory = input.memory;
|
|
@@ -3846,8 +3864,11 @@ function* run(parser, input, output) {
|
|
|
3846
3864
|
if (result === Result.skip) {
|
|
3847
3865
|
queue.length = 0;
|
|
3848
3866
|
}
|
|
3849
|
-
output.state
|
|
3850
|
-
|
|
3867
|
+
if (output.state) {
|
|
3868
|
+
output.state = false;
|
|
3869
|
+
// @ts-expect-error
|
|
3870
|
+
output.context = Result.fail;
|
|
3871
|
+
}
|
|
3851
3872
|
}
|
|
3852
3873
|
if (queue.length !== 0) continue;
|
|
3853
3874
|
Queue.dispose(queue);
|
|
@@ -4232,7 +4253,7 @@ exports.fence = void 0;
|
|
|
4232
4253
|
const parser_1 = __webpack_require__(3360);
|
|
4233
4254
|
const clock_1 = __webpack_require__(3803);
|
|
4234
4255
|
const line_1 = __webpack_require__(1599);
|
|
4235
|
-
function fence(opener, write,
|
|
4256
|
+
function fence(opener, write, separation = true) {
|
|
4236
4257
|
return (input, output) => {
|
|
4237
4258
|
const {
|
|
4238
4259
|
source,
|
|
@@ -4258,11 +4279,11 @@ function fence(opener, write, limit, separation = true) {
|
|
|
4258
4279
|
for (let count = 1;; ++count) {
|
|
4259
4280
|
if (input.position === source.length) break;
|
|
4260
4281
|
const line = (0, line_1.firstline)(source, input.position);
|
|
4261
|
-
if (
|
|
4282
|
+
if (closer && (0, line_1.isEmptyline)(line, 0)) break;
|
|
4262
4283
|
if (closer) {
|
|
4263
4284
|
overflow += line;
|
|
4264
4285
|
}
|
|
4265
|
-
if (!closer &&
|
|
4286
|
+
if (!closer && line.startsWith(delim) && line.trimEnd() === delim) {
|
|
4266
4287
|
closer = line;
|
|
4267
4288
|
if ((0, line_1.isEmptyline)(source, input.position + line.length)) {
|
|
4268
4289
|
input.position += line.length;
|
|
@@ -4670,6 +4691,7 @@ function surround(opener, parser, closer, optional = false, backtracks = [], f,
|
|
|
4670
4691
|
const o = output.pop();
|
|
4671
4692
|
if (!g) return;
|
|
4672
4693
|
output.state = true;
|
|
4694
|
+
// @ts-expect-error
|
|
4673
4695
|
output.context = parser_1.Result.succ;
|
|
4674
4696
|
return g([o, state ? m : undefined], input, output);
|
|
4675
4697
|
}
|
|
@@ -4692,6 +4714,7 @@ function surround(opener, parser, closer, optional = false, backtracks = [], f,
|
|
|
4692
4714
|
wbs && setBacktrack(input, wbs, position);
|
|
4693
4715
|
if (!g) return;
|
|
4694
4716
|
output.state = true;
|
|
4717
|
+
// @ts-expect-error
|
|
4695
4718
|
output.context = parser_1.Result.succ;
|
|
4696
4719
|
return g([o, state ? m : undefined], input, output);
|
|
4697
4720
|
}
|
|
@@ -4962,9 +4985,9 @@ const util_1 = __webpack_require__(4992);
|
|
|
4962
4985
|
const dom_1 = __webpack_require__(394);
|
|
4963
4986
|
const opener = /(`{3,})(?!`)([^\r\n]*)(?:$|\r?\n)/y;
|
|
4964
4987
|
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
|
|
4988
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false));
|
|
4989
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false, false), false);
|
|
4990
|
+
exports.codeblock = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true), (input, output) => {
|
|
4968
4991
|
const [body, overflow, closer, opener, delim, param] = (0, util_1.unwrap)(output.pop());
|
|
4969
4992
|
const params = param.match(/(?:\\.?|\S)+/g)?.reduce((params, value, i) => {
|
|
4970
4993
|
let name;
|
|
@@ -5086,7 +5109,7 @@ const document_1 = __webpack_require__(5029);
|
|
|
5086
5109
|
const indexee_1 = __webpack_require__(7610);
|
|
5087
5110
|
const util_1 = __webpack_require__(4992);
|
|
5088
5111
|
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
|
|
5112
|
+
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
5113
|
const [body, overflow, closer, opener, delim, param] = (0, util_1.unwrap)(output.pop());
|
|
5091
5114
|
if (!closer || overflow || param.trimStart()) {
|
|
5092
5115
|
output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
@@ -5156,7 +5179,7 @@ const document_1 = __webpack_require__(5029);
|
|
|
5156
5179
|
const mathblock_1 = __webpack_require__(4903);
|
|
5157
5180
|
const util_1 = __webpack_require__(4992);
|
|
5158
5181
|
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
|
|
5182
|
+
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
5183
|
const [body, overflow, closer, opener, delim, type = 'markdown', param] = (0, util_1.unwrap)(output.pop());
|
|
5161
5184
|
if (!closer || overflow || param.trimStart()) return output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
5162
5185
|
class: 'invalid',
|
|
@@ -5329,7 +5352,7 @@ exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinat
|
|
|
5329
5352
|
}), (0, dom_1.html)('span', {
|
|
5330
5353
|
class: 'figtext'
|
|
5331
5354
|
}, (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
|
|
5355
|
+
})), (0, combinator_1.inits)([(0, combinator_1.fence)(/(~{3,})(?:figure(?=$|[ \r\n])|\[?\$)[^\r\n]*(?:$|\r?\n)/y, true), (_, output) => {
|
|
5333
5356
|
const [body, overflow, closer, opener, delim] = (0, util_1.unwrap)(output.pop());
|
|
5334
5357
|
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
5358
|
return output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
@@ -5405,7 +5428,7 @@ const mediablock_1 = __webpack_require__(2583);
|
|
|
5405
5428
|
const paragraph_1 = __webpack_require__(4330);
|
|
5406
5429
|
const util_1 = __webpack_require__(4992);
|
|
5407
5430
|
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
|
|
5431
|
+
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
5432
|
const [body, overflow, closer, opener, delim, type, param] = (0, util_1.unwrap)(output.pop());
|
|
5410
5433
|
if (!closer || overflow || param.trimStart()) {
|
|
5411
5434
|
output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
@@ -5472,9 +5495,9 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
5472
5495
|
const util_1 = __webpack_require__(4992);
|
|
5473
5496
|
const dom_1 = __webpack_require__(394);
|
|
5474
5497
|
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
|
|
5498
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false));
|
|
5499
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false, false), false);
|
|
5500
|
+
exports.placeholder = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true), (_, output) => {
|
|
5478
5501
|
const [body, overflow, closer, opener, delim] = (0, util_1.unwrap)(output.pop());
|
|
5479
5502
|
return output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
5480
5503
|
class: 'invalid',
|
|
@@ -5505,9 +5528,9 @@ const alias_1 = __webpack_require__(5413);
|
|
|
5505
5528
|
const array_1 = __webpack_require__(6876);
|
|
5506
5529
|
const dom_1 = __webpack_require__(394);
|
|
5507
5530
|
const opener = /(~{3,})table(?:\/(\S+))?(?!\S)([^\r\n]*)(?:$|\r?\n)/y;
|
|
5508
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false
|
|
5509
|
-
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false,
|
|
5510
|
-
exports.table = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true
|
|
5531
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false));
|
|
5532
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false, false), false);
|
|
5533
|
+
exports.table = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true), (_, output) => {
|
|
5511
5534
|
const [body, overflow, closer, opener, delim, type, param] = (0, util_1.unwrap)(output.pop());
|
|
5512
5535
|
if (!closer || overflow || param.trimStart()) return output.append(new parser_1.Node((0, dom_1.html)('pre', {
|
|
5513
5536
|
class: 'invalid',
|
|
@@ -5850,9 +5873,9 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
5850
5873
|
const util_1 = __webpack_require__(4992);
|
|
5851
5874
|
const dom_1 = __webpack_require__(394);
|
|
5852
5875
|
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
|
|
5876
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.fence)(opener, false));
|
|
5877
|
+
exports.segment_ = (0, combinator_1.block)((0, combinator_1.fence)(opener, false, false), false);
|
|
5878
|
+
exports.mathblock = (0, combinator_1.block)((0, combinator_1.inits)([(0, combinator_1.fence)(opener, true), ({
|
|
5856
5879
|
caches: {
|
|
5857
5880
|
math: cache = undefined
|
|
5858
5881
|
} = {}
|
|
@@ -6314,21 +6337,21 @@ function format(list) {
|
|
|
6314
6337
|
Object.defineProperty(exports, "__esModule", ({
|
|
6315
6338
|
value: true
|
|
6316
6339
|
}));
|
|
6317
|
-
exports.
|
|
6340
|
+
exports.Input = exports.input = void 0;
|
|
6318
6341
|
const parser_1 = __webpack_require__(3360);
|
|
6319
6342
|
function input(source, input = new Input()) {
|
|
6320
6343
|
return (0, parser_1.input)(source, input);
|
|
6321
6344
|
}
|
|
6322
6345
|
exports.input = input;
|
|
6323
6346
|
class Input extends parser_1.Input {
|
|
6324
|
-
constructor(options = {}) {
|
|
6347
|
+
constructor(options = {}, source) {
|
|
6325
6348
|
super(options);
|
|
6326
6349
|
this.recursion = new RecursionCounter(2);
|
|
6327
6350
|
const {
|
|
6328
6351
|
segment,
|
|
6329
6352
|
header,
|
|
6330
6353
|
local,
|
|
6331
|
-
|
|
6354
|
+
whitespace,
|
|
6332
6355
|
host,
|
|
6333
6356
|
url,
|
|
6334
6357
|
id,
|
|
@@ -6336,15 +6359,16 @@ class Input extends parser_1.Input {
|
|
|
6336
6359
|
caches,
|
|
6337
6360
|
test
|
|
6338
6361
|
} = options;
|
|
6362
|
+
this.source = source ?? options.source ?? '';
|
|
6339
6363
|
this.resources ??= {
|
|
6340
6364
|
clock: -1,
|
|
6341
6365
|
interval: 200,
|
|
6342
|
-
recursions: [10 || 0 /* Recursion.
|
|
6366
|
+
recursions: [10 || 0 /* Recursion.document */, 100 || 0 /* Recursion.block */, 100 || 0 /* Recursion.inline */, 100 || 0 /* Recursion.bracket */]
|
|
6343
6367
|
};
|
|
6344
6368
|
this.segment = segment ?? 0 /* Segment.unknown */;
|
|
6345
6369
|
this.header = header ?? true;
|
|
6346
6370
|
this.local = local ?? false;
|
|
6347
|
-
this.
|
|
6371
|
+
this.whitespace = whitespace ?? false;
|
|
6348
6372
|
this.host = host;
|
|
6349
6373
|
this.url = url;
|
|
6350
6374
|
this.id = id;
|
|
@@ -6371,9 +6395,6 @@ class RecursionCounter {
|
|
|
6371
6395
|
++this.index;
|
|
6372
6396
|
}
|
|
6373
6397
|
}
|
|
6374
|
-
exports.CmdRegExp = {
|
|
6375
|
-
Error: /\x07/g
|
|
6376
|
-
};
|
|
6377
6398
|
|
|
6378
6399
|
/***/ },
|
|
6379
6400
|
|
|
@@ -6408,7 +6429,7 @@ exports.document = (() => {
|
|
|
6408
6429
|
};
|
|
6409
6430
|
output.push();
|
|
6410
6431
|
return output.context;
|
|
6411
|
-
}, (0, combinator_1.recursion)(0 /* Recursion.
|
|
6432
|
+
}, (0, combinator_1.recursion)(0 /* Recursion.document */, (0, combinator_1.force)(() => loop)), (input, output) => {
|
|
6412
6433
|
const doc = (0, dom_1.frag)((0, util_1.unwrap)(output.pop()));
|
|
6413
6434
|
output.append(new parser_1.Node(doc));
|
|
6414
6435
|
if (input.test && !input.local) return output.context;
|
|
@@ -6940,7 +6961,7 @@ exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.focus)(/(?<=^|[\
|
|
|
6940
6961
|
input.position = source.length;
|
|
6941
6962
|
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
6963
|
})), (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.
|
|
6964
|
+
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
6965
|
|
|
6945
6966
|
/***/ },
|
|
6946
6967
|
|
|
@@ -8002,7 +8023,7 @@ exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combin
|
|
|
8002
8023
|
translate: 'no',
|
|
8003
8024
|
...(0, util_1.invalid)('math', 'content', `"${source.match(forbiddenCommand)[0]}" command is forbidden`)
|
|
8004
8025
|
}, 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.
|
|
8026
|
+
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
8027
|
|
|
8007
8028
|
/***/ },
|
|
8008
8029
|
|
|
@@ -8081,7 +8102,7 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* S
|
|
|
8081
8102
|
target: '_blank'
|
|
8082
8103
|
}, [el]))]);
|
|
8083
8104
|
})))));
|
|
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.
|
|
8105
|
+
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
8106
|
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
8107
|
value: a
|
|
8087
8108
|
}], [{
|
|
@@ -8306,9 +8327,8 @@ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.backtrack)((0, comb
|
|
|
8306
8327
|
}) => acc ? acc + ' ' + value : value, '').trim())), new parser_1.Node((0, dom_1.html)('rp', ')'))])))))]);
|
|
8307
8328
|
}
|
|
8308
8329
|
})));
|
|
8309
|
-
const delimiter = /[$"`\[\](){}<>()[]{}|]|\\?\r?\n/y;
|
|
8310
8330
|
const text = (0, combinator_1.always)([(input, output) => {
|
|
8311
|
-
input.
|
|
8331
|
+
input.whitespace = true;
|
|
8312
8332
|
input.memory = {
|
|
8313
8333
|
position: 0,
|
|
8314
8334
|
state: false,
|
|
@@ -8319,7 +8339,7 @@ const text = (0, combinator_1.always)([(input, output) => {
|
|
|
8319
8339
|
const {
|
|
8320
8340
|
memory
|
|
8321
8341
|
} = input;
|
|
8322
|
-
input.
|
|
8342
|
+
input.whitespace = false;
|
|
8323
8343
|
return memory.state || memory.nodes.last.value.trimStart() !== '' ? output.import(memory.nodes) : undefined;
|
|
8324
8344
|
}]);
|
|
8325
8345
|
const loop = [(input, output) => {
|
|
@@ -8331,9 +8351,8 @@ const loop = [(input, output) => {
|
|
|
8331
8351
|
position
|
|
8332
8352
|
} = input;; position = input.position) {
|
|
8333
8353
|
if (position === source.length) return parser_1.Result.skip;
|
|
8334
|
-
|
|
8335
|
-
if (
|
|
8336
|
-
if (source[position].trimStart() !== '') break;
|
|
8354
|
+
if (isDelimiter(source, position)) return parser_1.Result.skip;
|
|
8355
|
+
if (!(0, source_1.isWhitespace)(source[position])) break;
|
|
8337
8356
|
memory.state ||= memory.nodes.last.value.trimStart() !== '';
|
|
8338
8357
|
memory.nodes.push(new parser_1.Node(''));
|
|
8339
8358
|
input.position += 1;
|
|
@@ -8354,6 +8373,44 @@ function* zip(a, b) {
|
|
|
8354
8373
|
yield [ra.value, rb.value];
|
|
8355
8374
|
}
|
|
8356
8375
|
}
|
|
8376
|
+
function isDelimiter(source, position) {
|
|
8377
|
+
switch (source[position]) {
|
|
8378
|
+
case '$':
|
|
8379
|
+
case '"':
|
|
8380
|
+
case '`':
|
|
8381
|
+
case '[':
|
|
8382
|
+
case ']':
|
|
8383
|
+
case '(':
|
|
8384
|
+
case ')':
|
|
8385
|
+
case '{':
|
|
8386
|
+
case '}':
|
|
8387
|
+
case '<':
|
|
8388
|
+
case '>':
|
|
8389
|
+
case '(':
|
|
8390
|
+
case ')':
|
|
8391
|
+
case '[':
|
|
8392
|
+
case ']':
|
|
8393
|
+
case '{':
|
|
8394
|
+
case '}':
|
|
8395
|
+
case '|':
|
|
8396
|
+
return true;
|
|
8397
|
+
case '\\':
|
|
8398
|
+
switch (source[position + 1]) {
|
|
8399
|
+
case '\r':
|
|
8400
|
+
return source[position + 2] === '\n';
|
|
8401
|
+
case '\n':
|
|
8402
|
+
return true;
|
|
8403
|
+
default:
|
|
8404
|
+
return false;
|
|
8405
|
+
}
|
|
8406
|
+
case '\r':
|
|
8407
|
+
return source[position + 1] === '\n';
|
|
8408
|
+
case '\n':
|
|
8409
|
+
return true;
|
|
8410
|
+
default:
|
|
8411
|
+
return false;
|
|
8412
|
+
}
|
|
8413
|
+
}
|
|
8357
8414
|
|
|
8358
8415
|
/***/ },
|
|
8359
8416
|
|
|
@@ -8422,7 +8479,7 @@ exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.backtrack)((0,
|
|
|
8422
8479
|
class: 'invalid',
|
|
8423
8480
|
...(0, util_1.invalid)('template', 'syntax', `Missing the closing symbol "}}"`)
|
|
8424
8481
|
}, 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.
|
|
8482
|
+
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
8483
|
|
|
8427
8484
|
/***/ },
|
|
8428
8485
|
|
|
@@ -8716,7 +8773,7 @@ exports.segment = segment;
|
|
|
8716
8773
|
Object.defineProperty(exports, "__esModule", ({
|
|
8717
8774
|
value: true
|
|
8718
8775
|
}));
|
|
8719
|
-
exports.anyline = exports.emptysegment = exports.emptyline = exports.contentline = exports.strs = exports.str = exports.unescsource = exports.escsource = exports.txt = exports.text = void 0;
|
|
8776
|
+
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
8777
|
var text_1 = __webpack_require__(5655);
|
|
8721
8778
|
Object.defineProperty(exports, "text", ({
|
|
8722
8779
|
enumerable: true,
|
|
@@ -8757,6 +8814,13 @@ Object.defineProperty(exports, "strs", ({
|
|
|
8757
8814
|
return str_1.strs;
|
|
8758
8815
|
}
|
|
8759
8816
|
}));
|
|
8817
|
+
var whitespace_1 = __webpack_require__(9009);
|
|
8818
|
+
Object.defineProperty(exports, "isWhitespace", ({
|
|
8819
|
+
enumerable: true,
|
|
8820
|
+
get: function () {
|
|
8821
|
+
return whitespace_1.isWhitespace;
|
|
8822
|
+
}
|
|
8823
|
+
}));
|
|
8760
8824
|
var line_1 = __webpack_require__(702);
|
|
8761
8825
|
Object.defineProperty(exports, "contentline", ({
|
|
8762
8826
|
enumerable: true,
|
|
@@ -8829,7 +8893,6 @@ const escsource = (input, output) => {
|
|
|
8829
8893
|
input.linebreak ||= source.length - position;
|
|
8830
8894
|
return output.append(new parser_1.Node((0, dom_1.html)('br'), 1 /* Flag.blank */));
|
|
8831
8895
|
default:
|
|
8832
|
-
if (input.sequential) return output.append(new parser_1.Node(char));
|
|
8833
8896
|
let i = seek(source, position);
|
|
8834
8897
|
i -= position;
|
|
8835
8898
|
(0, combinator_1.spend)(input, output, i - 1);
|
|
@@ -8998,6 +9061,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
8998
9061
|
exports.isAlphanumeric = exports.backToEmailHead = exports.backToUrlHead = exports.canSkip = exports.txt = exports.text = exports.nonWhitespace = void 0;
|
|
8999
9062
|
const parser_1 = __webpack_require__(3360);
|
|
9000
9063
|
const combinator_1 = __webpack_require__(3484);
|
|
9064
|
+
const whitespace_1 = __webpack_require__(9009);
|
|
9001
9065
|
const dom_1 = __webpack_require__(394);
|
|
9002
9066
|
exports.nonWhitespace = /[^ \t ]/g;
|
|
9003
9067
|
const text = (input, output) => {
|
|
@@ -9030,10 +9094,9 @@ const text = (input, output) => {
|
|
|
9030
9094
|
input.linebreak ||= source.length - position;
|
|
9031
9095
|
return output.append(new parser_1.Node((0, dom_1.html)('br'), 1 /* Flag.blank */));
|
|
9032
9096
|
default:
|
|
9033
|
-
if (input.sequential) return output.append(new parser_1.Node(char));
|
|
9034
9097
|
exports.nonWhitespace.lastIndex = position + 1;
|
|
9035
9098
|
const s = canSkip(source, position);
|
|
9036
|
-
let i = s ? exports.nonWhitespace.test(source) ? exports.nonWhitespace.lastIndex - 1 : source.length : next(source, position, state);
|
|
9099
|
+
let i = s ? exports.nonWhitespace.test(source) ? exports.nonWhitespace.lastIndex - 1 : source.length : next(source, position, input.whitespace, state);
|
|
9037
9100
|
const lineend = false || s && i === source.length || s && source[i] === '\r' || s && source[i] === '\n';
|
|
9038
9101
|
i -= position;
|
|
9039
9102
|
i = lineend ? i : i - +s || 1;
|
|
@@ -9047,26 +9110,13 @@ const text = (input, output) => {
|
|
|
9047
9110
|
exports.text = text;
|
|
9048
9111
|
exports.txt = (0, combinator_1.union)([exports.text]);
|
|
9049
9112
|
function canSkip(source, position) {
|
|
9050
|
-
if (!isWhitespace(source[position], false)) return false;
|
|
9113
|
+
if (!(0, whitespace_1.isWhitespace)(source[position], false)) return false;
|
|
9051
9114
|
if (position + 1 === source.length) return true;
|
|
9052
|
-
return isWhitespace(source[position + 1], true);
|
|
9115
|
+
return (0, whitespace_1.isWhitespace)(source[position + 1], true);
|
|
9053
9116
|
}
|
|
9054
9117
|
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);
|
|
9118
|
+
function next(source, position, space, state) {
|
|
9119
|
+
let index = seek(source, position, space, state);
|
|
9070
9120
|
if (index === source.length) return index;
|
|
9071
9121
|
const char = source[index];
|
|
9072
9122
|
switch (char) {
|
|
@@ -9136,7 +9186,7 @@ function isAlphanumeric(char) {
|
|
|
9136
9186
|
return 'A' <= char && char <= 'Z';
|
|
9137
9187
|
}
|
|
9138
9188
|
exports.isAlphanumeric = isAlphanumeric;
|
|
9139
|
-
function seek(source, position, state) {
|
|
9189
|
+
function seek(source, position, space, state) {
|
|
9140
9190
|
for (let i = position + 1; i < source.length; ++i) {
|
|
9141
9191
|
const char = source[i];
|
|
9142
9192
|
switch (char) {
|
|
@@ -9177,7 +9227,7 @@ function seek(source, position, state) {
|
|
|
9177
9227
|
if (source[i + 1] === char && source[i + 2] === char) return i;
|
|
9178
9228
|
continue;
|
|
9179
9229
|
case '%':
|
|
9180
|
-
if (source[i + 1] === ']' && isWhitespace(source[i - 1]
|
|
9230
|
+
if (source[i + 1] === ']' && (0, whitespace_1.isWhitespace)(source[i - 1])) return i;
|
|
9181
9231
|
continue;
|
|
9182
9232
|
case ':':
|
|
9183
9233
|
if (source[i + 1] === '/' && source[i + 2] === '/') return i;
|
|
@@ -9185,30 +9235,14 @@ function seek(source, position, state) {
|
|
|
9185
9235
|
case '&':
|
|
9186
9236
|
if (source[i + 1] !== ' ') return i;
|
|
9187
9237
|
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
9238
|
default:
|
|
9239
|
+
if (!(0, whitespace_1.isWhitespace)(char)) continue;
|
|
9240
|
+
if (space) return i;
|
|
9241
|
+
if (i + 1 === source.length) return i;
|
|
9242
|
+
if ((0, whitespace_1.isWhitespace)(source[i + 1])) return i;
|
|
9243
|
+
if (source[i + 1] !== '\\') continue;
|
|
9244
|
+
if (i + 2 === source.length) return i;
|
|
9245
|
+
if ((0, whitespace_1.isWhitespace)(source[i + 2])) return i;
|
|
9212
9246
|
continue;
|
|
9213
9247
|
}
|
|
9214
9248
|
}
|
|
@@ -9252,7 +9286,6 @@ const unescsource = (input, output) => {
|
|
|
9252
9286
|
input.linebreak ||= source.length - position;
|
|
9253
9287
|
return output.append(new parser_1.Node((0, dom_1.html)('br'), 1 /* Flag.blank */));
|
|
9254
9288
|
default:
|
|
9255
|
-
if (input.sequential) return output.append(new parser_1.Node(char));
|
|
9256
9289
|
text_1.nonWhitespace.lastIndex = position + 1;
|
|
9257
9290
|
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
9291
|
i -= position;
|
|
@@ -9338,6 +9371,56 @@ function category(char) {
|
|
|
9338
9371
|
|
|
9339
9372
|
/***/ },
|
|
9340
9373
|
|
|
9374
|
+
/***/ 9009
|
|
9375
|
+
(__unused_webpack_module, exports) {
|
|
9376
|
+
|
|
9377
|
+
"use strict";
|
|
9378
|
+
|
|
9379
|
+
|
|
9380
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
9381
|
+
value: true
|
|
9382
|
+
}));
|
|
9383
|
+
exports.isWhitespace = void 0;
|
|
9384
|
+
// https://util.unicode.org/UnicodeJsps/list-unicodeset.jsp?a=%5Cp%7BWhite_Space%7D&g=&i=
|
|
9385
|
+
// https://en.wikipedia.org/wiki/Whitespace_character
|
|
9386
|
+
// https://en.wikipedia.org/wiki/Newline
|
|
9387
|
+
function isWhitespace(char, linebreak = true) {
|
|
9388
|
+
switch (char) {
|
|
9389
|
+
case '\u0009':
|
|
9390
|
+
case '\u000B':
|
|
9391
|
+
case '\u000C':
|
|
9392
|
+
case '\u0020':
|
|
9393
|
+
case '\u0085':
|
|
9394
|
+
case '\u00A0':
|
|
9395
|
+
case '\u1680':
|
|
9396
|
+
case '\u2000':
|
|
9397
|
+
case '\u2001':
|
|
9398
|
+
case '\u2002':
|
|
9399
|
+
case '\u2003':
|
|
9400
|
+
case '\u2004':
|
|
9401
|
+
case '\u2005':
|
|
9402
|
+
case '\u2006':
|
|
9403
|
+
case '\u2007':
|
|
9404
|
+
case '\u2008':
|
|
9405
|
+
case '\u2009':
|
|
9406
|
+
case '\u200A':
|
|
9407
|
+
case '\u2028':
|
|
9408
|
+
case '\u2029':
|
|
9409
|
+
case '\u202F':
|
|
9410
|
+
case '\u205F':
|
|
9411
|
+
case '\u3000':
|
|
9412
|
+
return true;
|
|
9413
|
+
case '\u000A':
|
|
9414
|
+
case '\u000D':
|
|
9415
|
+
return linebreak;
|
|
9416
|
+
default:
|
|
9417
|
+
return false;
|
|
9418
|
+
}
|
|
9419
|
+
}
|
|
9420
|
+
exports.isWhitespace = isWhitespace;
|
|
9421
|
+
|
|
9422
|
+
/***/ },
|
|
9423
|
+
|
|
9341
9424
|
/***/ 4992
|
|
9342
9425
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
9343
9426
|
|
|
@@ -9415,6 +9498,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
9415
9498
|
exports.trimBlankNodeEnd = exports.trimBlankEnd = exports.trimBlank = exports.isNonblankNodeStart = exports.isNonblankFirstLine = exports.beforeNonblankWith = exports.blankWith = exports.afterNonblank = exports.beforeNonblank = exports.visualize = void 0;
|
|
9416
9499
|
const combinator_1 = __webpack_require__(3484);
|
|
9417
9500
|
const normalize_1 = __webpack_require__(5188);
|
|
9501
|
+
const source_1 = __webpack_require__(8745);
|
|
9418
9502
|
var blank;
|
|
9419
9503
|
(function (blank) {
|
|
9420
9504
|
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 +9573,7 @@ function isNonblank({
|
|
|
9489
9573
|
case '\n':
|
|
9490
9574
|
return false;
|
|
9491
9575
|
default:
|
|
9492
|
-
return str.trimStart()
|
|
9576
|
+
return !(0, source_1.isWhitespace)(str.trimStart());
|
|
9493
9577
|
}
|
|
9494
9578
|
}
|
|
9495
9579
|
function trimBlank(parser) {
|