securemark 0.298.7 → 0.299.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/index.js +128 -359
- package/package.json +1 -1
- package/src/combinator/control/constraint/block.ts +8 -5
- package/src/combinator/control/constraint/line.ts +13 -7
- package/src/combinator/control/manipulation/convert.ts +8 -11
- package/src/combinator/control/manipulation/match.ts +8 -4
- package/src/combinator/control/manipulation/scope.ts +6 -4
- package/src/combinator/control/monad/bind.ts +14 -6
- package/src/combinator/data/parser/context.ts +1 -74
- package/src/combinator/data/parser.ts +10 -8
- package/src/parser/api/normalize.ts +2 -0
- package/src/parser/block/blockquote.ts +7 -7
- package/src/parser/block/extension/aside.ts +1 -1
- package/src/parser/block/extension/example.ts +1 -1
- package/src/parser/block/extension/fig.ts +4 -4
- package/src/parser/block/extension/figbase.ts +1 -1
- package/src/parser/block/extension/figure.ts +3 -3
- package/src/parser/block/extension/message.ts +1 -1
- package/src/parser/block/extension/table.ts +8 -8
- package/src/parser/block/heading.ts +1 -1
- package/src/parser/block/ilist.ts +3 -3
- package/src/parser/block/mediablock.ts +1 -1
- package/src/parser/block/olist.ts +2 -2
- package/src/parser/block/pagebreak.ts +1 -1
- package/src/parser/block/reply/cite.ts +1 -1
- package/src/parser/block/sidefence.ts +6 -6
- package/src/parser/block/table.ts +2 -2
- package/src/parser/block/ulist.ts +3 -3
- package/src/parser/header.ts +2 -3
- package/src/parser/inline/annotation.ts +1 -1
- package/src/parser/inline/autolink/url.ts +1 -1
- package/src/parser/inline/code.ts +1 -1
- package/src/parser/inline/extension/indexer.ts +1 -1
- package/src/parser/inline/html.ts +1 -1
- package/src/parser/inline/link.ts +1 -1
- package/src/parser/inline/math.ts +2 -2
- package/src/parser/inline/remark.ts +2 -2
- package/src/parser/inline/ruby.ts +1 -1
- package/src/parser/inline/shortmedia.ts +1 -1
- package/src/parser/repeat.ts +8 -5
- package/src/parser/segment.ts +1 -2
- package/src/parser/source/escapable.ts +1 -1
- package/src/parser/source/text.test.ts +4 -0
- package/src/parser/source/text.ts +2 -0
- package/src/parser/visibility.ts +17 -13
- package/src/combinator/data/parser/context.test.ts +0 -62
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.
|
|
1
|
+
/*! securemark v0.299.0 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory(require("Prism"), require("DOMPurify"));
|
|
@@ -167,129 +167,6 @@ exports.splice = splice;
|
|
|
167
167
|
|
|
168
168
|
/***/ },
|
|
169
169
|
|
|
170
|
-
/***/ 9888
|
|
171
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
172
|
-
|
|
173
|
-
"use strict";
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
177
|
-
value: true
|
|
178
|
-
}));
|
|
179
|
-
exports.template = exports.inherit = exports.merge = exports.extend = exports.overwrite = exports.clone = exports.assign = void 0;
|
|
180
|
-
const alias_1 = __webpack_require__(5413);
|
|
181
|
-
const type_1 = __webpack_require__(113);
|
|
182
|
-
const array_1 = __webpack_require__(6876);
|
|
183
|
-
exports.assign = template((prop, target, source) => target[prop] = source[prop]);
|
|
184
|
-
exports.clone = template((prop, target, source) => {
|
|
185
|
-
switch ((0, type_1.type)(source[prop])) {
|
|
186
|
-
case 'Array':
|
|
187
|
-
return target[prop] = source[prop].slice();
|
|
188
|
-
case 'Object':
|
|
189
|
-
switch ((0, type_1.type)(target[prop])) {
|
|
190
|
-
case 'Object':
|
|
191
|
-
return target[prop] = (0, exports.clone)(empty(source[prop]), source[prop]);
|
|
192
|
-
default:
|
|
193
|
-
return target[prop] = source[prop];
|
|
194
|
-
}
|
|
195
|
-
default:
|
|
196
|
-
return target[prop] = source[prop];
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
exports.overwrite = template((prop, target, source) => {
|
|
200
|
-
switch ((0, type_1.type)(source[prop])) {
|
|
201
|
-
case 'Array':
|
|
202
|
-
return target[prop] = source[prop];
|
|
203
|
-
case 'Object':
|
|
204
|
-
switch ((0, type_1.type)(target[prop])) {
|
|
205
|
-
case 'Object':
|
|
206
|
-
return (0, exports.overwrite)(target[prop], source[prop]);
|
|
207
|
-
default:
|
|
208
|
-
return target[prop] = (0, exports.overwrite)(empty(source[prop]), source[prop]);
|
|
209
|
-
}
|
|
210
|
-
default:
|
|
211
|
-
return target[prop] = source[prop];
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
exports.extend = template((prop, target, source) => {
|
|
215
|
-
switch ((0, type_1.type)(source[prop])) {
|
|
216
|
-
case 'undefined':
|
|
217
|
-
return;
|
|
218
|
-
case 'Array':
|
|
219
|
-
return target[prop] = source[prop];
|
|
220
|
-
case 'Object':
|
|
221
|
-
switch ((0, type_1.type)(target[prop])) {
|
|
222
|
-
case 'Object':
|
|
223
|
-
return (0, exports.extend)(target[prop], source[prop]);
|
|
224
|
-
default:
|
|
225
|
-
return target[prop] = (0, exports.extend)(empty(source[prop]), source[prop]);
|
|
226
|
-
}
|
|
227
|
-
default:
|
|
228
|
-
return target[prop] = source[prop];
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
exports.merge = template((prop, target, source) => {
|
|
232
|
-
switch ((0, type_1.type)(source[prop])) {
|
|
233
|
-
case 'undefined':
|
|
234
|
-
return;
|
|
235
|
-
case 'Array':
|
|
236
|
-
switch ((0, type_1.type)(target[prop])) {
|
|
237
|
-
case 'Array':
|
|
238
|
-
return target[prop] = (0, array_1.push)(target[prop], source[prop]);
|
|
239
|
-
default:
|
|
240
|
-
return target[prop] = source[prop].slice();
|
|
241
|
-
}
|
|
242
|
-
case 'Object':
|
|
243
|
-
switch ((0, type_1.type)(target[prop])) {
|
|
244
|
-
case 'Object':
|
|
245
|
-
return (0, exports.merge)(target[prop], source[prop]);
|
|
246
|
-
default:
|
|
247
|
-
return target[prop] = (0, exports.merge)(empty(source[prop]), source[prop]);
|
|
248
|
-
}
|
|
249
|
-
default:
|
|
250
|
-
return target[prop] = source[prop];
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
exports.inherit = template((prop, target, source) => {
|
|
254
|
-
switch ((0, type_1.type)(source[prop])) {
|
|
255
|
-
case 'undefined':
|
|
256
|
-
return;
|
|
257
|
-
case 'Array':
|
|
258
|
-
return target[prop] = source[prop].slice();
|
|
259
|
-
case 'Object':
|
|
260
|
-
switch ((0, type_1.type)(target[prop])) {
|
|
261
|
-
case 'Object':
|
|
262
|
-
return (0, exports.inherit)(target[prop], source[prop]);
|
|
263
|
-
default:
|
|
264
|
-
return target[prop] = (0, alias_1.ObjectCreate)(source[prop]);
|
|
265
|
-
}
|
|
266
|
-
default:
|
|
267
|
-
return target[prop] = source[prop];
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
function template(strategy) {
|
|
271
|
-
return walk;
|
|
272
|
-
function walk(target, ...sources) {
|
|
273
|
-
if ((0, type_1.isPrimitive)(target)) return target;
|
|
274
|
-
for (let i = 0; i < sources.length; ++i) {
|
|
275
|
-
const source = sources[i];
|
|
276
|
-
if (source === target) continue;
|
|
277
|
-
if ((0, type_1.isPrimitive)(source)) continue;
|
|
278
|
-
const keys = Object.keys(source);
|
|
279
|
-
for (let i = 0; i < keys.length; ++i) {
|
|
280
|
-
strategy(keys[i], target, source);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return target;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
exports.template = template;
|
|
287
|
-
function empty(source) {
|
|
288
|
-
return source instanceof Object ? {} : (0, alias_1.ObjectCreate)(null);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/***/ },
|
|
292
|
-
|
|
293
170
|
/***/ 6212
|
|
294
171
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
295
172
|
|
|
@@ -2193,68 +2070,6 @@ True LRUにおけるLRUからの大幅な改善はすべてのアルゴリズム
|
|
|
2193
2070
|
|
|
2194
2071
|
/***/ },
|
|
2195
2072
|
|
|
2196
|
-
/***/ 113
|
|
2197
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
2198
|
-
|
|
2199
|
-
"use strict";
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
2203
|
-
value: true
|
|
2204
|
-
}));
|
|
2205
|
-
exports.isPrimitive = exports.is = exports.type = void 0;
|
|
2206
|
-
const alias_1 = __webpack_require__(5413);
|
|
2207
|
-
const ObjectPrototype = Object.prototype;
|
|
2208
|
-
const ArrayPrototype = Array.prototype;
|
|
2209
|
-
function type(value) {
|
|
2210
|
-
const type = typeof value;
|
|
2211
|
-
switch (type) {
|
|
2212
|
-
case 'function':
|
|
2213
|
-
return 'Function';
|
|
2214
|
-
case 'object':
|
|
2215
|
-
if (value === null) return 'null';
|
|
2216
|
-
const tag = value[Symbol.toStringTag];
|
|
2217
|
-
if (tag) return tag;
|
|
2218
|
-
switch ((0, alias_1.ObjectGetPrototypeOf)(value)) {
|
|
2219
|
-
case ArrayPrototype:
|
|
2220
|
-
return 'Array';
|
|
2221
|
-
case ObjectPrototype:
|
|
2222
|
-
return 'Object';
|
|
2223
|
-
default:
|
|
2224
|
-
return value?.constructor?.name || (0, alias_1.toString)(value).slice(8, -1);
|
|
2225
|
-
}
|
|
2226
|
-
default:
|
|
2227
|
-
return type;
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
exports.type = type;
|
|
2231
|
-
function is(type, value) {
|
|
2232
|
-
switch (type) {
|
|
2233
|
-
case 'null':
|
|
2234
|
-
return value === null;
|
|
2235
|
-
case 'array':
|
|
2236
|
-
return (0, alias_1.isArray)(value);
|
|
2237
|
-
case 'object':
|
|
2238
|
-
return value !== null && typeof value === type;
|
|
2239
|
-
default:
|
|
2240
|
-
return typeof value === type;
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
|
-
exports.is = is;
|
|
2244
|
-
function isPrimitive(value) {
|
|
2245
|
-
switch (typeof value) {
|
|
2246
|
-
case 'function':
|
|
2247
|
-
return false;
|
|
2248
|
-
case 'object':
|
|
2249
|
-
return value === null;
|
|
2250
|
-
default:
|
|
2251
|
-
return true;
|
|
2252
|
-
}
|
|
2253
|
-
}
|
|
2254
|
-
exports.isPrimitive = isPrimitive;
|
|
2255
|
-
|
|
2256
|
-
/***/ },
|
|
2257
|
-
|
|
2258
2073
|
/***/ 1904
|
|
2259
2074
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
2260
2075
|
|
|
@@ -2574,7 +2389,7 @@ exports.block = void 0;
|
|
|
2574
2389
|
const parser_1 = __webpack_require__(605);
|
|
2575
2390
|
const line_1 = __webpack_require__(8287);
|
|
2576
2391
|
function block(parser, separation = true, segment = 0) {
|
|
2577
|
-
return
|
|
2392
|
+
return input => {
|
|
2578
2393
|
const context = input;
|
|
2579
2394
|
const {
|
|
2580
2395
|
source,
|
|
@@ -2587,13 +2402,15 @@ function block(parser, separation = true, segment = 0) {
|
|
|
2587
2402
|
return new parser_1.List();
|
|
2588
2403
|
}
|
|
2589
2404
|
const result = parser(input);
|
|
2590
|
-
if (result === undefined)
|
|
2591
|
-
|
|
2405
|
+
if (result === undefined || separation && !(0, line_1.isEmptyline)(source, context.position)) {
|
|
2406
|
+
context.position = position;
|
|
2407
|
+
return;
|
|
2408
|
+
}
|
|
2592
2409
|
if (segment !== 0 && context.segment & 1 /* Segment.write */ ^ 1 /* Segment.write */) {
|
|
2593
2410
|
context.segment = segment;
|
|
2594
2411
|
}
|
|
2595
2412
|
return result;
|
|
2596
|
-
}
|
|
2413
|
+
};
|
|
2597
2414
|
}
|
|
2598
2415
|
exports.block = block;
|
|
2599
2416
|
|
|
@@ -2639,7 +2456,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2639
2456
|
exports.isEmptyline = exports.firstline = exports.line = void 0;
|
|
2640
2457
|
const parser_1 = __webpack_require__(605);
|
|
2641
2458
|
function line(parser) {
|
|
2642
|
-
return
|
|
2459
|
+
return context => {
|
|
2643
2460
|
const {
|
|
2644
2461
|
source,
|
|
2645
2462
|
position
|
|
@@ -2648,15 +2465,16 @@ function line(parser) {
|
|
|
2648
2465
|
const line = firstline(source, position);
|
|
2649
2466
|
context.offset += position;
|
|
2650
2467
|
const result = parser((0, parser_1.input)(line, context));
|
|
2651
|
-
context.position += position;
|
|
2652
|
-
context.position += result && context.position === position ? line.length : 0;
|
|
2653
2468
|
context.source = source;
|
|
2469
|
+
context.position = result ? context.position === 0 ? position + line.length : position + context.position : position;
|
|
2654
2470
|
context.offset -= position;
|
|
2655
|
-
if (result === undefined)
|
|
2656
|
-
|
|
2471
|
+
if (result === undefined || context.position < position + line.length && !isEmptyline(source, context.position)) {
|
|
2472
|
+
context.position = position;
|
|
2473
|
+
return;
|
|
2474
|
+
}
|
|
2657
2475
|
context.position = position + line.length;
|
|
2658
2476
|
return result;
|
|
2659
|
-
}
|
|
2477
|
+
};
|
|
2660
2478
|
}
|
|
2661
2479
|
exports.line = line;
|
|
2662
2480
|
function firstline(source, position) {
|
|
@@ -2702,28 +2520,24 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2702
2520
|
}));
|
|
2703
2521
|
exports.convert = void 0;
|
|
2704
2522
|
const parser_1 = __webpack_require__(605);
|
|
2705
|
-
function convert(conv, parser
|
|
2706
|
-
return
|
|
2523
|
+
function convert(conv, parser) {
|
|
2524
|
+
return input => {
|
|
2707
2525
|
const context = input;
|
|
2708
2526
|
const {
|
|
2709
2527
|
source,
|
|
2710
|
-
position
|
|
2528
|
+
position,
|
|
2529
|
+
offset
|
|
2711
2530
|
} = context;
|
|
2712
2531
|
if (position === source.length) return;
|
|
2713
2532
|
const src = conv(source.slice(position), context);
|
|
2714
2533
|
if (src === '') {
|
|
2715
|
-
if (!empty) return;
|
|
2716
2534
|
context.position = source.length;
|
|
2717
2535
|
return new parser_1.List();
|
|
2718
2536
|
}
|
|
2719
|
-
const {
|
|
2720
|
-
offset,
|
|
2721
|
-
backtracks
|
|
2722
|
-
} = context;
|
|
2723
2537
|
const result = parser((0, parser_1.subinput)(src, context));
|
|
2724
|
-
context.position = context.source.length;
|
|
2538
|
+
context.position = result ? context.source.length : position;
|
|
2725
2539
|
return result;
|
|
2726
|
-
}
|
|
2540
|
+
};
|
|
2727
2541
|
}
|
|
2728
2542
|
exports.convert = convert;
|
|
2729
2543
|
|
|
@@ -2900,11 +2714,10 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2900
2714
|
value: true
|
|
2901
2715
|
}));
|
|
2902
2716
|
exports.match = void 0;
|
|
2903
|
-
const parser_1 = __webpack_require__(605);
|
|
2904
2717
|
const combinator_1 = __webpack_require__(3484);
|
|
2905
2718
|
function match(pattern, f) {
|
|
2906
2719
|
const count = typeof pattern === 'object' ? /[^^\\*+][*+]|{\d+,}/.test(pattern.source) : false;
|
|
2907
|
-
return
|
|
2720
|
+
return input => {
|
|
2908
2721
|
const context = input;
|
|
2909
2722
|
const {
|
|
2910
2723
|
source,
|
|
@@ -2916,9 +2729,9 @@ function match(pattern, f) {
|
|
|
2916
2729
|
if (!params) return;
|
|
2917
2730
|
count && (0, combinator_1.consume)(params[0].length, context);
|
|
2918
2731
|
const result = f(params)(input);
|
|
2919
|
-
context.position += result
|
|
2732
|
+
context.position += result ? context.position === position ? params[0].length : 0 : context.position - position;
|
|
2920
2733
|
return result;
|
|
2921
|
-
}
|
|
2734
|
+
};
|
|
2922
2735
|
}
|
|
2923
2736
|
exports.match = match;
|
|
2924
2737
|
|
|
@@ -2989,6 +2802,7 @@ function focus(scope, parser, slice = true) {
|
|
|
2989
2802
|
const match = (0, delimiter_1.matcher)(scope, false);
|
|
2990
2803
|
return (0, parser_1.failsafe)(context => {
|
|
2991
2804
|
const {
|
|
2805
|
+
SID,
|
|
2992
2806
|
source,
|
|
2993
2807
|
position
|
|
2994
2808
|
} = context;
|
|
@@ -3003,9 +2817,10 @@ function focus(scope, parser, slice = true) {
|
|
|
3003
2817
|
}
|
|
3004
2818
|
context.offset += position;
|
|
3005
2819
|
const result = parser((0, parser_1.input)(src, context));
|
|
2820
|
+
context.source = source;
|
|
2821
|
+
context.SID = SID;
|
|
3006
2822
|
context.position += position;
|
|
3007
2823
|
context.position += result && context.position === position ? src.length : 0;
|
|
3008
|
-
context.source = source;
|
|
3009
2824
|
context.offset -= position;
|
|
3010
2825
|
return result;
|
|
3011
2826
|
});
|
|
@@ -3014,6 +2829,7 @@ exports.focus = focus;
|
|
|
3014
2829
|
function rewrite(scope, parser, slice = true) {
|
|
3015
2830
|
return (0, parser_1.failsafe)(context => {
|
|
3016
2831
|
const {
|
|
2832
|
+
SID,
|
|
3017
2833
|
source,
|
|
3018
2834
|
position
|
|
3019
2835
|
} = context;
|
|
@@ -3030,9 +2846,10 @@ function rewrite(scope, parser, slice = true) {
|
|
|
3030
2846
|
const src = source.slice(position, context.position);
|
|
3031
2847
|
context.offset += position;
|
|
3032
2848
|
const res2 = parser((0, parser_1.input)(src, context));
|
|
2849
|
+
context.SID = SID;
|
|
2850
|
+
context.source = source;
|
|
3033
2851
|
context.position += position;
|
|
3034
2852
|
context.position += res2 && context.position === position ? src.length : 0;
|
|
3035
|
-
context.source = source;
|
|
3036
2853
|
context.offset -= position;
|
|
3037
2854
|
return res2;
|
|
3038
2855
|
});
|
|
@@ -3171,7 +2988,7 @@ function revert(context, linebreak) {
|
|
|
3171
2988
|
/***/ },
|
|
3172
2989
|
|
|
3173
2990
|
/***/ 994
|
|
3174
|
-
(__unused_webpack_module, exports
|
|
2991
|
+
(__unused_webpack_module, exports) {
|
|
3175
2992
|
|
|
3176
2993
|
"use strict";
|
|
3177
2994
|
|
|
@@ -3180,20 +2997,27 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
3180
2997
|
value: true
|
|
3181
2998
|
}));
|
|
3182
2999
|
exports.bind = void 0;
|
|
3183
|
-
const parser_1 = __webpack_require__(605);
|
|
3184
3000
|
function bind(parser, f) {
|
|
3185
|
-
return
|
|
3001
|
+
return input => {
|
|
3186
3002
|
const context = input;
|
|
3187
3003
|
const {
|
|
3188
3004
|
source,
|
|
3189
3005
|
position
|
|
3190
3006
|
} = context;
|
|
3191
3007
|
if (position === source.length) return;
|
|
3192
|
-
const
|
|
3193
|
-
if (
|
|
3008
|
+
const res1 = parser(input);
|
|
3009
|
+
if (res1 === undefined) {
|
|
3010
|
+
context.position = position;
|
|
3011
|
+
return;
|
|
3012
|
+
}
|
|
3194
3013
|
context.range = context.position - position;
|
|
3195
|
-
|
|
3196
|
-
|
|
3014
|
+
const res2 = f(res1, context);
|
|
3015
|
+
if (res2 === undefined) {
|
|
3016
|
+
context.position = position;
|
|
3017
|
+
return;
|
|
3018
|
+
}
|
|
3019
|
+
return res2;
|
|
3020
|
+
};
|
|
3197
3021
|
}
|
|
3198
3022
|
exports.bind = bind;
|
|
3199
3023
|
|
|
@@ -3682,6 +3506,10 @@ class Context {
|
|
|
3682
3506
|
this.offset = offset ?? 0;
|
|
3683
3507
|
this.backtracks = backtracks ?? {};
|
|
3684
3508
|
}
|
|
3509
|
+
clone() {
|
|
3510
|
+
// @ts-ignore
|
|
3511
|
+
return new this.constructor(this);
|
|
3512
|
+
}
|
|
3685
3513
|
}
|
|
3686
3514
|
exports.Context = Context;
|
|
3687
3515
|
function input(source, context) {
|
|
@@ -3692,14 +3520,12 @@ function input(source, context) {
|
|
|
3692
3520
|
}
|
|
3693
3521
|
exports.input = input;
|
|
3694
3522
|
function subinput(source, context) {
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
backtracks: {}
|
|
3702
|
-
};
|
|
3523
|
+
const c = context.clone();
|
|
3524
|
+
c.source = source;
|
|
3525
|
+
c.position = 0;
|
|
3526
|
+
c.offset = 0;
|
|
3527
|
+
c.backtracks = {};
|
|
3528
|
+
return c;
|
|
3703
3529
|
}
|
|
3704
3530
|
exports.subinput = subinput;
|
|
3705
3531
|
function failsafe(parser) {
|
|
@@ -3721,69 +3547,8 @@ exports.failsafe = failsafe;
|
|
|
3721
3547
|
Object.defineProperty(exports, "__esModule", ({
|
|
3722
3548
|
value: true
|
|
3723
3549
|
}));
|
|
3724
|
-
exports.constraint = exports.state = exports.precedence = exports.recursions = exports.recursion = exports.consume = exports.creation =
|
|
3550
|
+
exports.constraint = exports.state = exports.precedence = exports.recursions = exports.recursion = exports.consume = exports.creation = void 0;
|
|
3725
3551
|
const alias_1 = __webpack_require__(5413);
|
|
3726
|
-
const assign_1 = __webpack_require__(9888);
|
|
3727
|
-
function reset(base, parser) {
|
|
3728
|
-
const clock = base.resources?.clock;
|
|
3729
|
-
const recursions = base.resources?.recursions;
|
|
3730
|
-
return input => {
|
|
3731
|
-
const context = input;
|
|
3732
|
-
// @ts-expect-error
|
|
3733
|
-
context.resources ??= {
|
|
3734
|
-
clock,
|
|
3735
|
-
recursions: recursions?.slice()
|
|
3736
|
-
};
|
|
3737
|
-
context.backtracks = {};
|
|
3738
|
-
return parser(input);
|
|
3739
|
-
};
|
|
3740
|
-
// removed by dead control flow
|
|
3741
|
-
|
|
3742
|
-
// removed by dead control flow
|
|
3743
|
-
|
|
3744
|
-
// removed by dead control flow
|
|
3745
|
-
|
|
3746
|
-
}
|
|
3747
|
-
exports.reset = reset;
|
|
3748
|
-
function context(base, parser) {
|
|
3749
|
-
const changes = Object.entries(base);
|
|
3750
|
-
const values = Array(changes.length);
|
|
3751
|
-
return context => apply(parser, context, changes, values);
|
|
3752
|
-
}
|
|
3753
|
-
exports.context = context;
|
|
3754
|
-
function apply(parser, context, changes, values, reset = false) {
|
|
3755
|
-
for (let i = 0; i < changes.length; ++i) {
|
|
3756
|
-
const change = changes[i];
|
|
3757
|
-
const prop = change[0];
|
|
3758
|
-
switch (prop) {
|
|
3759
|
-
case 'source':
|
|
3760
|
-
case 'position':
|
|
3761
|
-
continue;
|
|
3762
|
-
case 'resources':
|
|
3763
|
-
values[i] = context[prop];
|
|
3764
|
-
context[prop] ??= (0, assign_1.clone)({}, change[1]);
|
|
3765
|
-
continue;
|
|
3766
|
-
case 'backtracks':
|
|
3767
|
-
change[1] = {};
|
|
3768
|
-
}
|
|
3769
|
-
values[i] = context[prop];
|
|
3770
|
-
context[prop] = change[1];
|
|
3771
|
-
}
|
|
3772
|
-
const result = parser(context);
|
|
3773
|
-
for (let i = 0; i < changes.length; ++i) {
|
|
3774
|
-
const change = changes[i];
|
|
3775
|
-
const prop = change[0];
|
|
3776
|
-
switch (prop) {
|
|
3777
|
-
case 'source':
|
|
3778
|
-
case 'position':
|
|
3779
|
-
continue;
|
|
3780
|
-
case 'resources':
|
|
3781
|
-
}
|
|
3782
|
-
context[prop] = values[i];
|
|
3783
|
-
values[i] = undefined;
|
|
3784
|
-
}
|
|
3785
|
-
return result;
|
|
3786
|
-
}
|
|
3787
3552
|
function creation(cost, parser) {
|
|
3788
3553
|
return input => {
|
|
3789
3554
|
const context = input;
|
|
@@ -4459,7 +4224,7 @@ function parse(source) {
|
|
|
4459
4224
|
Object.defineProperty(exports, "__esModule", ({
|
|
4460
4225
|
value: true
|
|
4461
4226
|
}));
|
|
4462
|
-
exports.escape = exports.invisibleGraphHTMLEntityNames = exports.invisibleBlankHTMLEntityNames = exports.normalize = void 0;
|
|
4227
|
+
exports.escape = exports.invisibleGraphHTMLEntityNames = exports.invisibleBlankCharacters = exports.invisibleBlankHTMLEntityNames = exports.normalize = void 0;
|
|
4463
4228
|
const dom_1 = __webpack_require__(394);
|
|
4464
4229
|
const UNICODE_REPLACEMENT_CHARACTER = '\uFFFD';
|
|
4465
4230
|
function normalize(source) {
|
|
@@ -4486,6 +4251,7 @@ const parser = (el => entity => {
|
|
|
4486
4251
|
return el.textContent;
|
|
4487
4252
|
})((0, dom_1.html)('span'));
|
|
4488
4253
|
exports.invisibleBlankHTMLEntityNames = invisibleHTMLEntityNames.filter(name => parser(`&${name};`).trimStart() === '');
|
|
4254
|
+
exports.invisibleBlankCharacters = exports.invisibleBlankHTMLEntityNames.map(name => parser(`&${name};`));
|
|
4489
4255
|
exports.invisibleGraphHTMLEntityNames = invisibleHTMLEntityNames.filter(name => parser(`&${name};`).trimStart() !== '');
|
|
4490
4256
|
const unreadableEscapeHTMLEntityNames = invisibleHTMLEntityNames.filter(name => !['Tab', 'NewLine', 'NonBreakingSpace', 'nbsp', 'zwj', 'zwnj'].includes(name));
|
|
4491
4257
|
const unreadableEscapeCharacters = unreadableEscapeHTMLEntityNames.map(name => parser(`&${name};`));
|
|
@@ -4732,11 +4498,11 @@ const parse_1 = __webpack_require__(3662);
|
|
|
4732
4498
|
const dom_1 = __webpack_require__(394);
|
|
4733
4499
|
exports.segment = (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(/!?>+ /y, (0, combinator_1.some)(source_1.contentline))]));
|
|
4734
4500
|
exports.blockquote = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.union)([(0, combinator_1.open)(/(?=>)/y, source), (0, combinator_1.open)(/!(?=>)/y, markdown)]))));
|
|
4735
|
-
const opener = /(?=>>+(?:$|[ \n]))/y;
|
|
4736
|
-
const indent = (0, combinator_1.open)(opener, (0, combinator_1.some)(source_1.contentline, />(?:$|[ \n])/y));
|
|
4737
|
-
const unindent = source => source.replace(/(?<=^|\n)>(?: |(?=>*(?:$|[ \n])))|\n$/g, '');
|
|
4738
|
-
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.recursion)(1 /* Recursion.blockquote */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, source
|
|
4739
|
-
const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.recursion)(1 /* Recursion.blockquote */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, markdown
|
|
4501
|
+
const opener = /(?=>>+(?:$|[ \r\n]))/y;
|
|
4502
|
+
const indent = (0, combinator_1.open)(opener, (0, combinator_1.some)(source_1.contentline, />(?:$|[ \r\n])/y));
|
|
4503
|
+
const unindent = source => source.replace(/(?<=^|\n)>(?: |(?=>*(?:$|[ \r\n])))|\r?\n$/g, '');
|
|
4504
|
+
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.recursion)(1 /* Recursion.blockquote */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, source)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)(autolink_1.autolink, ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('pre', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))]))))]))), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('blockquote', (0, util_1.unwrap)(ns)))])));
|
|
4505
|
+
const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.recursion)(1 /* Recursion.blockquote */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, markdown)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, context => {
|
|
4740
4506
|
(0, combinator_1.consume)(10, context);
|
|
4741
4507
|
const {
|
|
4742
4508
|
source
|
|
@@ -4753,7 +4519,7 @@ const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combina
|
|
|
4753
4519
|
}, context);
|
|
4754
4520
|
context.position = source.length;
|
|
4755
4521
|
return new parser_1.List([new parser_1.Node((0, dom_1.html)('section', [document, (0, dom_1.html)('h2', 'References'), references]))]);
|
|
4756
|
-
}
|
|
4522
|
+
}))]))), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('blockquote', (0, util_1.unwrap)(ns)))])));
|
|
4757
4523
|
|
|
4758
4524
|
/***/ },
|
|
4759
4525
|
|
|
@@ -4887,7 +4653,7 @@ const indexee_1 = __webpack_require__(7610);
|
|
|
4887
4653
|
const util_1 = __webpack_require__(4992);
|
|
4888
4654
|
const parse_1 = __webpack_require__(3662);
|
|
4889
4655
|
const dom_1 = __webpack_require__(394);
|
|
4890
|
-
exports.aside = (0, combinator_1.block)((0, combinator_1.recursion)(0 /* Recursion.block */, (0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})aside(?!\S)([^\n]*)(?:$|\n)/y, 300),
|
|
4656
|
+
exports.aside = (0, combinator_1.block)((0, combinator_1.recursion)(0 /* Recursion.block */, (0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})aside(?!\S)([^\r\n]*)(?:$|\r?\n)/y, 300),
|
|
4891
4657
|
// Bug: Type mismatch between outer and inner.
|
|
4892
4658
|
(nodes, context) => {
|
|
4893
4659
|
const [body, overflow, closer, opener, delim, param] = (0, util_1.unwrap)(nodes);
|
|
@@ -4936,7 +4702,7 @@ const mathblock_1 = __webpack_require__(4903);
|
|
|
4936
4702
|
const util_1 = __webpack_require__(4992);
|
|
4937
4703
|
const parse_1 = __webpack_require__(3662);
|
|
4938
4704
|
const dom_1 = __webpack_require__(394);
|
|
4939
|
-
exports.example = (0, combinator_1.block)((0, combinator_1.recursion)(0 /* Recursion.block */, (0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})(?:example\/(\S+))?(?!\S)([^\n]*)(?:$|\n)/y, 300),
|
|
4705
|
+
exports.example = (0, combinator_1.block)((0, combinator_1.recursion)(0 /* Recursion.block */, (0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})(?:example\/(\S+))?(?!\S)([^\r\n]*)(?:$|\r?\n)/y, 300),
|
|
4940
4706
|
// Bug: Type mismatch between outer and inner.
|
|
4941
4707
|
(nodes, context) => {
|
|
4942
4708
|
const [body, overflow, closer, opener, delim, type = 'markdown', param] = (0, util_1.unwrap)(nodes);
|
|
@@ -5003,21 +4769,21 @@ const table_1 = __webpack_require__(3646);
|
|
|
5003
4769
|
const blockquote_1 = __webpack_require__(5885);
|
|
5004
4770
|
const placeholder_1 = __webpack_require__(4091);
|
|
5005
4771
|
const inline_1 = __webpack_require__(7973);
|
|
5006
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /(?!\S)
|
|
4772
|
+
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)), (0, combinator_1.union)([codeblock_1.segment, mathblock_1.segment, table_1.segment, blockquote_1.segment, placeholder_1.segment, (0, combinator_1.some)(source_1.contentline)])]), true, 8 /* Segment.fig */);
|
|
5007
4773
|
exports.fig = (0, combinator_1.block)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.verify)((0, combinator_1.convert)((source, context) => {
|
|
5008
4774
|
// Bug: TypeScript
|
|
5009
|
-
const fence = (/^[^\n]*\n!?>+ /.test(source) && source.match(/^~{3,}(?=[^\S\n]*$)/gm) || []).reduce((max, fence) => fence > max ? fence : max, '~~') + '~';
|
|
4775
|
+
const fence = (/^[^\r\n]*\r?\n!?>+ /.test(source) && source.match(/^~{3,}(?=[^\S\r\n]*$)/gm) || []).reduce((max, fence) => fence > max ? fence : max, '~~') + '~';
|
|
5010
4776
|
const {
|
|
5011
4777
|
position
|
|
5012
4778
|
} = context;
|
|
5013
4779
|
const result = parser(context);
|
|
5014
4780
|
context.position = position;
|
|
5015
4781
|
context.segment = 10 /* Segment.figure */ | 1 /* Segment.write */;
|
|
5016
|
-
return result ? `${fence}figure ${source.replace(/^(
|
|
4782
|
+
return result ? `${fence}figure ${source.replace(/^([^\r\n]+\r?\n[^\r\n]+\r?\n)(.+?)\r?\n?$/s, '$1\n$2')}\n${fence}` : `${fence}figure ${source}\n\n${fence}`;
|
|
5017
4783
|
}, (0, combinator_1.union)([figure_1.figure])), ([{
|
|
5018
4784
|
value: el
|
|
5019
4785
|
}]) => el.tagName === 'FIGURE')));
|
|
5020
|
-
const parser = (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /(?!\S)
|
|
4786
|
+
const parser = (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.close)(label_1.segment, /(?!\S)[^\r\n]*\r?\n/y)), (0, combinator_1.line)((0, combinator_1.union)([inline_1.media, inline_1.lineshortmedia])), (0, combinator_1.some)(source_1.contentline)]);
|
|
5021
4787
|
|
|
5022
4788
|
/***/ },
|
|
5023
4789
|
|
|
@@ -5035,7 +4801,7 @@ const parser_1 = __webpack_require__(605);
|
|
|
5035
4801
|
const combinator_1 = __webpack_require__(3484);
|
|
5036
4802
|
const label_1 = __webpack_require__(2178);
|
|
5037
4803
|
const dom_1 = __webpack_require__(394);
|
|
5038
|
-
exports.figbase = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/\[?\$-(?:[0-9]+\.)*0\]?[^\S\n]*(?:$|\n)/y, (0, combinator_1.line)((0, combinator_1.union)([label_1.label]))), ([{
|
|
4804
|
+
exports.figbase = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/\[?\$-(?:[0-9]+\.)*0\]?[^\S\r\n]*(?:$|\r?\n)/y, (0, combinator_1.line)((0, combinator_1.union)([label_1.label]))), ([{
|
|
5039
4805
|
value: el
|
|
5040
4806
|
}]) => {
|
|
5041
4807
|
const label = el.getAttribute('data-label');
|
|
@@ -5080,16 +4846,16 @@ const dom_1 = __webpack_require__(394);
|
|
|
5080
4846
|
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)([
|
|
5081
4847
|
// All parsers which can include closing terms.
|
|
5082
4848
|
(0, combinator_1.union)([codeblock_1.segment_, mathblock_1.segment_, table_2.segment_, blockquote_1.segment, placeholder_1.segment_, (0, combinator_1.some)(source_1.contentline, closer)]), source_1.emptyline, (0, combinator_1.union)([source_1.emptyline, (0, combinator_1.some)(source_1.contentline, closer)])])]), closer), ([, fence]) => fence.length - 1, [], 2 ** 4 - 1)), true, 10 /* Segment.figure */);
|
|
5083
|
-
exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:\w+\s+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.sequence)([label_1.label, (0, source_1.str)(/(?!\S)
|
|
4849
|
+
exports.figure = (0, combinator_1.block)((0, combinator_1.fallback)((0, combinator_1.rewrite)(exports.segment, (0, combinator_1.fmap)((0, combinator_1.convert)(source => source.slice(source.match(/^~+(?:\w+\s+)?/)[0].length, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.sequence)([(0, combinator_1.line)((0, combinator_1.sequence)([label_1.label, (0, source_1.str)(/(?!\S)[^\r\n]*\r?\n/y)])), (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([ulist_1.ulist, olist_1.olist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, example_1.example, table_2.table, blockquote_1.blockquote, placeholder_1.placeholder, (0, combinator_1.line)(inline_1.media), (0, combinator_1.line)(inline_1.lineshortmedia)])), source_1.emptyline, (0, combinator_1.block)((0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))))])])), nodes => {
|
|
5084
4850
|
const [label, param, content, ...caption] = (0, util_1.unwrap)(nodes);
|
|
5085
4851
|
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', {
|
|
5086
4852
|
class: 'figindex'
|
|
5087
4853
|
}), (0, dom_1.html)('span', {
|
|
5088
4854
|
class: 'figtext'
|
|
5089
4855
|
}, (0, dom_1.defrag)(caption))]), (0, dom_1.html)('div', [content])]))]);
|
|
5090
|
-
})), (0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})(?:figure(?=$|[ \n])|\[?\$)[^\n]*(?:$|\n)/y, 300), (nodes, context) => {
|
|
4856
|
+
})), (0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})(?:figure(?=$|[ \r\n])|\[?\$)[^\r\n]*(?:$|\r?\n)/y, 300), (nodes, context) => {
|
|
5091
4857
|
const [body, overflow, closer, opener, delim] = (0, util_1.unwrap)(nodes);
|
|
5092
|
-
const violation = !closer && ['fence', `Missing the closing delimiter "${delim}"`] || overflow && ['fence', `Invalid trailing line after the closing delimiter "${delim}"`] || !(0, label_1.segment)((0, parser_1.subinput)(opener.match(/^~+(?:figure )?(\[?\$\S+)/)?.[1] ?? '', context)) && ['label', 'Invalid label'] || /^~+(?:figure )?(\[?\$\S+)[^\S\n]+\S/.test(opener) && ['argument', 'Invalid argument'] || ['content', 'Invalid content'];
|
|
4858
|
+
const violation = !closer && ['fence', `Missing the closing delimiter "${delim}"`] || overflow && ['fence', `Invalid trailing line after the closing delimiter "${delim}"`] || !(0, label_1.segment)((0, parser_1.subinput)(opener.match(/^~+(?:figure )?(\[?\$\S+)/)?.[1] ?? '', context)) && ['label', 'Invalid label'] || /^~+(?:figure )?(\[?\$\S+)[^\S\r\n]+\S/.test(opener) && ['argument', 'Invalid argument'] || ['content', 'Invalid content'];
|
|
5093
4859
|
return new parser_1.List([new parser_1.Node((0, dom_1.html)('pre', {
|
|
5094
4860
|
class: 'invalid',
|
|
5095
4861
|
translate: 'no',
|
|
@@ -5163,7 +4929,7 @@ const paragraph_1 = __webpack_require__(4330);
|
|
|
5163
4929
|
const util_1 = __webpack_require__(4992);
|
|
5164
4930
|
const array_1 = __webpack_require__(6876);
|
|
5165
4931
|
const dom_1 = __webpack_require__(394);
|
|
5166
|
-
exports.message = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})message\/(\S+)(?!\S)([^\n]*)(?:$|\n)/y, 300),
|
|
4932
|
+
exports.message = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.fence)(/(~{3,})message\/(\S+)(?!\S)([^\r\n]*)(?:$|\r?\n)/y, 300),
|
|
5167
4933
|
// Bug: Type mismatch between outer and inner.
|
|
5168
4934
|
(nodes, context) => {
|
|
5169
4935
|
const [body, overflow, closer, opener, delim, type, param] = (0, util_1.unwrap)(nodes);
|
|
@@ -5281,13 +5047,13 @@ exports.table = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.
|
|
|
5281
5047
|
}));
|
|
5282
5048
|
const parser = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([row])), rows => new parser_1.List([new parser_1.Node((0, dom_1.html)('table', format([...(0, util_1.unwrap)(rows)])))]))));
|
|
5283
5049
|
const row = (0, combinator_1.lazy)(() => (0, combinator_1.dup)((0, combinator_1.fmap)((0, combinator_1.subsequence)([(0, combinator_1.union)([align]), (0, combinator_1.some)((0, combinator_1.union)([head, data, (0, combinator_1.some)(dataline, alignment), source_1.emptyline]))]), ns => Array.isArray(ns.head?.value) ? ns : ns.unshift(new parser_1.Node([[]])) && ns)));
|
|
5284
|
-
const alignment = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)/y;
|
|
5050
|
+
const alignment = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\r\n]*\r?\n)/y;
|
|
5285
5051
|
const align = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.union)([(0, source_1.str)(alignment)]), ([{
|
|
5286
5052
|
value
|
|
5287
5053
|
}]) => new parser_1.List([new parser_1.Node(value.split('/').map(s => s.split('')))])));
|
|
5288
|
-
const delimiter = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|[#:](?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=[ \n])/y;
|
|
5289
|
-
const head = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=[ \n])/y), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/\s/y, (0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia]), /[^\S\n]*(?:$|\n)/y)), (0, combinator_1.open)(/(?:[^\S\n]*\n|\s)/y, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('th', attributes(ns.shift().value), (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false);
|
|
5290
|
-
const data = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=[ \n])/y), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/\s/y, (0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia]), /[^\S\n]*(?:$|\n)/y)), (0, combinator_1.open)(/(?:[^\S\n]*\n|\s)/y, (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('td', attributes(ns.shift().value), (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false);
|
|
5054
|
+
const delimiter = /[-=<>]+(?:\/[-=^v]*)?(?=[^\S\r\n]*\r?\n)|[#:](?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=[ \r\n])/y;
|
|
5055
|
+
const head = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/#(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=[ \r\n])/y), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/\s/y, (0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia]), /[^\S\r\n]*(?:$|\r?\n)/y)), (0, combinator_1.open)(/(?:[^\S\r\n]*\r?\n|\s)/y, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('th', attributes(ns.shift().value), (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false);
|
|
5056
|
+
const data = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/:(?:(?!:\D|0)\d*:(?!0)\d*)?(?:!+[+]?)?(?=[ \r\n])/y), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.union)([(0, combinator_1.block)((0, combinator_1.surround)(/\s/y, (0, combinator_1.union)([inline_1.medialink, inline_1.media, inline_1.lineshortmedia]), /[^\S\r\n]*(?:$|\r?\n)/y)), (0, combinator_1.open)(/(?:[^\S\r\n]*\r?\n|\s)/y, (0, visibility_1.visualize)((0, visibility_1.trimBlankEnd)((0, combinator_1.some)(inline_1.inline))), true)])), true), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('td', attributes(ns.shift().value), (0, dom_1.defrag)((0, util_1.unwrap)(ns))))])), false);
|
|
5291
5057
|
const dataline = (0, combinator_1.line)((0, combinator_1.rewrite)(source_1.contentline, (0, combinator_1.union)([(0, combinator_1.validate)(/!+ /y, (0, combinator_1.convert)(source => `:${source}`, data)), (0, combinator_1.convert)(source => `: ${source}`, data)])));
|
|
5292
5058
|
function attributes(source) {
|
|
5293
5059
|
let [, rowspan = undefined, colspan = undefined, highlight = undefined, extension = undefined] = source.match(/^[#:](?:(\d+)?:(\d+)?)?(?:(!+)([+]?))?$/) ?? [];
|
|
@@ -5508,7 +5274,7 @@ const source_1 = __webpack_require__(8745);
|
|
|
5508
5274
|
const visibility_1 = __webpack_require__(6364);
|
|
5509
5275
|
const util_1 = __webpack_require__(4992);
|
|
5510
5276
|
const dom_1 = __webpack_require__(394);
|
|
5511
|
-
exports.segment = (0, combinator_1.block)((0, combinator_1.focus)(/#+ +\S[^\r\n]*(?:\r?\n#+(?=$|
|
|
5277
|
+
exports.segment = (0, combinator_1.block)((0, combinator_1.focus)(/#+ +\S[^\r\n]*(?:\r?\n#+(?=$|[ \r\n])[^\r\n]*)*(?:$|\r?\n)/y, input => {
|
|
5512
5278
|
const context = input;
|
|
5513
5279
|
const {
|
|
5514
5280
|
source,
|
|
@@ -5556,7 +5322,7 @@ const visibility_1 = __webpack_require__(6364);
|
|
|
5556
5322
|
const util_1 = __webpack_require__(4992);
|
|
5557
5323
|
const dom_1 = __webpack_require__(394);
|
|
5558
5324
|
exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/[-+*] /y, exports.ilist_)));
|
|
5559
|
-
exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/[-+*](?:$|[ \n])/y, (0, combinator_1.recursion)(2 /* Recursion.listitem */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/[-+*](?:$|[ \n])/y, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), exports.ilistitem), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('li', (0, dom_1.defrag)((0, util_1.unwrap)((0, ulist_1.fillFirstLine)(ns)))))]))])))), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('ul', {
|
|
5325
|
+
exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/[-+*](?:$|[ \r\n])/y, (0, combinator_1.recursion)(2 /* Recursion.listitem */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/[-+*](?:$|[ \r\n])/y, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)(inline_1.inline))), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), exports.ilistitem), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('li', (0, dom_1.defrag)((0, util_1.unwrap)((0, ulist_1.fillFirstLine)(ns)))))]))])))), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('ul', {
|
|
5560
5326
|
class: 'invalid',
|
|
5561
5327
|
...(0, util_1.invalid)('list', 'syntax', 'Use "-" instead of "+" or "*"')
|
|
5562
5328
|
}, (0, util_1.unwrap)(ns)))]))));
|
|
@@ -5567,7 +5333,7 @@ exports.ilistitem = (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.
|
|
|
5567
5333
|
}) => new parser_1.List([new parser_1.Node(''), new parser_1.Node((0, dom_1.html)('span', {
|
|
5568
5334
|
class: 'invalid',
|
|
5569
5335
|
...(0, util_1.invalid)('list', 'syntax', 'Fix the indent or the head of the list item')
|
|
5570
|
-
}, source.replace(
|
|
5336
|
+
}, source.replace(/\r?\n/, '')))]));
|
|
5571
5337
|
|
|
5572
5338
|
/***/ },
|
|
5573
5339
|
|
|
@@ -5628,7 +5394,7 @@ exports.mediablock = (0, combinator_1.block)((0, combinator_1.fmap)((0, combinat
|
|
|
5628
5394
|
}) => new parser_1.List([new parser_1.Node((0, dom_1.html)('span', {
|
|
5629
5395
|
class: 'invalid',
|
|
5630
5396
|
...(0, util_1.invalid)('mediablock', 'syntax', 'Not media syntax')
|
|
5631
|
-
}, source.replace(
|
|
5397
|
+
}, source.replace(/\r?\n/, '')))]))))]), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('div', (0, util_1.unwrap)(ns)))])));
|
|
5632
5398
|
|
|
5633
5399
|
/***/ },
|
|
5634
5400
|
|
|
@@ -5652,8 +5418,8 @@ const visibility_1 = __webpack_require__(6364);
|
|
|
5652
5418
|
const memoize_1 = __webpack_require__(6925);
|
|
5653
5419
|
const dom_1 = __webpack_require__(394);
|
|
5654
5420
|
const openers = {
|
|
5655
|
-
'.': /([0-9]+|[a-z]+|[A-Z]+)(?:-(?=$|[0-9\n])[0-9]*)*(?:\.?(?:$|[\n])|\. )/y,
|
|
5656
|
-
'(': /\((?=$|[0-9a-z\n])([0-9]*|[a-z]*)(?=$|[)\n])\)?(?:-(?=$|[0-9\n])[0-9]*)*(?:$|[ \n])/y
|
|
5421
|
+
'.': /([0-9]+|[a-z]+|[A-Z]+)(?:-(?=$|[0-9\r\n])[0-9]*)*(?:\.?(?:$|[\r\n])|\. )/y,
|
|
5422
|
+
'(': /\((?=$|[0-9a-z\r\n])([0-9]*|[a-z]*)(?=$|[)\r\n])\)?(?:-(?=$|[0-9\r\n])[0-9]*)*(?:$|[ \r\n])/y
|
|
5657
5423
|
};
|
|
5658
5424
|
exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(new RegExp([/(?:[0-9]+)(?:-[0-9]+)*\. /y.source, /\((?:[0-9]+)\)(?:-[0-9]+)* /y.source].join('|'), 'y'), exports.olist_)));
|
|
5659
5425
|
exports.olist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.match)(openers['.'], (0, memoize_1.memoize)(ms => list(type(ms[1]), '.'), ms => idx(ms[1]), [])), (0, combinator_1.match)(openers['('], (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => idx(ms[1]), []))])));
|
|
@@ -5772,7 +5538,7 @@ exports.pagebreak = void 0;
|
|
|
5772
5538
|
const parser_1 = __webpack_require__(605);
|
|
5773
5539
|
const combinator_1 = __webpack_require__(3484);
|
|
5774
5540
|
const dom_1 = __webpack_require__(394);
|
|
5775
|
-
exports.pagebreak = (0, combinator_1.block)((0, combinator_1.line)((0, combinator_1.focus)(/={3,}[^\S\n]*(?:$|\n)/y, () => new parser_1.List([new parser_1.Node((0, dom_1.html)('hr'))]))));
|
|
5541
|
+
exports.pagebreak = (0, combinator_1.block)((0, combinator_1.line)((0, combinator_1.focus)(/={3,}[^\S\r\n]*(?:$|\r?\n)/y, () => new parser_1.List([new parser_1.Node((0, dom_1.html)('hr'))]))));
|
|
5776
5542
|
|
|
5777
5543
|
/***/ },
|
|
5778
5544
|
|
|
@@ -5839,7 +5605,7 @@ const anchor_1 = __webpack_require__(8535);
|
|
|
5839
5605
|
const source_1 = __webpack_require__(8745);
|
|
5840
5606
|
const util_1 = __webpack_require__(4992);
|
|
5841
5607
|
const dom_1 = __webpack_require__(394);
|
|
5842
|
-
exports.syntax = />*(?=>>[^>\s]\S*[^\S\n]*(?:$|\n))/y;
|
|
5608
|
+
exports.syntax = />*(?=>>[^>\s]\S*[^\S\r\n]*(?:$|\r?\n))/y;
|
|
5843
5609
|
exports.cite = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(exports.syntax), (0, combinator_1.union)([(0, combinator_1.line)(anchor_1.anchor),
|
|
5844
5610
|
// Subject page representation.
|
|
5845
5611
|
// リンクの実装は後で検討
|
|
@@ -5915,16 +5681,16 @@ const autolink_1 = __webpack_require__(1671);
|
|
|
5915
5681
|
const source_1 = __webpack_require__(8745);
|
|
5916
5682
|
const util_1 = __webpack_require__(4992);
|
|
5917
5683
|
const dom_1 = __webpack_require__(394);
|
|
5918
|
-
exports.sidefence = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.focus)(/\|+ [^\n]*(?:\n\|+(?=$|[ \n])[^\n]*)*(?:$|\n)/y, (0, combinator_1.union)([source])), ([{
|
|
5684
|
+
exports.sidefence = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.focus)(/\|+ [^\r\n]*(?:\r?\n\|+(?=$|[ \r\n])[^\r\n]*)*(?:$|\r?\n)/y, (0, combinator_1.union)([source])), ([{
|
|
5919
5685
|
value
|
|
5920
5686
|
}]) => new parser_1.List([new parser_1.Node((0, dom_1.define)(value, {
|
|
5921
5687
|
class: 'invalid',
|
|
5922
5688
|
...(0, util_1.invalid)('sidefence', 'syntax', 'Reserved syntax')
|
|
5923
5689
|
}))]))));
|
|
5924
|
-
const opener = /(?=\|\|+(?:$|[ \n]))/y;
|
|
5925
|
-
const indent = (0, combinator_1.open)(opener, (0, combinator_1.some)(source_1.contentline, /\|(?:$|[ \n])/y));
|
|
5926
|
-
const unindent = source => source.replace(/(?<=^|\n)\|(?: |(?=\|*(?:$|[ \n])))|\n$/g, '');
|
|
5927
|
-
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.recursion)(0 /* Recursion.block */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, source
|
|
5690
|
+
const opener = /(?=\|\|+(?:$|[ \r\n]))/y;
|
|
5691
|
+
const indent = (0, combinator_1.open)(opener, (0, combinator_1.some)(source_1.contentline, /\|(?:$|[ \r\n])/y));
|
|
5692
|
+
const unindent = source => source.replace(/(?<=^|\n)\|(?: |(?=\|*(?:$|[ \r\n])))|\r?\n$/g, '');
|
|
5693
|
+
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.recursion)(0 /* Recursion.block */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, source)), (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (0, combinator_1.fmap)(autolink_1.autolink, ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('pre', (0, dom_1.defrag)((0, util_1.unwrap)(ns))))]))))]))), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('blockquote', (0, util_1.unwrap)(ns)))])));
|
|
5928
5694
|
|
|
5929
5695
|
/***/ },
|
|
5930
5696
|
|
|
@@ -5947,13 +5713,13 @@ const util_1 = __webpack_require__(4992);
|
|
|
5947
5713
|
const duff_1 = __webpack_require__(9202);
|
|
5948
5714
|
const array_1 = __webpack_require__(6876);
|
|
5949
5715
|
const dom_1 = __webpack_require__(394);
|
|
5950
|
-
exports.table = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/\|[^\n]*\n\|[-:][^\n]*\n\|/y, (0, combinator_1.sequence)([row((0, combinator_1.some)(head), true), row((0, combinator_1.some)(align), false), (0, combinator_1.some)(row((0, combinator_1.some)(data), true))])), rows => new parser_1.List([new parser_1.Node((0, dom_1.html)('table', [(0, dom_1.html)('thead', [rows.shift().value]), (0, dom_1.html)('tbody', (0, util_1.unwrap)(format(rows)))]))]))));
|
|
5716
|
+
exports.table = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/\|[^\r\n]*\r?\n\|[-:][^\r\n]*\r?\n\|/y, (0, combinator_1.sequence)([row((0, combinator_1.some)(head), true), row((0, combinator_1.some)(align), false), (0, combinator_1.some)(row((0, combinator_1.some)(data), true))])), rows => new parser_1.List([new parser_1.Node((0, dom_1.html)('table', [(0, dom_1.html)('thead', [rows.shift().value]), (0, dom_1.html)('tbody', (0, util_1.unwrap)(format(rows)))]))]))));
|
|
5951
5717
|
const row = (parser, optional) => (0, combinator_1.fallback)((0, combinator_1.fmap)((0, combinator_1.line)((0, combinator_1.surround)(/(?=\|)/y, (0, combinator_1.some)((0, combinator_1.union)([parser])), /\|?\s*$/y, optional)), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('tr', (0, util_1.unwrap)(ns)))])), (0, combinator_1.rewrite)(source_1.contentline, ({
|
|
5952
5718
|
source
|
|
5953
5719
|
}) => new parser_1.List([new parser_1.Node((0, dom_1.html)('tr', {
|
|
5954
5720
|
class: 'invalid',
|
|
5955
5721
|
...(0, util_1.invalid)('table-row', 'syntax', 'Missing the start symbol of the table row')
|
|
5956
|
-
}, [(0, dom_1.html)('td', source.replace(
|
|
5722
|
+
}, [(0, dom_1.html)('td', source.replace(/\r?\n/, ''))]))])));
|
|
5957
5723
|
const align = (0, combinator_1.fmap)((0, combinator_1.open)('|', (0, combinator_1.union)([(0, combinator_1.focus)(/:-+:?/y, ({
|
|
5958
5724
|
source,
|
|
5959
5725
|
position,
|
|
@@ -6003,10 +5769,10 @@ const visibility_1 = __webpack_require__(6364);
|
|
|
6003
5769
|
const util_1 = __webpack_require__(4992);
|
|
6004
5770
|
const dom_1 = __webpack_require__(394);
|
|
6005
5771
|
exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)('- ', exports.ulist_)));
|
|
6006
|
-
exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/-(?=$|[ \n])/y, (0, combinator_1.recursion)(2 /* Recursion.listitem */, (0, combinator_1.some)((0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/-(?:$|[ \n])/y, (0, combinator_1.subsequence)([exports.checkbox, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline]))))]), true)), (0, combinator_1.indent)((0, combinator_1.union)([exports.ulist_, olist_1.olist_, ilist_1.ilist_]))]), ilist_1.ilistitem), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('li', {
|
|
5772
|
+
exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/-(?=$|[ \r\n])/y, (0, combinator_1.recursion)(2 /* Recursion.listitem */, (0, combinator_1.some)((0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/-(?:$|[ \r\n])/y, (0, combinator_1.subsequence)([exports.checkbox, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline]))))]), true)), (0, combinator_1.indent)((0, combinator_1.union)([exports.ulist_, olist_1.olist_, ilist_1.ilist_]))]), ilist_1.ilistitem), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('li', {
|
|
6007
5773
|
'data-index': (0, inline_1.dataindex)(ns)
|
|
6008
5774
|
}, (0, dom_1.defrag)((0, util_1.unwrap)(fillFirstLine(ns)))))])))])))), ns => new parser_1.List([new parser_1.Node(format((0, dom_1.html)('ul', (0, util_1.unwrap)(ns))))]))));
|
|
6009
|
-
exports.checkbox = (0, combinator_1.focus)(/\[[xX ]\](?=$|[ \n])/y, ({
|
|
5775
|
+
exports.checkbox = (0, combinator_1.focus)(/\[[xX ]\](?=$|[ \r\n])/y, ({
|
|
6010
5776
|
source,
|
|
6011
5777
|
position
|
|
6012
5778
|
}) => new parser_1.List([new parser_1.Node((0, dom_1.html)('span', {
|
|
@@ -6115,9 +5881,8 @@ const parser_1 = __webpack_require__(605);
|
|
|
6115
5881
|
const combinator_1 = __webpack_require__(3484);
|
|
6116
5882
|
const source_1 = __webpack_require__(8745);
|
|
6117
5883
|
const util_1 = __webpack_require__(4992);
|
|
6118
|
-
const normalize_1 = __webpack_require__(4490);
|
|
6119
5884
|
const dom_1 = __webpack_require__(394);
|
|
6120
|
-
exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+[^\S\r\n]*\r?\n(?=\S)/y, (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(context => context.header, (0, combinator_1.focus)(/(---+)[^\S\r\n]*\r?\n(?:[a-z][0-9a-z]*(?:-[0-9a-z]+)*:[ \t]+\S[^\r\n]*\r?\n){1,100}\1[^\S\r\n]*(?:$|\r?\n)/yi, (0, combinator_1.convert)(source =>
|
|
5885
|
+
exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+[^\S\r\n]*\r?\n(?=\S)/y, (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(context => context.header, (0, combinator_1.focus)(/(---+)[^\S\r\n]*\r?\n(?:[a-z][0-9a-z]*(?:-[0-9a-z]+)*:[ \t]+\S[^\r\n]*\r?\n){1,100}\1[^\S\r\n]*(?:$|\r?\n)/yi, (0, combinator_1.convert)(source => source.slice(source.indexOf('\n') + 1, source.trimEnd().lastIndexOf('\n')), (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.union)([field])), ns => new parser_1.List([new parser_1.Node((0, dom_1.html)('aside', {
|
|
6121
5886
|
class: 'header'
|
|
6122
5887
|
}, [(0, dom_1.html)('details', {
|
|
6123
5888
|
open: ''
|
|
@@ -6131,7 +5896,7 @@ exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+[^
|
|
|
6131
5896
|
class: 'invalid',
|
|
6132
5897
|
translate: 'no',
|
|
6133
5898
|
...(0, util_1.invalid)('header', 'syntax', 'Invalid syntax')
|
|
6134
|
-
},
|
|
5899
|
+
}, source.slice(position)))]);
|
|
6135
5900
|
}])), (0, combinator_1.clear)((0, source_1.str)(/[^\S\r\n]*\r?\n/y))])));
|
|
6136
5901
|
const field = (0, combinator_1.line)(({
|
|
6137
5902
|
source,
|
|
@@ -6357,7 +6122,7 @@ exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1
|
|
|
6357
6122
|
for (let i = 0; i < prefix; ++i) {
|
|
6358
6123
|
nodes.unshift(new parser_1.Node('('));
|
|
6359
6124
|
nodes = new parser_1.List([new parser_1.Node((0, dom_1.html)('span', {
|
|
6360
|
-
class: (0, bracket_1.bracketname)(context,
|
|
6125
|
+
class: (0, bracket_1.bracketname)(context, 0, 0)
|
|
6361
6126
|
}, (0, dom_1.defrag)((0, util_1.unwrap)(nodes))))]);
|
|
6362
6127
|
context.range += 1;
|
|
6363
6128
|
}
|
|
@@ -6599,7 +6364,7 @@ const inline_1 = __webpack_require__(7973);
|
|
|
6599
6364
|
const link_1 = __webpack_require__(3628);
|
|
6600
6365
|
const source_1 = __webpack_require__(8745);
|
|
6601
6366
|
exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.open)(/(?<![0-9A-Za-z][.+-]?|[@#])https?:\/\/(?=[\x21-\x7E])/y, (0, combinator_1.precedence)(0, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(source_1.unescsource, /(?<![-+*=~^_,.;:!?]|\/{3})(?:[-+*=~^_,.;:!?]|\/{3,}(?!\/))*(?=[\\$"`\[\](){}<>()[]{}|]|[^\x21-\x7E]|$)/y), (0, combinator_1.precedence)(1, bracket)]), [[/[^\x21-\x7E]|\$/y, 9]])), false, [3 | 8 /* Backtrack.unescapable */]), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, context => new parser_1.List([new parser_1.Node((0, link_1.parse)(new parser_1.List(), new parser_1.List([new parser_1.Node(context.source)]), context))]))), (0, combinator_1.open)((0, source_1.str)(/[^:]+/y), (0, combinator_1.some)(inline_1.inline))])));
|
|
6602
|
-
exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.focus)(/(?<=^|[\r\n])!?https?:\/\/\S+(?=[^\S\n]*(?=$|\n))/y, (0, combinator_1.tails)([(0, source_1.str)('!'), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, context => {
|
|
6367
|
+
exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.focus)(/(?<=^|[\r\n])!?https?:\/\/\S+(?=[^\S\r\n]*(?=$|\r?\n))/y, (0, combinator_1.tails)([(0, source_1.str)('!'), (0, combinator_1.union)([(0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, context => {
|
|
6603
6368
|
const {
|
|
6604
6369
|
source,
|
|
6605
6370
|
position
|
|
@@ -6717,7 +6482,7 @@ const parser_1 = __webpack_require__(605);
|
|
|
6717
6482
|
const combinator_1 = __webpack_require__(3484);
|
|
6718
6483
|
const util_1 = __webpack_require__(4992);
|
|
6719
6484
|
const dom_1 = __webpack_require__(394);
|
|
6720
|
-
exports.code = (0, combinator_1.match)(/(`+)(?!`)([^\n]*?)(?:((?<!`)\1(?!`))|(?=$|\n))/y, ([whole, opener, body, closer]) => () => closer ? new parser_1.List([new parser_1.Node((0, dom_1.html)('code', {
|
|
6485
|
+
exports.code = (0, combinator_1.match)(/(`+)(?!`)([^\r\n]*?)(?:((?<!`)\1(?!`))|(?=$|\r?\n))/y, ([whole, opener, body, closer]) => () => closer ? new parser_1.List([new parser_1.Node((0, dom_1.html)('code', {
|
|
6721
6486
|
'data-src': whole
|
|
6722
6487
|
}, format(body)))]) : body ? new parser_1.List([new parser_1.Node((0, dom_1.html)('code', {
|
|
6723
6488
|
class: 'invalid',
|
|
@@ -7164,7 +6929,7 @@ const dom_1 = __webpack_require__(394);
|
|
|
7164
6929
|
exports.indexer = (0, combinator_1.validate)(' [|', (0, combinator_1.surround)(/ \[(?=\|\S)/y, (0, combinator_1.union)([index_1.signature, (0, combinator_1.focus)(/\|(?=\])/y, () => new parser_1.List([new parser_1.Node((0, dom_1.html)('span', {
|
|
7165
6930
|
class: 'indexer',
|
|
7166
6931
|
'data-index': ''
|
|
7167
|
-
}))]))]), /\][^\S\n]*(?:$|\n)/y));
|
|
6932
|
+
}))]))]), /\][^\S\r\n]*(?:$|\r?\n)/y));
|
|
7168
6933
|
|
|
7169
6934
|
/***/ },
|
|
7170
6935
|
|
|
@@ -7275,7 +7040,7 @@ exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combina
|
|
|
7275
7040
|
(0, combinator_1.precedence)(0, (0, combinator_1.recursion)(3 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', `</${tag}>`)), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, `</${tag}>`), true)])))), (0, source_1.str)(`</${tag}>`), true, [], ([as, bs = new parser_1.List(), cs], context) => new parser_1.List([new parser_1.Node(elem(tag, true, [...(0, util_1.unwrap)(as)], bs, cs, context))]), ([as, bs = new parser_1.List()], context) => new parser_1.List([new parser_1.Node(elem(tag, true, [...(0, util_1.unwrap)(as)], bs, new parser_1.List(), context))])), ([, tag]) => tag2index(tag), Array(exports.TAGS.length))), (0, combinator_1.surround)(
|
|
7276
7041
|
// https://html.spec.whatwg.org/multipage/syntax.html#void-elements
|
|
7277
7042
|
(0, source_1.str)(/<[a-z]+(?=[ >])/yi), (0, combinator_1.precedence)(9, (0, combinator_1.some)((0, combinator_1.union)([exports.attribute]))), (0, combinator_1.open)((0, source_1.str)(/ ?/y), (0, source_1.str)('>'), true), true, [], ([as, bs = new parser_1.List(), cs], context) => new parser_1.List([new parser_1.Node(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs).import(cs))], new parser_1.List(), new parser_1.List(), context))]), ([as, bs = new parser_1.List()], context) => new parser_1.List([new parser_1.Node(elem(as.head.value.slice(1), false, [...(0, util_1.unwrap)(as.import(bs))], new parser_1.List(), new parser_1.List(), context))]))]));
|
|
7278
|
-
exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/ [a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[ >])/yi), (0, source_1.str)(/ [^\s<>]+/y)]);
|
|
7043
|
+
exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/ [a-z]+(?:-[a-z]+)*(?:="(?:\\[^\r\n]|[^\\\r\n"])*")?(?=[ >])/yi), (0, source_1.str)(/ [^\s<>]+/y)]);
|
|
7279
7044
|
function elem(tag, content, as, bs, cs, context) {
|
|
7280
7045
|
if (!tags.includes(tag)) return ielem('tag', `Invalid HTML tag name "${tag}"`, context);
|
|
7281
7046
|
if (content) {
|
|
@@ -7480,7 +7245,7 @@ exports.medialink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8
|
|
|
7480
7245
|
value: params
|
|
7481
7246
|
}], context) => new parser_1.List([new parser_1.Node(parse(content, params, context))])))));
|
|
7482
7247
|
exports.uri = (0, combinator_1.union)([(0, combinator_1.open)(' ', (0, source_1.str)(/\S+/y)), (0, source_1.str)(/[^\s{}]+/y)]);
|
|
7483
|
-
exports.option = (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/ nofollow(?=[ }])/y), () => new parser_1.List([new parser_1.Node(' rel="nofollow"')])), (0, source_1.str)(/ [a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[ }])/yi), (0, source_1.str)(/ [^\s{}]+/y)]);
|
|
7248
|
+
exports.option = (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/ nofollow(?=[ }])/y), () => new parser_1.List([new parser_1.Node(' rel="nofollow"')])), (0, source_1.str)(/ [a-z]+(?:-[a-z]+)*(?:="(?:\\[^\r\n]|[^\\\r\n"])*")?(?=[ }])/yi), (0, source_1.str)(/ [^\s{}]+/y)]);
|
|
7484
7249
|
function parse(content, params, context) {
|
|
7485
7250
|
const INSECURE_URI = params.shift().value;
|
|
7486
7251
|
(0, combinator_1.consume)(10, context);
|
|
@@ -7626,7 +7391,7 @@ const source_1 = __webpack_require__(8745);
|
|
|
7626
7391
|
const util_1 = __webpack_require__(4992);
|
|
7627
7392
|
const dom_1 = __webpack_require__(394);
|
|
7628
7393
|
const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![a-z])|:\/\//i;
|
|
7629
|
-
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.union)([(0, combinator_1.surround)(/\$(?={)/y, (0, combinator_1.precedence)(4, bracket), '$', false, [3 | 16 /* Backtrack.escapable */]), (0, combinator_1.surround)(/\$(?![\s{}])/y, (0, combinator_1.precedence)(2, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(source_1.escsource, /\$|[`"{}\n]/y), (0, combinator_1.precedence)(4, bracket)]))), /(?<!\s)\$(?![-0-9A-Za-z])/y, false, [3 | 16 /* Backtrack.escapable */])]), ({
|
|
7394
|
+
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combinator_1.union)([(0, combinator_1.surround)(/\$(?={)/y, (0, combinator_1.precedence)(4, bracket), '$', false, [3 | 16 /* Backtrack.escapable */]), (0, combinator_1.surround)(/\$(?![\s{}])/y, (0, combinator_1.precedence)(2, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(source_1.escsource, /\$|[`"{}\r\n]/y), (0, combinator_1.precedence)(4, bracket)]))), /(?<!\s)\$(?![-0-9A-Za-z])/y, false, [3 | 16 /* Backtrack.escapable */])]), ({
|
|
7630
7395
|
source,
|
|
7631
7396
|
caches: {
|
|
7632
7397
|
math: cache
|
|
@@ -7640,7 +7405,7 @@ exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.rewrite)((0, combin
|
|
|
7640
7405
|
translate: 'no',
|
|
7641
7406
|
...(0, util_1.invalid)('math', 'content', `"${source.match(forbiddenCommand)[0]}" command is forbidden`)
|
|
7642
7407
|
}, source))])));
|
|
7643
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(5 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.escsource, /[{}$\n]/y)]))), (0, source_1.str)('}'), true));
|
|
7408
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(5 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.escsource, /[{}$\r\n]/y)]))), (0, source_1.str)('}'), true));
|
|
7644
7409
|
|
|
7645
7410
|
/***/ },
|
|
7646
7411
|
|
|
@@ -7869,11 +7634,11 @@ const inline_1 = __webpack_require__(7973);
|
|
|
7869
7634
|
const source_1 = __webpack_require__(8745);
|
|
7870
7635
|
const util_1 = __webpack_require__(4992);
|
|
7871
7636
|
const dom_1 = __webpack_require__(394);
|
|
7872
|
-
exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.fallback)((0, combinator_1.surround)((0, source_1.str)(/\[%(?=[ \n])/y), (0, combinator_1.precedence)(3, (0, combinator_1.recursion)(3 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /[ \n]%\]/y, [[/[ \n]%\]/y, 3]]))), (0, combinator_1.close)(source_1.text, (0, source_1.str)('%]')), true, [], ([as, bs = new parser_1.List(), cs]) => new parser_1.List([new parser_1.Node((0, dom_1.html)('span', {
|
|
7637
|
+
exports.remark = (0, combinator_1.lazy)(() => (0, combinator_1.fallback)((0, combinator_1.surround)((0, source_1.str)(/\[%(?=[ \r\n])/y), (0, combinator_1.precedence)(3, (0, combinator_1.recursion)(3 /* Recursion.inline */, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /[ \n]%\]/y, [[/[ \n]%\]/y, 3]]))), (0, combinator_1.close)(source_1.text, (0, source_1.str)('%]')), true, [], ([as, bs = new parser_1.List(), cs]) => new parser_1.List([new parser_1.Node((0, dom_1.html)('span', {
|
|
7873
7638
|
class: 'remark'
|
|
7874
7639
|
}, [(0, dom_1.html)('input', {
|
|
7875
7640
|
type: 'checkbox'
|
|
7876
|
-
}), (0, dom_1.html)('span', (0, dom_1.defrag)((0, util_1.unwrap)(as.import(bs).import(cs))))]))]), ([as, bs]) => bs && as.import(bs)), (0, combinator_1.focus)(/\[%+(?=[ \n])/y, ({
|
|
7641
|
+
}), (0, dom_1.html)('span', (0, dom_1.defrag)((0, util_1.unwrap)(as.import(bs).import(cs))))]))]), ([as, bs]) => bs && as.import(bs)), (0, combinator_1.focus)(/\[%+(?=[ \r\n])/y, ({
|
|
7877
7642
|
source
|
|
7878
7643
|
}) => new parser_1.List([new parser_1.Node((0, dom_1.html)('span', {
|
|
7879
7644
|
class: 'invalid',
|
|
@@ -7932,7 +7697,7 @@ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.bind)((0, combinato
|
|
|
7932
7697
|
}) => acc ? acc + ' ' + value : value, '').trim())), new parser_1.Node((0, dom_1.html)('rp', ')'))])))))]);
|
|
7933
7698
|
}
|
|
7934
7699
|
}));
|
|
7935
|
-
const delimiter = /[$"`\[\](){}<>()[]{}|]|\\?\n/y;
|
|
7700
|
+
const delimiter = /[$"`\[\](){}<>()[]{}|]|\\?\r?\n/y;
|
|
7936
7701
|
const text = input => {
|
|
7937
7702
|
const context = input;
|
|
7938
7703
|
const {
|
|
@@ -7998,7 +7763,7 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
7998
7763
|
const url_1 = __webpack_require__(2129);
|
|
7999
7764
|
const media_1 = __webpack_require__(7478);
|
|
8000
7765
|
exports.shortmedia = (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.rewrite)((0, combinator_1.open)('!', url_1.url), (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media]))));
|
|
8001
|
-
exports.lineshortmedia = (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.focus)(/(?<=^|[\r\n])!https?:\/\/\S+(?=[^\S\n]*(?:$|\n))/y, (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media]))));
|
|
7766
|
+
exports.lineshortmedia = (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.focus)(/(?<=^|[\r\n])!https?:\/\/\S+(?=[^\S\r\n]*(?:$|\r?\n))/y, (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media]))));
|
|
8002
7767
|
|
|
8003
7768
|
/***/ },
|
|
8004
7769
|
|
|
@@ -8404,7 +8169,7 @@ function repeat(opener, after, closer, rs, parser, cons, termination = (nodes, c
|
|
|
8404
8169
|
return acc;
|
|
8405
8170
|
}) {
|
|
8406
8171
|
const test = (0, delimiter_1.tester)(after, false);
|
|
8407
|
-
return
|
|
8172
|
+
return input => {
|
|
8408
8173
|
const context = input;
|
|
8409
8174
|
const {
|
|
8410
8175
|
source,
|
|
@@ -8418,7 +8183,10 @@ function repeat(opener, after, closer, rs, parser, cons, termination = (nodes, c
|
|
|
8418
8183
|
let i = opener.length;
|
|
8419
8184
|
for (; source[context.position + i] === source[context.position];) ++i;
|
|
8420
8185
|
context.position += i;
|
|
8421
|
-
if (test(input) === undefined)
|
|
8186
|
+
if (test(input) === undefined) {
|
|
8187
|
+
context.position = position;
|
|
8188
|
+
return;
|
|
8189
|
+
}
|
|
8422
8190
|
let depth = i / opener.length + 1 | 0;
|
|
8423
8191
|
if (recursions) for (const recursion of rs) {
|
|
8424
8192
|
const rec = (0, alias_1.min)(recursion, recursions.length - 1);
|
|
@@ -8493,9 +8261,9 @@ function repeat(opener, after, closer, rs, parser, cons, termination = (nodes, c
|
|
|
8493
8261
|
++i;
|
|
8494
8262
|
}
|
|
8495
8263
|
const postfix = i;
|
|
8496
|
-
context.range = context.position - position - prefix
|
|
8264
|
+
context.range = context.position - position - prefix;
|
|
8497
8265
|
return termination(nodes, context, prefix, postfix, state);
|
|
8498
|
-
}
|
|
8266
|
+
};
|
|
8499
8267
|
}
|
|
8500
8268
|
exports.repeat = repeat;
|
|
8501
8269
|
function countFollows(source, position, closer, limit) {
|
|
@@ -8526,7 +8294,6 @@ const codeblock_1 = __webpack_require__(9194);
|
|
|
8526
8294
|
const mathblock_1 = __webpack_require__(4903);
|
|
8527
8295
|
const extension_1 = __webpack_require__(6193);
|
|
8528
8296
|
const source_1 = __webpack_require__(8745);
|
|
8529
|
-
const api_1 = __webpack_require__(5886);
|
|
8530
8297
|
const parser = (0, combinator_1.union)([(0, combinator_1.some)(source_1.emptysegment, context_1.MAX_SEGMENT_SIZE + 1), input => {
|
|
8531
8298
|
const {
|
|
8532
8299
|
source,
|
|
@@ -8564,7 +8331,7 @@ function* segment(source, initial = true) {
|
|
|
8564
8331
|
position = context.position;
|
|
8565
8332
|
for (let i = 0; i < segs.length; ++i) {
|
|
8566
8333
|
const seg = segs[i];
|
|
8567
|
-
initial && !validate(seg, context_1.MAX_SEGMENT_SIZE) ? yield [`${"\u0007" /* Command.Error */}Too large segment over ${context_1.MAX_SEGMENT_SIZE.toLocaleString('en')} bytes.\n${seg}`, 0 /* Segment.unknown */] : yield [
|
|
8334
|
+
initial && !validate(seg, context_1.MAX_SEGMENT_SIZE) ? yield [`${"\u0007" /* Command.Error */}Too large segment over ${context_1.MAX_SEGMENT_SIZE.toLocaleString('en')} bytes.\n${seg}`, 0 /* Segment.unknown */] : yield [seg, context.segment];
|
|
8568
8335
|
}
|
|
8569
8336
|
}
|
|
8570
8337
|
}
|
|
@@ -8686,7 +8453,7 @@ const escsource = context => {
|
|
|
8686
8453
|
case '\\':
|
|
8687
8454
|
switch (source[position + 1]) {
|
|
8688
8455
|
case undefined:
|
|
8689
|
-
|
|
8456
|
+
case '\r':
|
|
8690
8457
|
case '\n':
|
|
8691
8458
|
return new parser_1.List([new parser_1.Node(char)]);
|
|
8692
8459
|
default:
|
|
@@ -8860,6 +8627,7 @@ const text = input => {
|
|
|
8860
8627
|
switch (source[position + 1]) {
|
|
8861
8628
|
case undefined:
|
|
8862
8629
|
return new parser_1.List();
|
|
8630
|
+
case '\r':
|
|
8863
8631
|
case '\n':
|
|
8864
8632
|
return new parser_1.List();
|
|
8865
8633
|
default:
|
|
@@ -8877,7 +8645,7 @@ const text = input => {
|
|
|
8877
8645
|
exports.nonWhitespace.lastIndex = position + 1;
|
|
8878
8646
|
const s = canSkip(source, position);
|
|
8879
8647
|
let i = s ? exports.nonWhitespace.test(source) ? exports.nonWhitespace.lastIndex - 1 : source.length : next(source, position, state);
|
|
8880
|
-
const lineend = false || s && i === source.length || s && source[i] === '\n';
|
|
8648
|
+
const lineend = false || s && i === source.length || s && source[i] === '\r' || s && source[i] === '\n';
|
|
8881
8649
|
i -= position;
|
|
8882
8650
|
i = lineend ? i : i - +s || 1;
|
|
8883
8651
|
(0, combinator_1.consume)(i - 1, context);
|
|
@@ -9194,9 +8962,9 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
9194
8962
|
const normalize_1 = __webpack_require__(4490);
|
|
9195
8963
|
var blank;
|
|
9196
8964
|
(function (blank) {
|
|
9197
|
-
blank.line = new RegExp(/((?:^|\n)[^\S\n]*(?=\S))((?:[^\S\n]|\\(?=$|\s)|&IBHN
|
|
9198
|
-
blank.start = new RegExp(/(?:[^\S\n]|\\(?=$|\s)|&IBHN
|
|
9199
|
-
blank.unit = new RegExp(/(?:[^\S\n]|\\(?=$|\s)|&IBHN
|
|
8965
|
+
blank.line = new RegExp(/((?:^|\n)[^\S\r\n]*(?=\S))((?:[^\S\r\n]|\\(?=$|\s)|&IBHN;|[IBC]|<wbr ?>)+(?=$|\r?\n))/g.source.replace('IBHN', `(?:${normalize_1.invisibleBlankHTMLEntityNames.join('|')})`).replace('IBC', `${normalize_1.invisibleBlankCharacters.join('')}`), 'g');
|
|
8966
|
+
blank.start = new RegExp(/(?:[^\S\r\n]|\\(?=$|\s)|&IBHN;|[IBC]|<wbr ?>)+/y.source.replace('IBHN', `(?:${normalize_1.invisibleBlankHTMLEntityNames.join('|')})`).replace('IBC', `${normalize_1.invisibleBlankCharacters.join('')}`), 'y');
|
|
8967
|
+
blank.unit = new RegExp(/(?:[^\S\r\n]|\\(?=$|\s)|&IBHN;|[IBC]|<wbr ?>)/y.source.replace('IBHN', `(?:${normalize_1.invisibleBlankHTMLEntityNames.join('|')})`).replace('IBC', `${normalize_1.invisibleBlankCharacters.join('')}`), 'y');
|
|
9200
8968
|
})(blank || (blank = {}));
|
|
9201
8969
|
function visualize(parser) {
|
|
9202
8970
|
return (0, combinator_1.convert)(source => source.replace(blank.line, `$1${"\u001B" /* Command.Escape */}$2`), parser);
|
|
@@ -9208,15 +8976,15 @@ function blankWith(starts, delimiter) {
|
|
|
9208
8976
|
return new RegExp([
|
|
9209
8977
|
// 空行除去
|
|
9210
8978
|
// 完全な空行はエスケープ済みなので再帰的バックトラックにはならない。
|
|
9211
|
-
String.raw`(?:${starts}(?:\\?\s|&(?:${normalize_1.invisibleBlankHTMLEntityNames.join('|')})
|
|
8979
|
+
String.raw`(?:${starts}(?:\\?\s|&(?:${normalize_1.invisibleBlankHTMLEntityNames.join('|')});|[${normalize_1.invisibleBlankCharacters.join('')}]|<wbr ?>)*)?`, typeof delimiter === 'string' ? delimiter.replace(/[*+()\[\]]/g, '\\$&') : delimiter.source].join(''), 'y');
|
|
9212
8980
|
}
|
|
9213
8981
|
exports.blankWith = blankWith;
|
|
9214
8982
|
function beforeNonblankWith(delimiter) {
|
|
9215
|
-
return new RegExp([typeof delimiter === 'string' ? delimiter.replace(/[*+()\[\]]/g, '\\$&') : delimiter.source, String.raw`(?!\\?\s|&(?:${normalize_1.invisibleBlankHTMLEntityNames.join('|')})
|
|
8983
|
+
return new RegExp([typeof delimiter === 'string' ? delimiter.replace(/[*+()\[\]]/g, '\\$&') : delimiter.source, String.raw`(?!\\?\s|&(?:${normalize_1.invisibleBlankHTMLEntityNames.join('|')});|[${normalize_1.invisibleBlankCharacters.join('')}]|<wbr ?>)`].join(''), 'y');
|
|
9216
8984
|
}
|
|
9217
8985
|
exports.beforeNonblankWith = beforeNonblankWith;
|
|
9218
8986
|
function afterNonblankWith(delimiter) {
|
|
9219
|
-
return new RegExp([String.raw`(?<!\s|&(?:${normalize_1.invisibleBlankHTMLEntityNames.join('|')})
|
|
8987
|
+
return new RegExp([String.raw`(?<!\s|&(?:${normalize_1.invisibleBlankHTMLEntityNames.join('|')});|[${normalize_1.invisibleBlankCharacters.join('')}]|<wbr ?>)`, typeof delimiter === 'string' ? delimiter.replace(/[*+()\[\]]/g, '\\$&') : delimiter.source].join(''), 'y');
|
|
9220
8988
|
}
|
|
9221
8989
|
function isNonblankFirstLine(nodes) {
|
|
9222
8990
|
if (nodes.length === 0) return true;
|
|
@@ -9243,6 +9011,7 @@ function isNonblank({
|
|
|
9243
9011
|
case '':
|
|
9244
9012
|
case ' ':
|
|
9245
9013
|
case '\t':
|
|
9014
|
+
case '\r':
|
|
9246
9015
|
case '\n':
|
|
9247
9016
|
return false;
|
|
9248
9017
|
default:
|
|
@@ -9254,7 +9023,7 @@ function trimBlank(parser) {
|
|
|
9254
9023
|
}
|
|
9255
9024
|
exports.trimBlank = trimBlank;
|
|
9256
9025
|
function trimBlankStart(parser) {
|
|
9257
|
-
return
|
|
9026
|
+
return input => {
|
|
9258
9027
|
const context = input;
|
|
9259
9028
|
const {
|
|
9260
9029
|
source,
|
|
@@ -9266,7 +9035,7 @@ function trimBlankStart(parser) {
|
|
|
9266
9035
|
reg.test(source);
|
|
9267
9036
|
context.position = reg.lastIndex || position;
|
|
9268
9037
|
return context.position === source.length ? new parser_1.List() : parser(input);
|
|
9269
|
-
}
|
|
9038
|
+
};
|
|
9270
9039
|
}
|
|
9271
9040
|
function trimBlankEnd(parser) {
|
|
9272
9041
|
return (0, combinator_1.fmap)(parser, trimBlankNodeEnd);
|