securemark 0.258.2 → 0.258.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.js +210 -183
- package/markdown.d.ts +8 -10
- package/package.json +1 -1
- package/src/combinator/control/constraint/block.ts +3 -1
- package/src/combinator/control/constraint/line.ts +6 -1
- package/src/combinator/control/manipulation/indent.ts +3 -0
- package/src/combinator/data/parser/context/memo.ts +7 -4
- package/src/combinator/data/parser/context.test.ts +16 -16
- package/src/combinator/data/parser/context.ts +40 -37
- package/src/combinator/data/parser/some.ts +4 -2
- package/src/combinator/data/parser.ts +2 -2
- package/src/parser/api/bind.ts +1 -1
- package/src/parser/api/parse.test.ts +4 -4
- package/src/parser/api/parse.ts +1 -1
- package/src/parser/autolink.test.ts +3 -2
- package/src/parser/autolink.ts +17 -1
- package/src/parser/block/blockquote.ts +4 -4
- package/src/parser/block/dlist.ts +3 -3
- package/src/parser/block/extension/table.ts +4 -4
- package/src/parser/block/ilist.ts +2 -2
- package/src/parser/block/olist.ts +2 -2
- package/src/parser/block/paragraph.test.ts +3 -1
- package/src/parser/block/reply/cite.ts +2 -2
- package/src/parser/block/reply/quote.ts +3 -3
- package/src/parser/block/sidefence.ts +2 -2
- package/src/parser/block/table.ts +5 -5
- package/src/parser/block/ulist.ts +4 -4
- package/src/parser/block.ts +3 -3
- package/src/parser/context.ts +1 -1
- package/src/parser/inline/annotation.ts +7 -6
- package/src/parser/inline/autolink/email.test.ts +3 -3
- package/src/parser/inline/autolink/email.ts +2 -2
- package/src/parser/inline/autolink/url.test.ts +6 -6
- package/src/parser/inline/autolink/url.ts +2 -2
- package/src/parser/inline/autolink.ts +6 -6
- package/src/parser/inline/bracket.ts +8 -8
- package/src/parser/inline/code.ts +2 -2
- package/src/parser/inline/comment.ts +2 -2
- package/src/parser/inline/deletion.ts +5 -4
- package/src/parser/inline/emphasis.ts +5 -4
- package/src/parser/inline/emstrong.ts +5 -4
- package/src/parser/inline/extension/index.ts +9 -8
- package/src/parser/inline/extension/indexer.ts +2 -2
- package/src/parser/inline/extension/label.ts +3 -3
- package/src/parser/inline/extension/placeholder.ts +5 -4
- package/src/parser/inline/html.test.ts +1 -1
- package/src/parser/inline/html.ts +4 -4
- package/src/parser/inline/htmlentity.ts +2 -2
- package/src/parser/inline/insertion.ts +5 -4
- package/src/parser/inline/link.ts +11 -9
- package/src/parser/inline/mark.ts +5 -4
- package/src/parser/inline/math.ts +3 -3
- package/src/parser/inline/media.ts +8 -7
- package/src/parser/inline/reference.ts +8 -7
- package/src/parser/inline/ruby.ts +4 -4
- package/src/parser/inline/shortmedia.ts +2 -2
- package/src/parser/inline/strong.ts +5 -4
- package/src/parser/inline/template.ts +6 -6
- package/src/parser/inline.test.ts +5 -3
- package/src/parser/source/escapable.ts +2 -2
- package/src/parser/source/str.ts +5 -5
- package/src/parser/source/text.test.ts +16 -1
- package/src/parser/source/text.ts +5 -4
- package/src/parser/source/unescapable.ts +2 -2
- package/src/parser/visibility.ts +5 -5
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.258.
|
|
1
|
+
/*! securemark v0.258.5 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory(require("DOMPurify"), require("Prism"));
|
|
@@ -2124,11 +2124,14 @@ const global_1 = __webpack_require__(4128);
|
|
|
2124
2124
|
|
|
2125
2125
|
const parser_1 = __webpack_require__(6728);
|
|
2126
2126
|
|
|
2127
|
+
const memo_1 = __webpack_require__(1090);
|
|
2128
|
+
|
|
2127
2129
|
const line_1 = __webpack_require__(9315);
|
|
2128
2130
|
|
|
2129
2131
|
function block(parser, separation = true) {
|
|
2130
|
-
return (source, context) => {
|
|
2132
|
+
return (source, context = {}) => {
|
|
2131
2133
|
if (source === '') return;
|
|
2134
|
+
context.memo ??= new memo_1.Memo();
|
|
2132
2135
|
const result = parser(source, context);
|
|
2133
2136
|
if (!result) return;
|
|
2134
2137
|
const rest = (0, parser_1.exec)(result);
|
|
@@ -2202,11 +2205,17 @@ const global_1 = __webpack_require__(4128);
|
|
|
2202
2205
|
|
|
2203
2206
|
const parser_1 = __webpack_require__(6728);
|
|
2204
2207
|
|
|
2208
|
+
const memo_1 = __webpack_require__(1090);
|
|
2209
|
+
|
|
2205
2210
|
function line(parser) {
|
|
2206
|
-
return (source, context) => {
|
|
2211
|
+
return (source, context = {}) => {
|
|
2207
2212
|
if (source === '') return;
|
|
2213
|
+
context.memo ??= new memo_1.Memo();
|
|
2208
2214
|
const line = firstline(source);
|
|
2215
|
+
const memo = context.memo;
|
|
2216
|
+
memo.offset += source.length - line.length;
|
|
2209
2217
|
const result = parser(line, context);
|
|
2218
|
+
memo.offset -= source.length - line.length;
|
|
2210
2219
|
if (!result) return;
|
|
2211
2220
|
return isEmpty((0, parser_1.exec)(result)) ? [(0, parser_1.eval)(result), source.slice(line.length)] : global_1.undefined;
|
|
2212
2221
|
};
|
|
@@ -2412,7 +2421,10 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
2412
2421
|
function indent(opener, parser, separation = false) {
|
|
2413
2422
|
if (typeof opener === 'function') return indent(/^([ \t])\1*/, opener, parser);
|
|
2414
2423
|
return (0, bind_1.bind)((0, block_1.block)((0, match_1.match)(opener, (0, memoize_1.memoize)(([indent]) => (0, some_1.some)((0, line_1.line)((0, surround_1.open)(indent, source => [[source], '']))), ([indent]) => indent.length * 2 + +(indent[0] === ' '), [])), separation), (lines, rest, context) => {
|
|
2424
|
+
const memo = context.memo;
|
|
2425
|
+
memo && (memo.offset += rest.length);
|
|
2415
2426
|
const result = parser(trimBlockEnd(lines.join('')), context);
|
|
2427
|
+
memo && (memo.offset -= rest.length);
|
|
2416
2428
|
return result && (0, parser_1.exec)(result) === '' ? [(0, parser_1.eval)(result), rest] : global_1.undefined;
|
|
2417
2429
|
});
|
|
2418
2430
|
}
|
|
@@ -2783,7 +2795,7 @@ exports.check = check;
|
|
|
2783
2795
|
Object.defineProperty(exports, "__esModule", ({
|
|
2784
2796
|
value: true
|
|
2785
2797
|
}));
|
|
2786
|
-
exports.state = exports.guard = exports.precedence = exports.
|
|
2798
|
+
exports.state = exports.constraint = exports.guard = exports.precedence = exports.creation = exports.syntax = exports.context = exports.reset = void 0;
|
|
2787
2799
|
|
|
2788
2800
|
const global_1 = __webpack_require__(4128);
|
|
2789
2801
|
|
|
@@ -2844,75 +2856,56 @@ function apply(parser, source, context, changes, values) {
|
|
|
2844
2856
|
}
|
|
2845
2857
|
|
|
2846
2858
|
function syntax(syntax, precedence, cost, parser) {
|
|
2847
|
-
|
|
2848
|
-
parser = cost;
|
|
2849
|
-
cost = 1;
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
return (source, context) => {
|
|
2859
|
+
return creation(cost, (source, context) => {
|
|
2853
2860
|
if (source === '') return;
|
|
2854
|
-
context.
|
|
2855
|
-
|
|
2861
|
+
const memo = context.memo ??= new memo_1.Memo();
|
|
2862
|
+
context.memorable ??= ~0;
|
|
2856
2863
|
const p = context.precedence;
|
|
2857
2864
|
context.precedence = precedence;
|
|
2858
|
-
const
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
recursion: 1
|
|
2862
|
-
}
|
|
2863
|
-
} = context;
|
|
2864
|
-
if (resources.budget <= 0) throw new Error('Too many creations');
|
|
2865
|
-
if (resources.recursion <= 0) throw new Error('Too much recursion');
|
|
2866
|
-
--resources.recursion;
|
|
2867
|
-
const pos = source.length;
|
|
2868
|
-
const cache = syntax && context.memo?.get(pos, syntax, state);
|
|
2865
|
+
const position = source.length;
|
|
2866
|
+
const state = context.state ?? 0;
|
|
2867
|
+
const cache = syntax && memo.get(position, syntax, state);
|
|
2869
2868
|
const result = cache ? cache.length === 0 ? global_1.undefined : [cache[0], source.slice(cache[1])] : parser(source, context);
|
|
2870
|
-
++resources.recursion;
|
|
2871
2869
|
|
|
2872
|
-
if (
|
|
2873
|
-
|
|
2870
|
+
if (syntax && state & context.memorable) {
|
|
2871
|
+
cache ?? memo.set(position, syntax, state, (0, parser_1.eval)(result), source.length - (0, parser_1.exec)(result, '').length);
|
|
2874
2872
|
}
|
|
2875
2873
|
|
|
2876
|
-
if (
|
|
2877
|
-
|
|
2878
|
-
context.memo ??= new memo_1.Memo();
|
|
2879
|
-
cache ?? context.memo.set(pos, syntax, state, (0, parser_1.eval)(result), source.length - (0, parser_1.exec)(result, '').length);
|
|
2880
|
-
} else if (result && context.memo?.length >= pos) {
|
|
2881
|
-
context.memo.clear(pos);
|
|
2882
|
-
}
|
|
2874
|
+
if (result && !state && memo.length >= position) {
|
|
2875
|
+
memo.clear(position);
|
|
2883
2876
|
}
|
|
2884
2877
|
|
|
2885
2878
|
context.precedence = p;
|
|
2886
2879
|
return result;
|
|
2887
|
-
};
|
|
2880
|
+
});
|
|
2888
2881
|
}
|
|
2889
2882
|
|
|
2890
2883
|
exports.syntax = syntax;
|
|
2891
2884
|
|
|
2892
|
-
function
|
|
2893
|
-
if (typeof cost === 'function') return
|
|
2885
|
+
function creation(cost, parser) {
|
|
2886
|
+
if (typeof cost === 'function') return creation(1, cost);
|
|
2894
2887
|
return (source, context) => {
|
|
2895
2888
|
const {
|
|
2896
2889
|
resources = {
|
|
2897
|
-
|
|
2890
|
+
clock: 1,
|
|
2898
2891
|
recursion: 1
|
|
2899
2892
|
}
|
|
2900
2893
|
} = context;
|
|
2901
|
-
if (resources.
|
|
2894
|
+
if (resources.clock <= 0) throw new Error('Too many creations');
|
|
2902
2895
|
if (resources.recursion <= 0) throw new Error('Too much recursion');
|
|
2903
2896
|
--resources.recursion;
|
|
2904
2897
|
const result = parser(source, context);
|
|
2905
2898
|
++resources.recursion;
|
|
2906
2899
|
|
|
2907
2900
|
if (result) {
|
|
2908
|
-
resources.
|
|
2901
|
+
resources.clock -= cost;
|
|
2909
2902
|
}
|
|
2910
2903
|
|
|
2911
2904
|
return result;
|
|
2912
2905
|
};
|
|
2913
2906
|
}
|
|
2914
2907
|
|
|
2915
|
-
exports.
|
|
2908
|
+
exports.creation = creation;
|
|
2916
2909
|
|
|
2917
2910
|
function precedence(precedence, parser) {
|
|
2918
2911
|
return (source, context) => {
|
|
@@ -2932,6 +2925,20 @@ function guard(f, parser) {
|
|
|
2932
2925
|
|
|
2933
2926
|
exports.guard = guard;
|
|
2934
2927
|
|
|
2928
|
+
function constraint(state, positive, parser) {
|
|
2929
|
+
if (typeof positive === 'function') {
|
|
2930
|
+
parser = positive;
|
|
2931
|
+
positive = true;
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
return (source, context) => {
|
|
2935
|
+
const s = positive ? state & context.state : state & ~context.state;
|
|
2936
|
+
return s === state ? parser(source, context) : global_1.undefined;
|
|
2937
|
+
};
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
exports.constraint = constraint;
|
|
2941
|
+
|
|
2935
2942
|
function state(state, positive, parser) {
|
|
2936
2943
|
if (typeof positive === 'function') {
|
|
2937
2944
|
parser = positive;
|
|
@@ -3073,12 +3080,13 @@ class Memo {
|
|
|
3073
3080
|
|
|
3074
3081
|
get(position, syntax, state) {
|
|
3075
3082
|
//console.log('get', position + this.offset, syntax, state, this.memory[position + this.offset - 1]?.[`${syntax}:${state}`]);;
|
|
3076
|
-
|
|
3083
|
+
const cache = this.memory[position + this.offset - 1]?.[`${syntax}:${state}`];
|
|
3084
|
+
return cache?.length === 2 ? [cache[0].slice(), cache[1]] : cache;
|
|
3077
3085
|
}
|
|
3078
3086
|
|
|
3079
3087
|
set(position, syntax, state, nodes, offset) {
|
|
3080
3088
|
const record = this.memory[position + this.offset - 1] ??= {};
|
|
3081
|
-
record[`${syntax}:${state}`] = nodes ? [nodes.slice(), offset] : []; //console.log('set', position + this.offset, syntax, state);
|
|
3089
|
+
record[`${syntax}:${state}`] = nodes ? [nodes.slice(), offset] : []; //console.log('set', position + this.offset, syntax, state, record[`${syntax}:${state}`]);
|
|
3082
3090
|
}
|
|
3083
3091
|
|
|
3084
3092
|
clear(position) {
|
|
@@ -3086,7 +3094,7 @@ class Memo {
|
|
|
3086
3094
|
|
|
3087
3095
|
for (let i = position + this.offset, len = memory.length; i < len; ++i) {
|
|
3088
3096
|
memory.pop();
|
|
3089
|
-
} //console.log('clear', position);
|
|
3097
|
+
} //console.log('clear', position + 1);
|
|
3090
3098
|
|
|
3091
3099
|
}
|
|
3092
3100
|
|
|
@@ -3221,7 +3229,7 @@ function some(parser, end, delimiters = [], limit = -1) {
|
|
|
3221
3229
|
if (context.delimiters?.match(rest, context.precedence)) break;
|
|
3222
3230
|
const result = parser(rest, context);
|
|
3223
3231
|
if (!result) break;
|
|
3224
|
-
nodes = nodes ? (0, array_1.push)(nodes, (0, parser_1.eval)(result)) : (0, parser_1.eval)(result);
|
|
3232
|
+
nodes = nodes ? nodes.length < (0, parser_1.eval)(result).length ? (0, array_1.unshift)(nodes, (0, parser_1.eval)(result)) : (0, array_1.push)(nodes, (0, parser_1.eval)(result)) : (0, parser_1.eval)(result);
|
|
3225
3233
|
rest = (0, parser_1.exec)(result);
|
|
3226
3234
|
if (limit >= 0 && source.length - rest.length > limit) break;
|
|
3227
3235
|
}
|
|
@@ -3462,7 +3470,7 @@ const array_1 = __webpack_require__(8112);
|
|
|
3462
3470
|
function bind(target, settings) {
|
|
3463
3471
|
let context = { ...settings,
|
|
3464
3472
|
host: settings.host ?? new url_1.ReadonlyURL(global_1.location.pathname, global_1.location.origin),
|
|
3465
|
-
|
|
3473
|
+
memorable: context_1.backtrackable
|
|
3466
3474
|
};
|
|
3467
3475
|
if (context.host?.origin === 'null') throw new Error(`Invalid host: ${context.host.href}`);
|
|
3468
3476
|
const blocks = [];
|
|
@@ -3822,7 +3830,7 @@ function parse(source, opts = {}, context) {
|
|
|
3822
3830
|
...(context?.resources && {
|
|
3823
3831
|
resources: context.resources
|
|
3824
3832
|
}),
|
|
3825
|
-
|
|
3833
|
+
memorable: context_1.backtrackable
|
|
3826
3834
|
};
|
|
3827
3835
|
if (context.host?.origin === 'null') throw new Error(`Invalid host: ${context.host.href}`);
|
|
3828
3836
|
const node = (0, dom_1.frag)();
|
|
@@ -3864,7 +3872,26 @@ const autolink_1 = __webpack_require__(6051);
|
|
|
3864
3872
|
|
|
3865
3873
|
const source_1 = __webpack_require__(6743);
|
|
3866
3874
|
|
|
3867
|
-
|
|
3875
|
+
const delimiter = /[@#>0-9A-Za-z\n]|\S[#>]/;
|
|
3876
|
+
|
|
3877
|
+
const autolink = (source, context) => {
|
|
3878
|
+
if (source === '') return;
|
|
3879
|
+
const i = source.search(delimiter);
|
|
3880
|
+
|
|
3881
|
+
switch (i) {
|
|
3882
|
+
case -1:
|
|
3883
|
+
return [[source], ''];
|
|
3884
|
+
|
|
3885
|
+
case 0:
|
|
3886
|
+
return parser(source, context);
|
|
3887
|
+
|
|
3888
|
+
default:
|
|
3889
|
+
return [[source.slice(0, i)], source.slice(i)];
|
|
3890
|
+
}
|
|
3891
|
+
};
|
|
3892
|
+
|
|
3893
|
+
exports.autolink = autolink;
|
|
3894
|
+
const parser = (0, combinator_1.lazy)(() => (0, combinator_1.union)([autolink_1.autolink, source_1.linebreak, source_1.unescsource]));
|
|
3868
3895
|
|
|
3869
3896
|
/***/ }),
|
|
3870
3897
|
|
|
@@ -3917,9 +3944,9 @@ const dom_1 = __webpack_require__(3252);
|
|
|
3917
3944
|
|
|
3918
3945
|
const random_1 = __webpack_require__(7325);
|
|
3919
3946
|
|
|
3920
|
-
exports.block = (0, combinator_1.
|
|
3947
|
+
exports.block = (0, combinator_1.creation)(error((0, combinator_1.reset)({
|
|
3921
3948
|
resources: {
|
|
3922
|
-
|
|
3949
|
+
clock: 50 * 1000,
|
|
3923
3950
|
recursion: 20
|
|
3924
3951
|
}
|
|
3925
3952
|
}, (0, combinator_1.union)([source_1.emptyline, horizontalrule_1.horizontalrule, heading_1.heading, ulist_1.ulist, olist_1.olist, ilist_1.ilist, dlist_1.dlist, table_1.table, codeblock_1.codeblock, mathblock_1.mathblock, extension_1.extension, sidefence_1.sidefence, blockquote_1.blockquote, reply_1.reply, paragraph_1.paragraph]))));
|
|
@@ -3968,8 +3995,8 @@ const indent = (0, combinator_1.block)((0, combinator_1.open)(opener, (0, combin
|
|
|
3968
3995
|
|
|
3969
3996
|
const unindent = source => source.replace(/(^|\n)>(?:[^\S\n]|(?=>*(?:$|\s)))|\n$/g, '$1');
|
|
3970
3997
|
|
|
3971
|
-
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.
|
|
3972
|
-
const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.
|
|
3998
|
+
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)((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)((0, combinator_1.some)(autolink_1.autolink), ns => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))])))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
|
|
3999
|
+
const markdown = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.rewrite)(indent, (0, combinator_1.convert)(unindent, markdown)), (0, combinator_1.creation)(99, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.contentline, opener), (0, combinator_1.convert)(unindent, (source, context) => {
|
|
3973
4000
|
const references = (0, dom_1.html)('ol', {
|
|
3974
4001
|
class: 'references'
|
|
3975
4002
|
});
|
|
@@ -4094,8 +4121,8 @@ exports.dlist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, locale_
|
|
|
4094
4121
|
| 2
|
|
4095
4122
|
/* State.media */
|
|
4096
4123
|
, (0, combinator_1.some)(term)), (0, combinator_1.some)(desc)]))), es => [(0, dom_1.html)('dl', fillTrailingDescription(es))]))));
|
|
4097
|
-
const term = (0, combinator_1.
|
|
4098
|
-
const desc = (0, combinator_1.
|
|
4124
|
+
const term = (0, combinator_1.creation)((0, combinator_1.line)((0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.open)(/^~[^\S\n]+(?=\S)/, (0, visibility_1.visualize)((0, visibility_1.trimBlank)((0, combinator_1.some)((0, combinator_1.union)([inline_1.indexer, inline_1.inline])))), true), ns => [(0, dom_1.html)('dt', (0, dom_1.defrag)(ns))]))));
|
|
4125
|
+
const desc = (0, combinator_1.creation)((0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)(/^:[^\S\n]+(?=\S)|/, (0, combinator_1.rewrite)((0, combinator_1.some)(source_1.anyline, /^[~:][^\S\n]+\S/), (0, visibility_1.visualize)((0, combinator_1.trimEnd)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('dd', (0, dom_1.defrag)(ns))]), false));
|
|
4099
4126
|
|
|
4100
4127
|
function fillTrailingDescription(es) {
|
|
4101
4128
|
return es.length > 0 && es[es.length - 1].tagName === 'DT' ? (0, array_1.push)(es, [(0, dom_1.html)('dd')]) : es;
|
|
@@ -4669,9 +4696,9 @@ const row = (0, combinator_1.lazy)(() => (0, combinator_1.dup)((0, combinator_1.
|
|
|
4669
4696
|
const alignment = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)/;
|
|
4670
4697
|
const align = (0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.union)([(0, source_1.str)(alignment)]), ([s]) => s.split('/').map(s => s.split(''))));
|
|
4671
4698
|
const delimiter = /^[-=<>]+(?:\/[-=^v]*)?(?=[^\S\n]*\n)|^[#:](?:(?!:\D|0)\d*:(?!0)\d*)?!*(?=\s)/;
|
|
4672
|
-
const head = (0, combinator_1.
|
|
4673
|
-
const data = (0, combinator_1.
|
|
4674
|
-
const dataline = (0, combinator_1.
|
|
4699
|
+
const head = (0, combinator_1.creation)((0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^#(?:(?!:\D|0)\d*:(?!0)\d*)?!*(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.trim)((0, visibility_1.visualize)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('th', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false));
|
|
4700
|
+
const data = (0, combinator_1.creation)((0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.open)((0, source_1.str)(/^:(?:(?!:\D|0)\d*:(?!0)\d*)?!*(?=\s)/), (0, combinator_1.rewrite)((0, combinator_1.inits)([source_1.anyline, (0, combinator_1.some)(source_1.contentline, delimiter)]), (0, combinator_1.trim)((0, visibility_1.visualize)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]))))), true), ns => [(0, dom_1.html)('td', attributes(ns.shift()), (0, dom_1.defrag)(ns))]), false));
|
|
4701
|
+
const dataline = (0, combinator_1.creation)((0, combinator_1.line)((0, combinator_1.rewrite)(source_1.contentline, (0, combinator_1.union)([(0, combinator_1.validate)(/^!+\s/, (0, combinator_1.convert)(source => `:${source}`, data)), (0, combinator_1.convert)(source => `: ${source}`, data)]))));
|
|
4675
4702
|
|
|
4676
4703
|
function attributes(source) {
|
|
4677
4704
|
let [, rowspan = global_1.undefined, colspan = global_1.undefined, highlight = global_1.undefined] = source.match(/^.(?:(\d+)?:(\d+)?)?(!+)?$/) ?? [];
|
|
@@ -4972,7 +4999,7 @@ const dom_1 = __webpack_require__(3252);
|
|
|
4972
4999
|
exports.ilist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^[-+*](?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.state)(2
|
|
4973
5000
|
/* State.media */
|
|
4974
5001
|
, exports.ilist_))));
|
|
4975
|
-
exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^[-+*](?:$|\s)/, (0, combinator_1.some)((0, combinator_1.
|
|
5002
|
+
exports.ilist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^[-+*](?:$|\s)/, (0, combinator_1.some)((0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/^[-+*](?:$|\s)/, (0, combinator_1.some)(inline_1.inline), true)), (0, combinator_1.indent)((0, combinator_1.union)([ulist_1.ulist_, olist_1.olist_, exports.ilist_]))]), olist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)((0, ulist_1.fillFirstLine)(ns)))])])))), es => [(0, dom_1.html)('ul', {
|
|
4976
5003
|
class: 'invalid',
|
|
4977
5004
|
'data-invalid-syntax': 'list',
|
|
4978
5005
|
'data-invalid-type': 'syntax',
|
|
@@ -5063,7 +5090,7 @@ exports.olist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combina
|
|
|
5063
5090
|
, exports.olist_))));
|
|
5064
5091
|
exports.olist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.match)(openers['.'], (0, memoize_1.memoize)(ms => list(type(ms[1]), '.'), ms => type(ms[1]).charCodeAt(0) || 0, [])), (0, combinator_1.match)(openers['('], (0, memoize_1.memoize)(ms => list(type(ms[1]), '('), ms => type(ms[1]).charCodeAt(0) || 0, []))])));
|
|
5065
5092
|
|
|
5066
|
-
const list = (type, form) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.
|
|
5093
|
+
const list = (type, form) => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)((0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(heads[form], (0, combinator_1.subsequence)([ulist_1.checkbox, (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)([ulist_1.ulist_, exports.olist_, ilist_1.ilist_]))]), exports.invalid), ns => [(0, dom_1.html)('li', {
|
|
5067
5094
|
'data-marker': ns[0] || global_1.undefined
|
|
5068
5095
|
}, (0, dom_1.defrag)((0, ulist_1.fillFirstLine)((0, array_1.shift)(ns)[1])))]), true)]))), es => [format((0, dom_1.html)('ol', es), type, form)]);
|
|
5069
5096
|
|
|
@@ -5248,7 +5275,7 @@ const source_1 = __webpack_require__(6743);
|
|
|
5248
5275
|
|
|
5249
5276
|
const dom_1 = __webpack_require__(3252);
|
|
5250
5277
|
|
|
5251
|
-
exports.cite = (0, combinator_1.
|
|
5278
|
+
exports.cite = (0, combinator_1.creation)((0, combinator_1.line)((0, combinator_1.fmap)((0, combinator_1.validate)('>>', (0, combinator_1.reverse)((0, combinator_1.tails)([(0, source_1.str)(/^>*(?=>>[^>\s]+[^\S\n]*(?:$|\n))/), (0, combinator_1.union)([anchor_1.anchor, // Subject page representation.
|
|
5252
5279
|
// リンクの実装は後で検討
|
|
5253
5280
|
(0, combinator_1.focus)(/^>>\.[^\S\n]*(?:$|\n)/, () => [[(0, dom_1.html)('a', {
|
|
5254
5281
|
class: 'anchor'
|
|
@@ -5286,7 +5313,7 @@ const autolink_1 = __webpack_require__(6578);
|
|
|
5286
5313
|
const dom_1 = __webpack_require__(3252);
|
|
5287
5314
|
|
|
5288
5315
|
exports.syntax = /^>+(?=[^\S\n])|^>(?=[^\s>])|^>+(?=[^\s>])(?![0-9a-z]+(?:-[0-9a-z]+)*(?![0-9A-Za-z@#:]))/;
|
|
5289
|
-
exports.quote = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
5316
|
+
exports.quote = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)('>', (0, combinator_1.union)([(0, combinator_1.rewrite)((0, combinator_1.some)((0, combinator_1.validate)(new RegExp(exports.syntax.source.split('|')[0]), source_1.anyline)), qblock), (0, combinator_1.rewrite)((0, combinator_1.validate)(new RegExp(exports.syntax.source.split('|').slice(1).join('|')), source_1.anyline), (0, combinator_1.line)((0, combinator_1.union)([(0, source_1.str)(/^.+/)])))])), ns => [(0, dom_1.html)('span', ns.length > 1 ? {
|
|
5290
5317
|
class: 'quote'
|
|
5291
5318
|
} : {
|
|
5292
5319
|
class: 'quote invalid',
|
|
@@ -5319,7 +5346,7 @@ const qblock = (source, context) => {
|
|
|
5319
5346
|
}
|
|
5320
5347
|
|
|
5321
5348
|
if (child.classList.contains('cite') || child.classList.contains('quote')) {
|
|
5322
|
-
context.resources && (context.resources.
|
|
5349
|
+
context.resources && (context.resources.clock -= child.childNodes.length);
|
|
5323
5350
|
nodes.splice(i, 1, ...child.childNodes);
|
|
5324
5351
|
--i;
|
|
5325
5352
|
continue;
|
|
@@ -5363,7 +5390,7 @@ const opener = /^(?=\|\|+(?:$|\s))/;
|
|
|
5363
5390
|
|
|
5364
5391
|
const unindent = source => source.replace(/(^|\n)\|(?:[^\S\n]|(?=\|*(?:$|\s)))|\n$/g, '$1');
|
|
5365
5392
|
|
|
5366
|
-
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.
|
|
5393
|
+
const source = (0, combinator_1.lazy)(() => (0, combinator_1.fmap)((0, combinator_1.some)((0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.focus)(/^(?:\|\|+(?:[^\S\n][^\n]*)?(?:$|\n))+/, (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)((0, combinator_1.some)(autolink_1.autolink), ns => [(0, dom_1.html)('pre', (0, dom_1.defrag)(ns))])))]))), ns => [(0, dom_1.html)('blockquote', ns)]));
|
|
5367
5394
|
|
|
5368
5395
|
/***/ }),
|
|
5369
5396
|
|
|
@@ -5394,17 +5421,17 @@ const array_1 = __webpack_require__(8112);
|
|
|
5394
5421
|
|
|
5395
5422
|
exports.table = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^\|[^\n]*(?:\n\|[^\n]*){2}/, (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 => [(0, dom_1.html)('table', [(0, dom_1.html)('thead', [rows.shift()]), (0, dom_1.html)('tbody', format(rows))])])));
|
|
5396
5423
|
|
|
5397
|
-
const row = (parser, optional) => (0, combinator_1.
|
|
5424
|
+
const row = (parser, optional) => (0, combinator_1.creation)((0, combinator_1.fallback)((0, combinator_1.fmap)((0, combinator_1.line)((0, combinator_1.surround)(/^(?=\|)/, (0, combinator_1.some)((0, combinator_1.union)([parser])), /^[|\\]?\s*$/, optional)), es => [(0, dom_1.html)('tr', es)]), (0, combinator_1.rewrite)(source_1.contentline, source => [[(0, dom_1.html)('tr', {
|
|
5398
5425
|
class: 'invalid',
|
|
5399
5426
|
'data-invalid-syntax': 'table-row',
|
|
5400
5427
|
'data-invalid-type': 'syntax',
|
|
5401
5428
|
'data-invalid-message': 'Missing the start symbol of the table row'
|
|
5402
5429
|
}, [(0, dom_1.html)('td', source.replace('\n', ''))])], ''])));
|
|
5403
5430
|
|
|
5404
|
-
const align = (0, combinator_1.
|
|
5431
|
+
const align = (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.open)('|', (0, combinator_1.union)([(0, combinator_1.focus)(/^:-+:/, () => [['center'], '']), (0, combinator_1.focus)(/^:-+/, () => [['start'], '']), (0, combinator_1.focus)(/^-+:/, () => [['end'], '']), (0, combinator_1.focus)(/^-+/, () => [[''], ''])])), ns => [(0, dom_1.html)('td', (0, dom_1.defrag)(ns))]));
|
|
5405
5432
|
const cell = (0, combinator_1.surround)(/^\|\s*(?=\S)/, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), /^\|/, [[/^[|\\]?\s*$/, 9]]), /^[^|]*/, true);
|
|
5406
|
-
const head = (0, combinator_1.
|
|
5407
|
-
const data = (0, combinator_1.
|
|
5433
|
+
const head = (0, combinator_1.creation)((0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('th', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))]));
|
|
5434
|
+
const data = (0, combinator_1.creation)((0, combinator_1.fmap)(cell, ns => [(0, dom_1.html)('td', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))]));
|
|
5408
5435
|
|
|
5409
5436
|
function format(rows) {
|
|
5410
5437
|
const aligns = rows[0].classList.contains('invalid') ? [] : (0, duff_1.duffReduce)(rows.shift().children, (acc, el) => (0, array_1.push)(acc, [el.textContent]), []);
|
|
@@ -5453,10 +5480,10 @@ const array_1 = __webpack_require__(8112);
|
|
|
5453
5480
|
exports.ulist = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.validate)(/^-(?=[^\S\n]|\n[^\S\n]*\S)/, (0, combinator_1.state)(2
|
|
5454
5481
|
/* State.media */
|
|
5455
5482
|
, exports.ulist_))));
|
|
5456
|
-
exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^-(?=$|\s)/, (0, combinator_1.some)((0, combinator_1.
|
|
5457
|
-
exports.checkbox = (0, combinator_1.focus)(/^\[[xX ]\](?=$|\s)/, source => [[(0, dom_1.html)('span', {
|
|
5483
|
+
exports.ulist_ = (0, combinator_1.lazy)(() => (0, combinator_1.block)((0, combinator_1.fmap)((0, combinator_1.validate)(/^-(?=$|\s)/, (0, combinator_1.some)((0, combinator_1.creation)((0, combinator_1.union)([(0, inline_1.indexee)((0, combinator_1.fmap)((0, combinator_1.fallback)((0, combinator_1.inits)([(0, combinator_1.line)((0, combinator_1.open)(/^-(?:$|\s)/, (0, combinator_1.subsequence)([exports.checkbox, (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_]))]), olist_1.invalid), ns => [(0, dom_1.html)('li', (0, dom_1.defrag)(fillFirstLine(ns)))]), true)])))), es => [format((0, dom_1.html)('ul', es))])));
|
|
5484
|
+
exports.checkbox = (0, combinator_1.creation)((0, combinator_1.focus)(/^\[[xX ]\](?=$|\s)/, source => [[(0, dom_1.html)('span', {
|
|
5458
5485
|
class: 'checkbox'
|
|
5459
|
-
}, source[1].trimStart() ? '☑' : '☐')], '']);
|
|
5486
|
+
}, source[1].trimStart() ? '☑' : '☐')], '']));
|
|
5460
5487
|
|
|
5461
5488
|
function fillFirstLine(ns) {
|
|
5462
5489
|
return ns.length === 1 && typeof ns[0] === 'object' && ['UL', 'OL'].includes(ns[0].tagName) ? (0, array_1.unshift)([(0, dom_1.html)('br')], ns) : ns;
|
|
@@ -5668,19 +5695,19 @@ const visibility_1 = __webpack_require__(7618);
|
|
|
5668
5695
|
|
|
5669
5696
|
const dom_1 = __webpack_require__(3252);
|
|
5670
5697
|
|
|
5671
|
-
exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
5672
|
-
/* Rule.annotation */
|
|
5673
|
-
, 6, (0, combinator_1.surround)('((', (0, combinator_1.guard)(context => ~context.state & 64
|
|
5698
|
+
exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('((', (0, combinator_1.constraint)(64
|
|
5674
5699
|
/* State.annotation */
|
|
5675
|
-
, (0, combinator_1.
|
|
5700
|
+
, false, (0, combinator_1.syntax)(32
|
|
5701
|
+
/* Syntax.annotation */
|
|
5702
|
+
, 6, 1, (0, combinator_1.state)(64
|
|
5676
5703
|
/* State.annotation */
|
|
5677
5704
|
| 2
|
|
5678
5705
|
/* State.media */
|
|
5679
5706
|
, (0, visibility_1.startLoose)((0, combinator_1.context)({
|
|
5680
5707
|
delimiters: global_1.undefined
|
|
5681
|
-
}, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[/^\\?\n/, 9], [')', 2], ['))', 6]])), ')'))), '))', false, ([, ns], rest) => [[(0, dom_1.html)('sup', {
|
|
5708
|
+
}, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[/^\\?\n/, 9], [')', 2], ['))', 6]])), ')')))), '))', false, ([, ns], rest) => [[(0, dom_1.html)('sup', {
|
|
5682
5709
|
class: 'annotation'
|
|
5683
|
-
}, [(0, dom_1.html)('span', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))])], rest], ([, ns, rest], next) => next[0] === ')' ? global_1.undefined : (0, link_1.optimize)('((', ns, rest, next)))
|
|
5710
|
+
}, [(0, dom_1.html)('span', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))])], rest], ([, ns, rest], next) => next[0] === ')' ? global_1.undefined : (0, link_1.optimize)('((', ns, rest, next)));
|
|
5684
5711
|
|
|
5685
5712
|
/***/ }),
|
|
5686
5713
|
|
|
@@ -5715,12 +5742,12 @@ const source_1 = __webpack_require__(6743);
|
|
|
5715
5742
|
|
|
5716
5743
|
const util_1 = __webpack_require__(9437);
|
|
5717
5744
|
|
|
5718
|
-
exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]|\S
|
|
5745
|
+
exports.autolink = (0, combinator_1.fmap)((0, combinator_1.validate)(/^(?:[@#>0-9A-Za-z]|\S[#>])/, (0, combinator_1.constraint)(1
|
|
5719
5746
|
/* State.autolink */
|
|
5720
|
-
, (0, combinator_1.syntax)(2
|
|
5721
|
-
/*
|
|
5722
|
-
, 1, (0, combinator_1.some)((0, combinator_1.union)([url_1.url, email_1.email, // Escape unmatched email-like strings.
|
|
5723
|
-
(0, source_1.str)(/^[0-9A-Za-z]+(?:[.+_-][0-9A-Za-z]+)*(?:@(?:[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?)
|
|
5747
|
+
, false, (0, combinator_1.syntax)(2
|
|
5748
|
+
/* Syntax.autolink */
|
|
5749
|
+
, 1, 1, (0, combinator_1.some)((0, combinator_1.union)([url_1.url, email_1.email, // Escape unmatched email-like strings.
|
|
5750
|
+
(0, source_1.str)(/^[0-9A-Za-z]+(?:[.+_-][0-9A-Za-z]+)*(?:@(?:[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?)*/), channel_1.channel, account_1.account, // Escape unmatched account-like strings.
|
|
5724
5751
|
(0, source_1.str)(/^@+[0-9A-Za-z]*(?:-[0-9A-Za-z]+)*/), // Escape invalid leading characters.
|
|
5725
5752
|
(0, source_1.str)(new RegExp(/^(?:[^\p{C}\p{S}\p{P}\s]|emoji|['_])(?=#)/u.source.replace('emoji', hashtag_1.emoji), 'u')), hashtag_1.hashtag, hashnum_1.hashnum, // Escape unmatched hashtag-like strings.
|
|
5726
5753
|
(0, source_1.str)(new RegExp(/^#+(?:[^\p{C}\p{S}\p{P}\s]|emoji|['_])*/u.source.replace('emoji', hashtag_1.emoji), 'u')), anchor_1.anchor]))))), ns => ns.length === 1 ? ns : [(0, util_1.stringify)(ns)]);
|
|
@@ -5835,7 +5862,7 @@ const source_1 = __webpack_require__(6743);
|
|
|
5835
5862
|
const dom_1 = __webpack_require__(3252); // https://html.spec.whatwg.org/multipage/input.html
|
|
5836
5863
|
|
|
5837
5864
|
|
|
5838
|
-
exports.email = (0, combinator_1.
|
|
5865
|
+
exports.email = (0, combinator_1.creation)((0, combinator_1.rewrite)((0, combinator_1.verify)((0, source_1.str)(/^[0-9A-Za-z]+(?:[.+_-][0-9A-Za-z]+)*@[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-(?=\w)){0,61}[0-9A-Za-z])?)*(?![0-9A-Za-z])/), ([source]) => source.indexOf('@') <= 64 && source.length <= 255), source => [[(0, dom_1.html)('a', {
|
|
5839
5866
|
class: 'email',
|
|
5840
5867
|
href: `mailto:${source}`
|
|
5841
5868
|
}, source)], '']));
|
|
@@ -5917,7 +5944,7 @@ const source_1 = __webpack_require__(6743);
|
|
|
5917
5944
|
|
|
5918
5945
|
const closer = /^[-+*=~^,.;:!?]*(?=[\\"`|\[\](){}<>]|$)/;
|
|
5919
5946
|
exports.url = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['http://', 'https://'], (0, combinator_1.rewrite)((0, combinator_1.open)(/^https?:\/\/(?=[\x21-\x7E])/, (0, combinator_1.focus)(/^[\x21-\x7E]+/, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.unescsource, closer)])))), (0, combinator_1.convert)(url => `{ ${url} }`, (0, combinator_1.union)([link_1.textlink])))));
|
|
5920
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
5947
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.precedence)(2, (0, combinator_1.union)([(0, combinator_1.surround)('(', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')'), ')', true), (0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']'), ']', true), (0, combinator_1.surround)('{', (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}'), '}', true), (0, combinator_1.surround)('"', (0, combinator_1.precedence)(8, (0, combinator_1.some)(source_1.unescsource, '"')), '"', true)]))));
|
|
5921
5948
|
|
|
5922
5949
|
/***/ }),
|
|
5923
5950
|
|
|
@@ -5946,25 +5973,25 @@ const array_1 = __webpack_require__(8112);
|
|
|
5946
5973
|
|
|
5947
5974
|
const index = /^[0-9A-Za-z]+(?:(?:[.-]|, )[0-9A-Za-z]+)*/;
|
|
5948
5975
|
exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.syntax)(0
|
|
5949
|
-
/*
|
|
5950
|
-
, 2, (0, source_1.str)(index)), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.syntax)(128
|
|
5951
|
-
/*
|
|
5952
|
-
, 2, (0, combinator_1.some)(inline_1.inline, ')', [[')', 2]])), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
5976
|
+
/* Syntax.none */
|
|
5977
|
+
, 2, 1, (0, source_1.str)(index)), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.syntax)(128
|
|
5978
|
+
/* Syntax.bracket */
|
|
5979
|
+
, 2, 1, (0, combinator_1.some)(inline_1.inline, ')', [[')', 2]])), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
5953
5980
|
class: 'paren'
|
|
5954
5981
|
}, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)([''], (0, array_1.unshift)(as, bs)), rest]), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.syntax)(0
|
|
5955
|
-
/*
|
|
5956
|
-
, 2, (0, source_1.str)(new RegExp(index.source.replace(', ', '[,、]').replace(/[09AZaz.]|\-(?!\w)/g, c => c.trimStart() && String.fromCharCode(c.charCodeAt(0) + 0xFEE0))))), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.syntax)(128
|
|
5957
|
-
/*
|
|
5958
|
-
, 2, (0, combinator_1.some)(inline_1.inline, ')', [[')', 2]])), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
5982
|
+
/* Syntax.none */
|
|
5983
|
+
, 2, 1, (0, source_1.str)(new RegExp(index.source.replace(', ', '[,、]').replace(/[09AZaz.]|\-(?!\w)/g, c => c.trimStart() && String.fromCharCode(c.charCodeAt(0) + 0xFEE0))))), (0, source_1.str)(')')), (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.syntax)(128
|
|
5984
|
+
/* Syntax.bracket */
|
|
5985
|
+
, 2, 1, (0, combinator_1.some)(inline_1.inline, ')', [[')', 2]])), (0, source_1.str)(')'), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
5959
5986
|
class: 'paren'
|
|
5960
5987
|
}, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.syntax)(128
|
|
5961
|
-
/*
|
|
5962
|
-
, 2, (0, combinator_1.some)(inline_1.inline, ']', [[']', 2]])), (0, source_1.str)(']'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)([''], (0, array_1.unshift)(as, bs)), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.syntax)(128
|
|
5963
|
-
/*
|
|
5964
|
-
, 2, (0, combinator_1.some)(inline_1.inline, '}', [['}', 2]])), (0, source_1.str)('}'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), // Control media blinking in editing rather than control confusion of pairs of quote marks.
|
|
5988
|
+
/* Syntax.bracket */
|
|
5989
|
+
, 2, 1, (0, combinator_1.some)(inline_1.inline, ']', [[']', 2]])), (0, source_1.str)(']'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)([''], (0, array_1.unshift)(as, bs)), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.syntax)(128
|
|
5990
|
+
/* Syntax.bracket */
|
|
5991
|
+
, 2, 1, (0, combinator_1.some)(inline_1.inline, '}', [['}', 2]])), (0, source_1.str)('}'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), // Control media blinking in editing rather than control confusion of pairs of quote marks.
|
|
5965
5992
|
(0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.syntax)(1
|
|
5966
|
-
/*
|
|
5967
|
-
, 8, (0, combinator_1.some)(inline_1.inline, '"', [['"', 8]])), (0, source_1.str)('"'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest])]));
|
|
5993
|
+
/* Syntax.quote */
|
|
5994
|
+
, 8, 1, (0, combinator_1.some)(inline_1.inline, '"', [['"', 8]])), (0, source_1.str)('"'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest])]));
|
|
5968
5995
|
|
|
5969
5996
|
/***/ }),
|
|
5970
5997
|
|
|
@@ -5983,7 +6010,7 @@ const combinator_1 = __webpack_require__(2087);
|
|
|
5983
6010
|
|
|
5984
6011
|
const dom_1 = __webpack_require__(3252);
|
|
5985
6012
|
|
|
5986
|
-
exports.code = (0, combinator_1.
|
|
6013
|
+
exports.code = (0, combinator_1.creation)((0, combinator_1.validate)('`', (0, combinator_1.match)(/^(`+)(?!`)([^\n]*?[^`\n])\1(?!`)/, ([whole,, body]) => rest => [[(0, dom_1.html)('code', {
|
|
5987
6014
|
'data-src': whole
|
|
5988
6015
|
}, format(body))], rest.slice(whole.length)])));
|
|
5989
6016
|
|
|
@@ -6017,8 +6044,8 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
6017
6044
|
const array_1 = __webpack_require__(8112);
|
|
6018
6045
|
|
|
6019
6046
|
exports.comment = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[%', (0, combinator_1.syntax)(0
|
|
6020
|
-
/*
|
|
6021
|
-
, 4, (0, combinator_1.match)(/^\[(%+)\s/, (0, memoize_1.memoize)(([, fence]) => (0, combinator_1.surround)((0, combinator_1.open)((0, source_1.str)(`[${fence}`), (0, combinator_1.some)(source_1.text, new RegExp(String.raw`^\s+${fence}\]|^\S`)), true), (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), new RegExp(String.raw`^\s+${fence}\]`), [[new RegExp(String.raw`^\s+${fence}\]`), 4]]), (0, combinator_1.close)((0, combinator_1.some)(source_1.text, /^\S/), (0, source_1.str)(`${fence}]`)), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
6047
|
+
/* Syntax.none */
|
|
6048
|
+
, 4, 1, (0, combinator_1.match)(/^\[(%+)\s/, (0, memoize_1.memoize)(([, fence]) => (0, combinator_1.surround)((0, combinator_1.open)((0, source_1.str)(`[${fence}`), (0, combinator_1.some)(source_1.text, new RegExp(String.raw`^\s+${fence}\]|^\S`)), true), (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), new RegExp(String.raw`^\s+${fence}\]`), [[new RegExp(String.raw`^\s+${fence}\]`), 4]]), (0, combinator_1.close)((0, combinator_1.some)(source_1.text, /^\S/), (0, source_1.str)(`${fence}]`)), true, ([as, bs = [], cs], rest) => [[(0, dom_1.html)('span', {
|
|
6022
6049
|
class: 'comment'
|
|
6023
6050
|
}, [(0, dom_1.html)('input', {
|
|
6024
6051
|
type: 'checkbox'
|
|
@@ -6049,9 +6076,9 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6049
6076
|
|
|
6050
6077
|
const array_1 = __webpack_require__(8112);
|
|
6051
6078
|
|
|
6052
|
-
exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.syntax)(0
|
|
6053
|
-
/*
|
|
6054
|
-
, 1,
|
|
6079
|
+
exports.deletion = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('~~'), (0, combinator_1.syntax)(0
|
|
6080
|
+
/* Syntax.none */
|
|
6081
|
+
, 1, 1, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '~~')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '~'), true)]))), (0, source_1.str)('~~'), false, ([, bs], rest) => [[(0, dom_1.html)('del', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
|
|
6055
6082
|
|
|
6056
6083
|
/***/ }),
|
|
6057
6084
|
|
|
@@ -6082,9 +6109,9 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6082
6109
|
|
|
6083
6110
|
const array_1 = __webpack_require__(8112);
|
|
6084
6111
|
|
|
6085
|
-
exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.syntax)(0
|
|
6086
|
-
/*
|
|
6087
|
-
, 1,
|
|
6112
|
+
exports.emphasis = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('*'), (0, combinator_1.syntax)(0
|
|
6113
|
+
/* Syntax.none */
|
|
6114
|
+
, 1, 1, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([emstrong_1.emstrong, strong_1.strong, exports.emphasis]))])), '*')), (0, source_1.str)('*'), false, ([, bs], rest) => [[(0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
|
|
6088
6115
|
|
|
6089
6116
|
/***/ }),
|
|
6090
6117
|
|
|
@@ -6117,9 +6144,9 @@ const array_1 = __webpack_require__(8112);
|
|
|
6117
6144
|
|
|
6118
6145
|
const substrong = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('**')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([exports.emstrong, strong_1.strong]))])));
|
|
6119
6146
|
const subemphasis = (0, combinator_1.lazy)(() => (0, combinator_1.some)((0, combinator_1.union)([strong_1.strong, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([exports.emstrong, strong_1.strong, emphasis_1.emphasis]))])));
|
|
6120
|
-
exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.syntax)(0
|
|
6121
|
-
/*
|
|
6122
|
-
, 1,
|
|
6147
|
+
exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('***'), (0, combinator_1.syntax)(0
|
|
6148
|
+
/* Syntax.none */
|
|
6149
|
+
, 1, 1, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('*')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), inline_1.inline)])))), (0, source_1.str)(/^\*{1,3}/), false, ([, bs, cs], rest, context) => {
|
|
6123
6150
|
switch (cs[0]) {
|
|
6124
6151
|
case '***':
|
|
6125
6152
|
return [[(0, dom_1.html)('em', [(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))])], rest];
|
|
@@ -6130,7 +6157,7 @@ exports.emstrong = (0, combinator_1.lazy)(() => (0, combinator_1.syntax)(0
|
|
|
6130
6157
|
case '*':
|
|
6131
6158
|
return (0, combinator_1.bind)(substrong, (ds, rest) => rest.slice(0, 2) === '**' ? [[(0, dom_1.html)('strong', (0, array_1.unshift)([(0, dom_1.html)('em', (0, dom_1.defrag)(bs))], (0, dom_1.defrag)(ds)))], rest.slice(2)] : [(0, array_1.unshift)(['**', (0, dom_1.html)('em', (0, dom_1.defrag)(bs))], ds), rest])(rest, context) ?? [['**', (0, dom_1.html)('em', (0, dom_1.defrag)(bs))], rest];
|
|
6132
6159
|
}
|
|
6133
|
-
}, ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]))
|
|
6160
|
+
}, ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
|
|
6134
6161
|
|
|
6135
6162
|
/***/ }),
|
|
6136
6163
|
|
|
@@ -6220,11 +6247,11 @@ const visibility_1 = __webpack_require__(7618);
|
|
|
6220
6247
|
|
|
6221
6248
|
const dom_1 = __webpack_require__(3252);
|
|
6222
6249
|
|
|
6223
|
-
exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[#', (0, combinator_1.
|
|
6224
|
-
/* Rule.index */
|
|
6225
|
-
, 2, (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)('[#', (0, combinator_1.guard)(context => ~context.state & 16
|
|
6250
|
+
exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[#', (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)('[#', (0, combinator_1.constraint)(16
|
|
6226
6251
|
/* State.index */
|
|
6227
|
-
, (0, combinator_1.
|
|
6252
|
+
, false, (0, combinator_1.syntax)(1024
|
|
6253
|
+
/* Syntax.index */
|
|
6254
|
+
, 2, 1, (0, combinator_1.state)(64
|
|
6228
6255
|
/* State.annotation */
|
|
6229
6256
|
| 32
|
|
6230
6257
|
/* State.reference */
|
|
@@ -6238,16 +6265,16 @@ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[#', (0
|
|
|
6238
6265
|
/* State.media */
|
|
6239
6266
|
| 1
|
|
6240
6267
|
/* State.autolink */
|
|
6241
|
-
, (0, visibility_1.startTight)((0, combinator_1.open)((0, source_1.stropt)(/^\|?/), (0, visibility_1.trimBlankEnd)((0, combinator_1.some)((0, combinator_1.union)([signature, inline_1.inline]), ']', [[/^\\?\n/, 9], [']', 2]])), true)))), ']', false, ([, ns], rest) => [[(0, dom_1.html)('a', (0, dom_1.defrag)(ns))], rest])), ([el]) => [(0, dom_1.define)(el, {
|
|
6268
|
+
, (0, visibility_1.startTight)((0, combinator_1.open)((0, source_1.stropt)(/^\|?/), (0, visibility_1.trimBlankEnd)((0, combinator_1.some)((0, combinator_1.union)([signature, inline_1.inline]), ']', [[/^\\?\n/, 9], [']', 2]])), true))))), ']', false, ([, ns], rest) => [[(0, dom_1.html)('a', (0, dom_1.defrag)(ns))], rest])), ([el]) => [(0, dom_1.define)(el, {
|
|
6242
6269
|
id: el.id ? null : global_1.undefined,
|
|
6243
6270
|
class: 'index',
|
|
6244
6271
|
href: el.id ? `#${el.id}` : global_1.undefined
|
|
6245
|
-
}, el.childNodes)])))
|
|
6246
|
-
const signature = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6272
|
+
}, el.childNodes)])));
|
|
6273
|
+
const signature = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.open)('|#', (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ']'))), ns => [(0, dom_1.html)('span', {
|
|
6247
6274
|
class: 'indexer',
|
|
6248
6275
|
'data-index': (0, indexee_1.identity)(ns.join('')).slice(6)
|
|
6249
6276
|
})])));
|
|
6250
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6277
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(8, (0, combinator_1.some)(source_1.txt, '"')), (0, source_1.str)('"'), true)])));
|
|
6251
6278
|
|
|
6252
6279
|
/***/ }),
|
|
6253
6280
|
|
|
@@ -6348,7 +6375,7 @@ const index_1 = __webpack_require__(4479);
|
|
|
6348
6375
|
|
|
6349
6376
|
const dom_1 = __webpack_require__(3252);
|
|
6350
6377
|
|
|
6351
|
-
exports.indexer = (0, combinator_1.
|
|
6378
|
+
exports.indexer = (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.surround)(/^\s+(?=\[#\S)/, (0, combinator_1.state)(16
|
|
6352
6379
|
/* State.index */
|
|
6353
6380
|
, false, (0, combinator_1.union)([(0, combinator_1.focus)('[#]', () => [[(0, dom_1.html)('a', {
|
|
6354
6381
|
href: '#'
|
|
@@ -6381,9 +6408,9 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6381
6408
|
|
|
6382
6409
|
const body = (0, source_1.str)(/^\$[A-Za-z]*(?:(?:-[A-Za-z][0-9A-Za-z]*)+|-(?:(?:0|[1-9][0-9]*)\.)*(?:0|[1-9][0-9]*)(?![0-9A-Za-z]))/);
|
|
6383
6410
|
exports.segment = (0, combinator_1.clear)((0, combinator_1.validate)(['[$', '$'], (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])));
|
|
6384
|
-
exports.label = (0, combinator_1.validate)(['[$', '$'], (0, combinator_1.
|
|
6411
|
+
exports.label = (0, combinator_1.validate)(['[$', '$'], (0, combinator_1.creation)((0, combinator_1.fmap)((0, combinator_1.constraint)(8
|
|
6385
6412
|
/* State.label */
|
|
6386
|
-
, (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])), ([text]) => [(0, dom_1.html)('a', {
|
|
6413
|
+
, false, (0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body])), ([text]) => [(0, dom_1.html)('a', {
|
|
6387
6414
|
class: 'label',
|
|
6388
6415
|
'data-label': text.slice(text[1] === '-' ? 0 : 1).toLowerCase()
|
|
6389
6416
|
}, text)])));
|
|
@@ -6439,14 +6466,14 @@ const array_1 = __webpack_require__(8112); // Don't use the symbols already used
|
|
|
6439
6466
|
// All syntax surrounded by square brackets shouldn't contain line breaks.
|
|
6440
6467
|
|
|
6441
6468
|
|
|
6442
|
-
exports.placeholder = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[:', '[^'], (0, combinator_1.syntax)(0
|
|
6443
|
-
/*
|
|
6444
|
-
, 2,
|
|
6469
|
+
exports.placeholder = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[:', '[^'], (0, combinator_1.surround)((0, source_1.str)(/^\[[:^]/), (0, combinator_1.syntax)(0
|
|
6470
|
+
/* Syntax.none */
|
|
6471
|
+
, 2, 1, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[/^\\?\n/, 9], [']', 2]]))), (0, source_1.str)(']'), false, ([as, bs], rest) => [[(0, dom_1.html)('span', {
|
|
6445
6472
|
class: 'invalid',
|
|
6446
6473
|
'data-invalid-syntax': 'extension',
|
|
6447
6474
|
'data-invalid-type': 'syntax',
|
|
6448
6475
|
'data-invalid-message': `Reserved start symbol "${as[0][1]}" cannot be used in "[]"`
|
|
6449
|
-
}, (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])))
|
|
6476
|
+
}, (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest])));
|
|
6450
6477
|
|
|
6451
6478
|
/***/ }),
|
|
6452
6479
|
|
|
@@ -6488,8 +6515,8 @@ const attrspecs = {
|
|
|
6488
6515
|
global_1.Object.setPrototypeOf(attrspecs, null);
|
|
6489
6516
|
global_1.Object.values(attrspecs).forEach(o => global_1.Object.setPrototypeOf(o, null));
|
|
6490
6517
|
exports.html = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('<', (0, combinator_1.validate)(/^<[a-z]+(?=[^\S\n]|>)/, (0, combinator_1.syntax)(0
|
|
6491
|
-
/*
|
|
6492
|
-
, 5, (0, combinator_1.union)([(0, combinator_1.focus)(
|
|
6518
|
+
/* Syntax.none */
|
|
6519
|
+
, 5, 1, (0, combinator_1.union)([(0, combinator_1.focus)(/^<wbr[^\S\n]*>/, () => [[(0, dom_1.html)('wbr')], '']), (0, combinator_1.focus)( // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
|
|
6493
6520
|
/^<(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)(?=[^\S\n]|>)/, source => [[source], '']), (0, combinator_1.match)(new RegExp(String.raw`^<(${TAGS.join('|')})(?=[^\S\n]|>)`), (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${tag}`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^[^\S\n]*>/), true), (0, combinator_1.subsequence)([(0, combinator_1.focus)(/^[^\S\n]*\n/, (0, combinator_1.some)(inline_1.inline)), (0, combinator_1.some)((0, combinator_1.open)(/^\n?/, (0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', `</${tag}>`), [[(0, visibility_1.blankWith)('\n', `</${tag}>`), 5]]), true))]), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], rest) => [[elem(tag, as, bs, cs)], rest], ([as, bs = []], rest) => [[elem(tag, as, bs, [])], rest]), ([, tag]) => TAGS.indexOf(tag), [])), (0, combinator_1.match)(/^<([a-z]+)(?=[^\S\n]|>)/, (0, memoize_1.memoize)(([, tag]) => (0, combinator_1.surround)((0, combinator_1.surround)((0, source_1.str)(`<${tag}`), (0, combinator_1.some)(exports.attribute), (0, source_1.str)(/^[^\S\n]*>/), true), (0, combinator_1.subsequence)([(0, combinator_1.focus)(/^[^\S\n]*\n/, (0, combinator_1.some)(inline_1.inline)), (0, combinator_1.some)(inline_1.inline, `</${tag}>`, [[`</${tag}>`, 5]])]), (0, source_1.str)(`</${tag}>`), true, ([as, bs = [], cs], rest) => [[elem(tag, as, bs, cs)], rest], ([as, bs = []], rest) => [[elem(tag, as, bs, [])], rest]), ([, tag]) => tag, new cache_1.Cache(10000)))])))));
|
|
6494
6521
|
exports.attribute = (0, combinator_1.union)([(0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|>)/)]); // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
|
|
6495
6522
|
// [...document.querySelectorAll('tbody > tr > td:first-child')].map(el => el.textContent.slice(1, -1))
|
|
@@ -6565,7 +6592,7 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6565
6592
|
|
|
6566
6593
|
const memoize_1 = __webpack_require__(1808);
|
|
6567
6594
|
|
|
6568
|
-
exports.unsafehtmlentity = (0, combinator_1.
|
|
6595
|
+
exports.unsafehtmlentity = (0, combinator_1.creation)((0, combinator_1.validate)('&', (0, combinator_1.focus)(/^&[0-9A-Za-z]+;/, entity => [[parse(entity) ?? `\x1B${entity}`], ''])));
|
|
6569
6596
|
exports.htmlentity = (0, combinator_1.fmap)((0, combinator_1.union)([exports.unsafehtmlentity]), ([test]) => [test[0] === '\x1B' ? (0, dom_1.html)('span', {
|
|
6570
6597
|
class: 'invalid',
|
|
6571
6598
|
'data-invalid-syntax': 'htmlentity',
|
|
@@ -6604,9 +6631,9 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6604
6631
|
|
|
6605
6632
|
const array_1 = __webpack_require__(8112);
|
|
6606
6633
|
|
|
6607
|
-
exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.syntax)(0
|
|
6608
|
-
/*
|
|
6609
|
-
, 1,
|
|
6634
|
+
exports.insertion = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('++'), (0, combinator_1.syntax)(0
|
|
6635
|
+
/* Syntax.none */
|
|
6636
|
+
, 1, 1, (0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('\n', '++')), (0, combinator_1.open)('\n', (0, combinator_1.some)(inline_1.inline, '+'), true)]))), (0, source_1.str)('++'), false, ([, bs], rest) => [[(0, dom_1.html)('ins', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
|
|
6610
6637
|
|
|
6611
6638
|
/***/ }),
|
|
6612
6639
|
|
|
@@ -6647,11 +6674,11 @@ const optspec = {
|
|
|
6647
6674
|
rel: ['nofollow']
|
|
6648
6675
|
};
|
|
6649
6676
|
Object.setPrototypeOf(optspec, null);
|
|
6650
|
-
exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'], (0, combinator_1.
|
|
6651
|
-
/* Rule.link */
|
|
6652
|
-
, 2, 10, (0, combinator_1.bind)((0, combinator_1.guard)(context => ~context.state & 4
|
|
6677
|
+
exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'], (0, combinator_1.bind)((0, combinator_1.constraint)(4
|
|
6653
6678
|
/* State.link */
|
|
6654
|
-
,
|
|
6679
|
+
, false, (0, combinator_1.syntax)(256
|
|
6680
|
+
/* Syntax.link */
|
|
6681
|
+
, 2, 10, (0, combinator_1.fmap)((0, combinator_1.subsequence)([(0, combinator_1.state)(4
|
|
6655
6682
|
/* State.link */
|
|
6656
6683
|
, (0, combinator_1.dup)((0, combinator_1.union)([(0, combinator_1.surround)('[', inline_1.media, ']'), (0, combinator_1.surround)('[', inline_1.shortmedia, ']'), (0, combinator_1.surround)('[', (0, combinator_1.state)(64
|
|
6657
6684
|
/* State.annotation */
|
|
@@ -6665,7 +6692,7 @@ exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'
|
|
|
6665
6692
|
/* State.media */
|
|
6666
6693
|
| 1
|
|
6667
6694
|
/* State.autolink */
|
|
6668
|
-
, (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2]])), ']', true, global_1.undefined, ([, ns = [], rest], next) => next[0] === ']' ? global_1.undefined : optimize('[', ns, rest, next))]))), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))], nodes => nodes[0][0] !== ''), ([as, bs = []]) => bs[0] === '\r' && bs.shift() ? [as, bs] : as[0] === '\r' && as.shift() ? [[], as] : [as, []])), ([content, params], rest, context) => {
|
|
6695
|
+
, (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2]])), ']', true, global_1.undefined, ([, ns = [], rest], next) => next[0] === ']' ? global_1.undefined : optimize('[', ns, rest, next))]))), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))], nodes => nodes[0][0] !== ''), ([as, bs = []]) => bs[0] === '\r' && bs.shift() ? [as, bs] : as[0] === '\r' && as.shift() ? [[], as] : [as, []]))), ([content, params], rest, context) => {
|
|
6669
6696
|
if (content[0] === '') return [content, rest];
|
|
6670
6697
|
if (params.length === 0) return;
|
|
6671
6698
|
if (content.length !== 0 && (0, visibility_1.trimNode)(content).length === 0) return;
|
|
@@ -6680,16 +6707,14 @@ exports.link = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'
|
|
|
6680
6707
|
const el = elem(INSECURE_URI, (0, dom_1.defrag)(content), new url_1.ReadonlyURL(resolve(INSECURE_URI, context.host ?? global_1.location, context.url ?? context.host ?? global_1.location), context.host?.href || global_1.location.href), context.host?.origin || global_1.location.origin);
|
|
6681
6708
|
if (el.classList.contains('invalid')) return [[el], rest];
|
|
6682
6709
|
return [[(0, dom_1.define)(el, (0, html_1.attributes)('link', [], optspec, params))], rest];
|
|
6683
|
-
})))
|
|
6684
|
-
exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'], (0, combinator_1.
|
|
6685
|
-
/* Rule.link */
|
|
6686
|
-
, 2, 10, (0, combinator_1.bind)((0, combinator_1.reverse)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([source_1.unescsource]), ']'), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))])), ([params, content = []], rest, context) => {
|
|
6710
|
+
})));
|
|
6711
|
+
exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['[', '{'], (0, combinator_1.bind)((0, combinator_1.creation)(10, (0, combinator_1.precedence)(2, (0, combinator_1.reverse)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([source_1.unescsource]), ']'), ']')), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), /^[^\S\n]*}/))])))), ([params, content = []], rest, context) => {
|
|
6687
6712
|
params.shift();
|
|
6688
6713
|
(0, visibility_1.trimNode)(content);
|
|
6689
6714
|
const INSECURE_URI = params.shift();
|
|
6690
6715
|
const el = elem(INSECURE_URI, (0, dom_1.defrag)(content), new url_1.ReadonlyURL(resolve(INSECURE_URI, context.host ?? global_1.location, context.url ?? context.host ?? global_1.location), context.host?.href || global_1.location.href), context.host?.origin || global_1.location.origin);
|
|
6691
6716
|
return [[(0, dom_1.define)(el, (0, html_1.attributes)('link', [], optspec, params))], rest];
|
|
6692
|
-
})))
|
|
6717
|
+
})));
|
|
6693
6718
|
exports.uri = (0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.open)(/^[^\S\n]+/, (0, source_1.str)(/^\S+/)), (0, source_1.str)(/^[^\s{}]+/)]), ([uri]) => ['\r', uri]);
|
|
6694
6719
|
exports.option = (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+nofollow(?=[^\S\n]|})/), () => [` rel="nofollow"`]), (0, source_1.str)(/^[^\S\n]+[a-z]+(?:-[a-z]+)*(?:="(?:\\[^\n]|[^\\\n"])*")?(?=[^\S\n]|})/), (0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[^\s{}]+/), opt => [` \\${opt.slice(1)}`])]);
|
|
6695
6720
|
|
|
@@ -6808,9 +6833,9 @@ const dom_1 = __webpack_require__(3252);
|
|
|
6808
6833
|
|
|
6809
6834
|
const array_1 = __webpack_require__(8112);
|
|
6810
6835
|
|
|
6811
|
-
exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.syntax)(0
|
|
6812
|
-
/*
|
|
6813
|
-
, 1,
|
|
6836
|
+
exports.mark = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('=='), (0, combinator_1.syntax)(0
|
|
6837
|
+
/* Syntax.none */
|
|
6838
|
+
, 1, 1, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('==')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '='), exports.mark)])))), (0, source_1.str)('=='), false, ([, bs], rest) => [[(0, dom_1.html)('mark', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
|
|
6814
6839
|
|
|
6815
6840
|
/***/ }),
|
|
6816
6841
|
|
|
@@ -6832,7 +6857,7 @@ const source_1 = __webpack_require__(6743);
|
|
|
6832
6857
|
const dom_1 = __webpack_require__(3252);
|
|
6833
6858
|
|
|
6834
6859
|
const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![a-z])/i;
|
|
6835
|
-
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('$', (0, combinator_1.
|
|
6860
|
+
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('$', (0, combinator_1.creation)((0, combinator_1.rewrite)((0, combinator_1.union)([(0, combinator_1.surround)('$', (0, combinator_1.precedence)(6, bracket), '$'), (0, combinator_1.surround)(/^\$(?![\s{}])/, (0, combinator_1.precedence)(3, (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.focus)(/^(?:[ ([](?!\$)|\\[\\{}$]?|[!#%&')\x2A-\x5A\]^_\x61-\x7A|~])+/, (0, combinator_1.some)(source_1.unescsource))]))), /^\$(?![0-9A-Za-z])/)]), (source, {
|
|
6836
6861
|
caches: {
|
|
6837
6862
|
math: cache
|
|
6838
6863
|
} = {}
|
|
@@ -6847,7 +6872,7 @@ exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('$', (0,
|
|
|
6847
6872
|
'data-invalid-type': 'content',
|
|
6848
6873
|
'data-invalid-message': `"${source.match(forbiddenCommand)[0]}" command is forbidden`
|
|
6849
6874
|
}, source)], '']))));
|
|
6850
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6875
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.surround)('{', (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.escsource, /^(?:[{}$]|\\?\n)/)])), '}', true)));
|
|
6851
6876
|
|
|
6852
6877
|
/***/ }),
|
|
6853
6878
|
|
|
@@ -6887,11 +6912,11 @@ const optspec = {
|
|
|
6887
6912
|
rel: global_1.undefined
|
|
6888
6913
|
};
|
|
6889
6914
|
Object.setPrototypeOf(optspec, null);
|
|
6890
|
-
exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.
|
|
6891
|
-
/* Rule.media */
|
|
6892
|
-
, 2, 10, (0, combinator_1.bind)((0, combinator_1.verify)((0, combinator_1.fmap)((0, combinator_1.open)('!', (0, combinator_1.guard)(context => ~context.state & 2
|
|
6915
|
+
exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '!{'], (0, combinator_1.bind)((0, combinator_1.verify)((0, combinator_1.fmap)((0, combinator_1.open)('!', (0, combinator_1.constraint)(2
|
|
6893
6916
|
/* State.media */
|
|
6894
|
-
,
|
|
6917
|
+
, false, (0, combinator_1.syntax)(64
|
|
6918
|
+
/* Syntax.media */
|
|
6919
|
+
, 2, 10, (0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']', [[/^\\?\n/, 9]]), ']', true)), (0, combinator_1.dup)((0, combinator_1.surround)(/^{(?![{}])/, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), /^[^\S\n]*}/))])))), ([as, bs]) => bs ? [[as.join('').trim() || as.join('')], (0, array_1.shift)(bs)[1]] : [[''], (0, array_1.shift)(as)[1]]), ([[text]]) => text === '' || text.trim() !== ''), ([[text], params], rest, context) => {
|
|
6895
6920
|
const INSECURE_URI = params.shift();
|
|
6896
6921
|
const url = new url_1.ReadonlyURL((0, link_1.resolve)(INSECURE_URI, context.host ?? global_1.location, context.url ?? context.host ?? global_1.location), context.host?.href || global_1.location.href);
|
|
6897
6922
|
let cache;
|
|
@@ -6915,8 +6940,8 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(['![', '
|
|
|
6915
6940
|
return (0, combinator_1.fmap)(link_1.textlink, ([link]) => [(0, dom_1.define)(link, {
|
|
6916
6941
|
target: '_blank'
|
|
6917
6942
|
}, [el])])(`{ ${INSECURE_URI}${params.join('')} }${rest}`, context);
|
|
6918
|
-
})))
|
|
6919
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6943
|
+
})));
|
|
6944
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ')'), (0, source_1.str)(')'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']'), (0, source_1.str)(']'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), '}'), (0, source_1.str)('}'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(8, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, source_1.txt]), '"')), (0, source_1.str)('"'), true)])));
|
|
6920
6945
|
const option = (0, combinator_1.union)([(0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[1-9][0-9]*x[1-9][0-9]*(?=[^\S\n]|})/), ([opt]) => [` width="${opt.slice(1).split('x')[0]}"`, ` height="${opt.slice(1).split('x')[1]}"`]), (0, combinator_1.fmap)((0, source_1.str)(/^[^\S\n]+[1-9][0-9]*:[1-9][0-9]*(?=[^\S\n]|})/), ([opt]) => [` aspect-ratio="${opt.slice(1).split(':').join('/')}"`]), link_1.option]);
|
|
6921
6946
|
|
|
6922
6947
|
function sanitize(target, uri, alt) {
|
|
@@ -6988,11 +7013,11 @@ const util_1 = __webpack_require__(9437);
|
|
|
6988
7013
|
|
|
6989
7014
|
const dom_1 = __webpack_require__(3252);
|
|
6990
7015
|
|
|
6991
|
-
exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
6992
|
-
/* Rule.reference */
|
|
6993
|
-
, 6, (0, combinator_1.surround)('[[', (0, combinator_1.guard)(context => ~context.state & 32
|
|
7016
|
+
exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('[[', (0, combinator_1.constraint)(32
|
|
6994
7017
|
/* State.reference */
|
|
6995
|
-
, (0, combinator_1.
|
|
7018
|
+
, false, (0, combinator_1.syntax)(4096
|
|
7019
|
+
/* Syntax.reference */
|
|
7020
|
+
, 6, 1, (0, combinator_1.state)(64
|
|
6996
7021
|
/* State.annotation */
|
|
6997
7022
|
| 32
|
|
6998
7023
|
/* State.reference */
|
|
@@ -7000,8 +7025,8 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[['
|
|
|
7000
7025
|
/* State.media */
|
|
7001
7026
|
, (0, visibility_1.startLoose)((0, combinator_1.context)({
|
|
7002
7027
|
delimiters: global_1.undefined
|
|
7003
|
-
}, (0, combinator_1.subsequence)([abbr, (0, combinator_1.open)((0, source_1.stropt)(/^(?=\^)/), (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]])), (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]])])), ']'))), ']]', false, ([, ns], rest) => [[(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))])], rest], ([, ns, rest], next) => next[0] === ']' ? global_1.undefined : (0, link_1.optimize)('[[', ns, rest, next)))
|
|
7004
|
-
const abbr = (0, combinator_1.
|
|
7028
|
+
}, (0, combinator_1.subsequence)([abbr, (0, combinator_1.open)((0, source_1.stropt)(/^(?=\^)/), (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]])), (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]])])), ']')))), ']]', false, ([, ns], rest) => [[(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))])], rest], ([, ns, rest], next) => next[0] === ']' ? global_1.undefined : (0, link_1.optimize)('[[', ns, rest, next)));
|
|
7029
|
+
const abbr = (0, combinator_1.creation)((0, combinator_1.bind)((0, combinator_1.surround)('^', (0, combinator_1.union)([(0, source_1.str)(/^(?![0-9]+\s?[|\]])[0-9A-Za-z]+(?:(?:-|(?=\W)(?!'\d)'?(?!\.\d)\.?(?!,\S),? ?)[0-9A-Za-z]+)*(?:-|'?\.?,? ?)?/)]), /^\|?(?=]])|^\|[^\S\n]*/), ([source], rest) => [[(0, dom_1.html)('abbr', source)], rest.replace(visibility_1.regBlankStart, '')]));
|
|
7005
7030
|
|
|
7006
7031
|
function attributes(ns) {
|
|
7007
7032
|
return typeof ns[0] === 'object' && ns[0].tagName === 'ABBR' ? {
|
|
@@ -7047,8 +7072,8 @@ const dom_1 = __webpack_require__(3252);
|
|
|
7047
7072
|
const array_1 = __webpack_require__(8112);
|
|
7048
7073
|
|
|
7049
7074
|
exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0, combinator_1.syntax)(0
|
|
7050
|
-
/*
|
|
7051
|
-
, 2, (0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.sequence)([(0, combinator_1.surround)('[', (0, combinator_1.focus)(/^(?:\\[^\n]|[^\\[\](){}"\n])+(?=]\()/, text), ']'), (0, combinator_1.surround)('(', (0, combinator_1.focus)(/^(?:\\[^\n]|[^\\[\](){}"\n])+(?=\))/, text), ')')]), ([texts]) => (0, visibility_1.isStartTightNodes)(texts)), ([texts, rubies]) => {
|
|
7075
|
+
/* Syntax.none */
|
|
7076
|
+
, 2, 1, (0, combinator_1.fmap)((0, combinator_1.verify)((0, combinator_1.sequence)([(0, combinator_1.surround)('[', (0, combinator_1.focus)(/^(?:\\[^\n]|[^\\[\](){}"\n])+(?=]\()/, text), ']'), (0, combinator_1.surround)('(', (0, combinator_1.focus)(/^(?:\\[^\n]|[^\\[\](){}"\n])+(?=\))/, text), ')')]), ([texts]) => (0, visibility_1.isStartTightNodes)(texts)), ([texts, rubies]) => {
|
|
7052
7077
|
texts[texts.length - 1] === '' && texts.pop();
|
|
7053
7078
|
|
|
7054
7079
|
switch (true) {
|
|
@@ -7062,7 +7087,7 @@ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('[', (0,
|
|
|
7062
7087
|
return [(0, dom_1.html)('ruby', attributes(texts, rubies), (0, dom_1.defrag)((0, array_1.unshift)([texts.join(' ')], [(0, dom_1.html)('rp', '('), (0, dom_1.html)('rt', rubies.join(' ').trim()), (0, dom_1.html)('rp', ')')])))];
|
|
7063
7088
|
}
|
|
7064
7089
|
}))));
|
|
7065
|
-
const text = (0, combinator_1.
|
|
7090
|
+
const text = (0, combinator_1.creation)((source, context) => {
|
|
7066
7091
|
const acc = [''];
|
|
7067
7092
|
|
|
7068
7093
|
while (source !== '') {
|
|
@@ -7137,9 +7162,9 @@ const url_1 = __webpack_require__(4318);
|
|
|
7137
7162
|
|
|
7138
7163
|
const media_1 = __webpack_require__(1303);
|
|
7139
7164
|
|
|
7140
|
-
exports.shortmedia = (0, combinator_1.rewrite)((0, combinator_1.
|
|
7165
|
+
exports.shortmedia = (0, combinator_1.rewrite)((0, combinator_1.constraint)(2
|
|
7141
7166
|
/* State.media */
|
|
7142
|
-
, (0, combinator_1.open)('!', url_1.url)), (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media])));
|
|
7167
|
+
, false, (0, combinator_1.open)('!', url_1.url)), (0, combinator_1.convert)(source => `!{ ${source.slice(1)} }`, (0, combinator_1.union)([media_1.media])));
|
|
7143
7168
|
|
|
7144
7169
|
/***/ }),
|
|
7145
7170
|
|
|
@@ -7168,9 +7193,9 @@ const dom_1 = __webpack_require__(3252);
|
|
|
7168
7193
|
|
|
7169
7194
|
const array_1 = __webpack_require__(8112);
|
|
7170
7195
|
|
|
7171
|
-
exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.syntax)(0
|
|
7172
|
-
/*
|
|
7173
|
-
, 1,
|
|
7196
|
+
exports.strong = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('**'), (0, combinator_1.syntax)(0
|
|
7197
|
+
/* Syntax.none */
|
|
7198
|
+
, 1, 1, (0, visibility_1.startTight)((0, combinator_1.some)((0, combinator_1.union)([(0, combinator_1.some)(inline_1.inline, (0, visibility_1.blankWith)('**')), (0, combinator_1.open)((0, combinator_1.some)(inline_1.inline, '*'), (0, combinator_1.union)([emstrong_1.emstrong, exports.strong]))])), '*')), (0, source_1.str)('**'), false, ([, bs], rest) => [[(0, dom_1.html)('strong', (0, dom_1.defrag)(bs))], rest], ([as, bs], rest) => [(0, array_1.unshift)(as, bs), rest]));
|
|
7174
7199
|
|
|
7175
7200
|
/***/ }),
|
|
7176
7201
|
|
|
@@ -7197,12 +7222,12 @@ const dom_1 = __webpack_require__(3252);
|
|
|
7197
7222
|
|
|
7198
7223
|
const array_1 = __webpack_require__(8112);
|
|
7199
7224
|
|
|
7200
|
-
exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.syntax)(0
|
|
7201
|
-
/*
|
|
7202
|
-
, 2,
|
|
7225
|
+
exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('{{', (0, combinator_1.syntax)(0
|
|
7226
|
+
/* Syntax.none */
|
|
7227
|
+
, 2, 1, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), '}}', true, ([, ns = []], rest) => [[(0, dom_1.html)('span', {
|
|
7203
7228
|
class: 'template'
|
|
7204
|
-
}, `{{${ns.join('').replace(/\x1B/g, '')}}}`)], rest], ([, ns = [], rest], next) => next[0] === '}' ? global_1.undefined : (0, link_1.optimize)('{{', ns, rest, next)))
|
|
7205
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.
|
|
7229
|
+
}, `{{${ns.join('').replace(/\x1B/g, '')}}}`)], rest], ([, ns = [], rest], next) => next[0] === '}' ? global_1.undefined : (0, link_1.optimize)('{{', ns, rest, next)));
|
|
7230
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creation)((0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')'), (0, source_1.str)(')'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ']'), (0, source_1.str)(']'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}'), (0, source_1.str)('}'), true, global_1.undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(8, (0, combinator_1.some)(source_1.escsource, /^"|^\\?\n/)), (0, source_1.str)('"'), true)])));
|
|
7206
7231
|
|
|
7207
7232
|
/***/ }),
|
|
7208
7233
|
|
|
@@ -7859,7 +7884,7 @@ const combinator_1 = __webpack_require__(2087);
|
|
|
7859
7884
|
const text_1 = __webpack_require__(7763);
|
|
7860
7885
|
|
|
7861
7886
|
const delimiter = /[\s\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]/;
|
|
7862
|
-
exports.escsource = (0, combinator_1.
|
|
7887
|
+
exports.escsource = (0, combinator_1.creation)(source => {
|
|
7863
7888
|
if (source === '') return;
|
|
7864
7889
|
const i = source.search(delimiter);
|
|
7865
7890
|
|
|
@@ -7925,10 +7950,10 @@ const global_1 = __webpack_require__(4128);
|
|
|
7925
7950
|
const combinator_1 = __webpack_require__(2087);
|
|
7926
7951
|
|
|
7927
7952
|
function str(pattern) {
|
|
7928
|
-
return typeof pattern === 'string' ? (0, combinator_1.
|
|
7953
|
+
return typeof pattern === 'string' ? (0, combinator_1.creation)(source => {
|
|
7929
7954
|
if (source === '') return;
|
|
7930
7955
|
return source.slice(0, pattern.length) === pattern ? [[pattern], source.slice(pattern.length)] : global_1.undefined;
|
|
7931
|
-
}) : (0, combinator_1.
|
|
7956
|
+
}) : (0, combinator_1.creation)(source => {
|
|
7932
7957
|
if (source === '') return;
|
|
7933
7958
|
const m = source.match(pattern);
|
|
7934
7959
|
return m && m[0].length > 0 ? [[m[0]], source.slice(m[0].length)] : global_1.undefined;
|
|
@@ -7938,10 +7963,10 @@ function str(pattern) {
|
|
|
7938
7963
|
exports.str = str;
|
|
7939
7964
|
|
|
7940
7965
|
function stropt(pattern) {
|
|
7941
|
-
return typeof pattern === 'string' ? (0, combinator_1.
|
|
7966
|
+
return typeof pattern === 'string' ? (0, combinator_1.creation)(source => {
|
|
7942
7967
|
if (source === '') return;
|
|
7943
7968
|
return source.slice(0, pattern.length) === pattern ? [[pattern], source.slice(pattern.length)] : global_1.undefined;
|
|
7944
|
-
}) : (0, combinator_1.
|
|
7969
|
+
}) : (0, combinator_1.creation)(source => {
|
|
7945
7970
|
if (source === '') return;
|
|
7946
7971
|
const m = source.match(pattern);
|
|
7947
7972
|
return m ? [[m[0]], source.slice(m[0].length)] : global_1.undefined;
|
|
@@ -7971,11 +7996,13 @@ const str_1 = __webpack_require__(2790);
|
|
|
7971
7996
|
|
|
7972
7997
|
const dom_1 = __webpack_require__(3252);
|
|
7973
7998
|
|
|
7974
|
-
exports.delimiter = /[\s\x00-\x7F]|\S
|
|
7999
|
+
exports.delimiter = /[\s\x00-\x7F]|\S[#>]|[()、。!?][^\S\n]*(?=\\\n)/;
|
|
7975
8000
|
exports.nonWhitespace = /[\S\n]|$/;
|
|
7976
|
-
exports.nonAlphanumeric = /[^0-9A-Za-z]|\S
|
|
8001
|
+
exports.nonAlphanumeric = /[^0-9A-Za-z]|\S[#>]|$/;
|
|
7977
8002
|
const repeat = (0, str_1.str)(/^(.)\1*/);
|
|
7978
|
-
exports.text = (0, combinator_1.
|
|
8003
|
+
exports.text = (0, combinator_1.syntax)(0
|
|
8004
|
+
/* Syntax.none */
|
|
8005
|
+
, 1, 1, (source, context) => {
|
|
7979
8006
|
if (source === '') return;
|
|
7980
8007
|
const i = source.search(exports.delimiter);
|
|
7981
8008
|
|
|
@@ -8070,7 +8097,7 @@ const combinator_1 = __webpack_require__(2087);
|
|
|
8070
8097
|
|
|
8071
8098
|
const text_1 = __webpack_require__(7763);
|
|
8072
8099
|
|
|
8073
|
-
exports.unescsource = (0, combinator_1.
|
|
8100
|
+
exports.unescsource = (0, combinator_1.creation)(source => {
|
|
8074
8101
|
if (source === '') return;
|
|
8075
8102
|
const i = source.search(text_1.delimiter);
|
|
8076
8103
|
|
|
@@ -8152,7 +8179,7 @@ const memoize_1 = __webpack_require__(1808);
|
|
|
8152
8179
|
const array_1 = __webpack_require__(8112);
|
|
8153
8180
|
|
|
8154
8181
|
function visualize(parser) {
|
|
8155
|
-
const blankline = new RegExp(/^(?:\\$|\\?[^\S\n]|&IHN;|<wbr
|
|
8182
|
+
const blankline = new RegExp(/^(?:\\$|\\?[^\S\n]|&IHN;|<wbr[^\S\n]*>)+$/.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`), 'gm');
|
|
8156
8183
|
return (0, combinator_1.union)([(0, combinator_1.convert)(source => source.replace(blankline, line => line.replace(/[\\&<]/g, '\x1B$&')), (0, combinator_1.verify)(parser, (ns, rest, context) => !rest && hasVisible(ns, context))), (0, combinator_1.some)((0, combinator_1.union)([source_1.linebreak, source_1.unescsource]))]);
|
|
8157
8184
|
}
|
|
8158
8185
|
|
|
@@ -8179,11 +8206,11 @@ function hasVisible(nodes, {
|
|
|
8179
8206
|
return false;
|
|
8180
8207
|
}
|
|
8181
8208
|
|
|
8182
|
-
exports.regBlankStart = new RegExp(/^(?:\\?[^\S\n]|&IHN;|<wbr
|
|
8209
|
+
exports.regBlankStart = new RegExp(/^(?:\\?[^\S\n]|&IHN;|<wbr[^\S\n]*>)+/.source.replace('IHN', `(?:${normalize_1.invisibleHTMLEntityNames.join('|')})`));
|
|
8183
8210
|
|
|
8184
8211
|
function blankWith(starting, delimiter) {
|
|
8185
8212
|
if (delimiter === global_1.undefined) return blankWith('', starting);
|
|
8186
|
-
return new RegExp(String.raw`^(?:(?=${starting})(?:\\?\s|&(?:${normalize_1.invisibleHTMLEntityNames.join('|')});|<wbr
|
|
8213
|
+
return new RegExp(String.raw`^(?:(?=${starting})(?:\\?\s|&(?:${normalize_1.invisibleHTMLEntityNames.join('|')});|<wbr[^\S\n]*>)${starting && '+'})?${typeof delimiter === 'string' ? delimiter.replace(/[*+()\[\]]/g, '\\$&') : delimiter.source}`);
|
|
8187
8214
|
}
|
|
8188
8215
|
|
|
8189
8216
|
exports.blankWith = blankWith;
|
|
@@ -8226,7 +8253,7 @@ const isStartTight = (0, memoize_1.reduce)((source, context, except) => {
|
|
|
8226
8253
|
|
|
8227
8254
|
case '<':
|
|
8228
8255
|
switch (true) {
|
|
8229
|
-
case source.length >= 5 && source
|
|
8256
|
+
case source.length >= 5 && source.slice(0, 4) === '<wbr' && (source[5] === '>' || /^<wbr[^\S\n]*>/.test(source)):
|
|
8230
8257
|
return false;
|
|
8231
8258
|
}
|
|
8232
8259
|
|