securemark 0.294.10 → 0.295.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 +8 -0
- package/design.md +5 -5
- package/dist/index.js +141 -127
- package/package.json +1 -1
- package/src/combinator/control/constraint/block.ts +1 -1
- package/src/combinator/control/constraint/contract.ts +5 -6
- package/src/combinator/control/constraint/line.ts +1 -2
- package/src/combinator/control/manipulation/convert.ts +1 -1
- package/src/combinator/control/manipulation/fallback.ts +1 -1
- package/src/combinator/control/manipulation/indent.ts +2 -2
- package/src/combinator/control/manipulation/lazy.ts +1 -1
- package/src/combinator/control/manipulation/match.ts +2 -5
- package/src/combinator/control/manipulation/recovery.ts +1 -1
- package/src/combinator/control/manipulation/reverse.ts +1 -1
- package/src/combinator/control/manipulation/scope.ts +3 -7
- package/src/combinator/control/manipulation/surround.ts +51 -62
- package/src/combinator/control/monad/bind.ts +7 -12
- package/src/combinator/control/monad/fmap.ts +4 -4
- package/src/combinator/data/parser/context.ts +12 -12
- package/src/combinator/data/parser/inits.ts +3 -6
- package/src/combinator/data/parser/sequence.ts +3 -6
- package/src/combinator/data/parser/some.ts +2 -2
- package/src/combinator/data/parser/subsequence.ts +1 -1
- package/src/combinator/data/parser/tails.ts +1 -1
- package/src/combinator/data/parser/union.ts +1 -1
- package/src/combinator/data/parser.ts +10 -9
- package/src/parser/api/body.test.ts +1 -1
- package/src/parser/api/header.test.ts +2 -2
- package/src/parser/api/normalize.test.ts +2 -0
- package/src/parser/api/normalize.ts +1 -1
- package/src/parser/context.ts +9 -6
- package/src/parser/header.test.ts +2 -2
- package/src/parser/header.ts +3 -3
- package/src/parser/inline/annotation.ts +1 -1
- package/src/parser/inline/autolink/account.ts +3 -3
- package/src/parser/inline/autolink/anchor.ts +1 -1
- package/src/parser/inline/autolink/email.ts +1 -1
- package/src/parser/inline/autolink/hashnum.ts +1 -1
- package/src/parser/inline/autolink/hashtag.ts +1 -1
- package/src/parser/inline/autolink/url.ts +9 -10
- package/src/parser/inline/bracket.ts +31 -19
- package/src/parser/inline/extension/index.ts +3 -3
- package/src/parser/inline/extension/indexee.ts +1 -1
- package/src/parser/inline/extension/label.ts +1 -1
- package/src/parser/inline/extension/placeholder.ts +1 -1
- package/src/parser/inline/htmlentity.ts +1 -1
- package/src/parser/inline/link.ts +12 -14
- package/src/parser/inline/math.ts +2 -2
- package/src/parser/inline/media.ts +15 -17
- package/src/parser/inline/reference.ts +9 -9
- package/src/parser/inline/ruby.ts +4 -4
- package/src/parser/inline/template.ts +6 -10
- package/src/parser/visibility.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.
|
|
1
|
+
/*! securemark v0.295.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"));
|
|
@@ -2945,7 +2945,7 @@ function match(pattern, f) {
|
|
|
2945
2945
|
count && (0, combinator_1.consume)(params[0].length, context);
|
|
2946
2946
|
const result = f(params)(input);
|
|
2947
2947
|
context.position += result && context.position === position ? params[0].length : 0;
|
|
2948
|
-
return
|
|
2948
|
+
return result;
|
|
2949
2949
|
});
|
|
2950
2950
|
}
|
|
2951
2951
|
exports.match = match;
|
|
@@ -3111,6 +3111,7 @@ function surround(opener, parser, closer, optional = false, backtracks = [], f,
|
|
|
3111
3111
|
case 'object':
|
|
3112
3112
|
closer = (0, combinator_1.clear)((0, combinator_1.matcher)(closer, true));
|
|
3113
3113
|
}
|
|
3114
|
+
const [rbs, wbs] = reduce(backtracks);
|
|
3114
3115
|
return (0, parser_1.failsafe)(input => {
|
|
3115
3116
|
const {
|
|
3116
3117
|
context
|
|
@@ -3128,20 +3129,20 @@ function surround(opener, parser, closer, optional = false, backtracks = [], f,
|
|
|
3128
3129
|
if (!nodesO) {
|
|
3129
3130
|
return void revert(context, linebreak);
|
|
3130
3131
|
}
|
|
3131
|
-
if (isBacktrack(context,
|
|
3132
|
+
if (rbs && isBacktrack(context, rbs, position, context.position - position || 1)) {
|
|
3132
3133
|
return void revert(context, linebreak);
|
|
3133
3134
|
}
|
|
3134
3135
|
const nodesM = context.position < source.length ? parser(input) : undefined;
|
|
3135
3136
|
context.range = context.position - position;
|
|
3136
3137
|
if (!nodesM && !optional) {
|
|
3137
|
-
setBacktrack(context,
|
|
3138
|
+
wbs && setBacktrack(context, wbs, position);
|
|
3138
3139
|
const result = g?.([nodesO, nodesM], context);
|
|
3139
3140
|
return result || void revert(context, linebreak);
|
|
3140
3141
|
}
|
|
3141
3142
|
const nodesC = nodesM || optional ? closer(input) : undefined;
|
|
3142
3143
|
context.range = context.position - position;
|
|
3143
3144
|
if (!nodesC) {
|
|
3144
|
-
setBacktrack(context,
|
|
3145
|
+
wbs && setBacktrack(context, wbs, position);
|
|
3145
3146
|
const result = g?.([nodesO, nodesM], context);
|
|
3146
3147
|
return result || void revert(context, linebreak);
|
|
3147
3148
|
}
|
|
@@ -3165,66 +3166,61 @@ function close(parser, closer, optional, backtracks) {
|
|
|
3165
3166
|
return surround('', parser, closer, optional, backtracks);
|
|
3166
3167
|
}
|
|
3167
3168
|
exports.close = close;
|
|
3168
|
-
const
|
|
3169
|
-
function isBacktrack(context,
|
|
3169
|
+
const commandsize = 2;
|
|
3170
|
+
function isBacktrack(context, backtrack, position = context.position, length = 1) {
|
|
3171
|
+
if (length === 0) return false;
|
|
3170
3172
|
const {
|
|
3171
3173
|
source
|
|
3172
3174
|
} = context;
|
|
3173
3175
|
if (position === source.length) return false;
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
if (source[position + i] !== source[position + 0]) break;
|
|
3184
|
-
const pos = position + i + offset;
|
|
3185
|
-
if (!(pos in backtracks)) continue;
|
|
3186
|
-
if (backtracks[pos] & 1 << size(backtrack >>> statesize)) return true;
|
|
3187
|
-
}
|
|
3188
|
-
}
|
|
3176
|
+
const {
|
|
3177
|
+
backtracks = {},
|
|
3178
|
+
offset = 0
|
|
3179
|
+
} = context;
|
|
3180
|
+
for (let i = 0; i < length; ++i) {
|
|
3181
|
+
if (position + i === source.length) break;
|
|
3182
|
+
if (i > 0 && source[position + i] !== source[position]) break;
|
|
3183
|
+
const pos = position + i + offset;
|
|
3184
|
+
if (backtracks[pos] & backtrack >>> commandsize) return true;
|
|
3189
3185
|
}
|
|
3190
3186
|
return false;
|
|
3191
3187
|
}
|
|
3192
3188
|
exports.isBacktrack = isBacktrack;
|
|
3193
|
-
function setBacktrack(context,
|
|
3189
|
+
function setBacktrack(context, backtrack, position, length = 1) {
|
|
3194
3190
|
// バックトラックの可能性がなく記録不要の場合もあるが判別が面倒なので省略
|
|
3191
|
+
|
|
3192
|
+
if (length === 0) return;
|
|
3195
3193
|
const {
|
|
3196
3194
|
source
|
|
3197
3195
|
} = context;
|
|
3198
3196
|
if (position === source.length) return;
|
|
3199
|
-
|
|
3197
|
+
const {
|
|
3198
|
+
backtracks = {},
|
|
3199
|
+
offset = 0
|
|
3200
|
+
} = context;
|
|
3201
|
+
for (let i = 0; i < length; ++i) {
|
|
3202
|
+
if (position + i === source.length) break;
|
|
3203
|
+
const pos = position + i + offset;
|
|
3204
|
+
backtracks[pos] |= backtrack >>> commandsize;
|
|
3205
|
+
}
|
|
3206
|
+
}
|
|
3207
|
+
exports.setBacktrack = setBacktrack;
|
|
3208
|
+
function reduce(backtracks) {
|
|
3209
|
+
let rbs = 0;
|
|
3210
|
+
let wbs = 0;
|
|
3200
3211
|
for (const backtrack of backtracks) {
|
|
3212
|
+
if (backtrack & 1) {
|
|
3213
|
+
rbs |= backtrack;
|
|
3214
|
+
}
|
|
3201
3215
|
if (backtrack & 2) {
|
|
3202
|
-
|
|
3203
|
-
backtracks = {},
|
|
3204
|
-
offset = 0
|
|
3205
|
-
} = context;
|
|
3206
|
-
for (let i = 0; i < length; ++i) {
|
|
3207
|
-
if (position + i === source.length) break;
|
|
3208
|
-
const pos = position + i + offset;
|
|
3209
|
-
backtracks[pos] |= 1 << size(backtrack >>> statesize);
|
|
3210
|
-
}
|
|
3216
|
+
wbs |= backtrack;
|
|
3211
3217
|
}
|
|
3212
3218
|
}
|
|
3219
|
+
return [rbs, wbs];
|
|
3213
3220
|
}
|
|
3214
|
-
exports.setBacktrack = setBacktrack;
|
|
3215
3221
|
function revert(context, linebreak) {
|
|
3216
3222
|
context.linebreak = linebreak;
|
|
3217
3223
|
}
|
|
3218
|
-
function size(bits) {
|
|
3219
|
-
if (bits === 0) return 0;
|
|
3220
|
-
let p = 0;
|
|
3221
|
-
for (let s = 32 / 2; s > 0; s >>>= 1) {
|
|
3222
|
-
const q = p + s;
|
|
3223
|
-
if (bits >>> q === 0) continue;
|
|
3224
|
-
p = q;
|
|
3225
|
-
}
|
|
3226
|
-
return p + 1;
|
|
3227
|
-
}
|
|
3228
3224
|
|
|
3229
3225
|
/***/ },
|
|
3230
3226
|
|
|
@@ -3249,11 +3245,10 @@ function bind(parser, f) {
|
|
|
3249
3245
|
position
|
|
3250
3246
|
} = context;
|
|
3251
3247
|
if (position === source.length) return;
|
|
3252
|
-
const
|
|
3253
|
-
if (
|
|
3248
|
+
const result = parser(input);
|
|
3249
|
+
if (result === undefined) return;
|
|
3254
3250
|
context.range = context.position - position;
|
|
3255
|
-
|
|
3256
|
-
return context.position > position ? res2 : undefined;
|
|
3251
|
+
return f(result, context);
|
|
3257
3252
|
});
|
|
3258
3253
|
}
|
|
3259
3254
|
exports.bind = bind;
|
|
@@ -3635,7 +3630,7 @@ function state(state, positive, parser) {
|
|
|
3635
3630
|
};
|
|
3636
3631
|
}
|
|
3637
3632
|
exports.state = state;
|
|
3638
|
-
//export function constraint<P extends Parser
|
|
3633
|
+
//export function constraint<P extends Parser>(state: number, positive: boolean, parser: P): P;
|
|
3639
3634
|
function constraint(state, positive, parser) {
|
|
3640
3635
|
if (typeof positive === 'function') {
|
|
3641
3636
|
parser = positive;
|
|
@@ -3863,8 +3858,7 @@ function inits(parsers, resume) {
|
|
|
3863
3858
|
context
|
|
3864
3859
|
} = input;
|
|
3865
3860
|
const {
|
|
3866
|
-
source
|
|
3867
|
-
position
|
|
3861
|
+
source
|
|
3868
3862
|
} = context;
|
|
3869
3863
|
let nodes;
|
|
3870
3864
|
for (let len = parsers.length, i = 0; i < len; ++i) {
|
|
@@ -3875,7 +3869,7 @@ function inits(parsers, resume) {
|
|
|
3875
3869
|
nodes = nodes?.import(result) ?? result;
|
|
3876
3870
|
if (resume?.(result) === false) break;
|
|
3877
3871
|
}
|
|
3878
|
-
return
|
|
3872
|
+
return nodes;
|
|
3879
3873
|
};
|
|
3880
3874
|
}
|
|
3881
3875
|
exports.inits = inits;
|
|
@@ -3899,8 +3893,7 @@ function sequence(parsers, resume) {
|
|
|
3899
3893
|
context
|
|
3900
3894
|
} = input;
|
|
3901
3895
|
const {
|
|
3902
|
-
source
|
|
3903
|
-
position
|
|
3896
|
+
source
|
|
3904
3897
|
} = context;
|
|
3905
3898
|
let nodes;
|
|
3906
3899
|
for (let len = parsers.length, i = 0; i < len; ++i) {
|
|
@@ -3911,7 +3904,7 @@ function sequence(parsers, resume) {
|
|
|
3911
3904
|
nodes = nodes?.import(result) ?? result;
|
|
3912
3905
|
if (resume?.(result) === false) return;
|
|
3913
3906
|
}
|
|
3914
|
-
return
|
|
3907
|
+
return nodes;
|
|
3915
3908
|
};
|
|
3916
3909
|
}
|
|
3917
3910
|
exports.sequence = sequence;
|
|
@@ -4402,7 +4395,7 @@ function normalize(source) {
|
|
|
4402
4395
|
}
|
|
4403
4396
|
exports.normalize = normalize;
|
|
4404
4397
|
function format(source) {
|
|
4405
|
-
return source.replace(/\r\n
|
|
4398
|
+
return source.replace(/\r\n?|[\u2028\u2029]/g, '\n');
|
|
4406
4399
|
}
|
|
4407
4400
|
const invalid = new RegExp([/(?![\t\r\n])[\x00-\x1F\x7F]/g.source, /(?!\u200D)[\u2006\u200B-\u200F\u202A-\u202F\u2060\uFEFF]/g.source
|
|
4408
4401
|
// 後読みが重い
|
|
@@ -6001,9 +5994,9 @@ const source_1 = __webpack_require__(8745);
|
|
|
6001
5994
|
const util_1 = __webpack_require__(4992);
|
|
6002
5995
|
const normalize_1 = __webpack_require__(4490);
|
|
6003
5996
|
const dom_1 = __webpack_require__(394);
|
|
6004
|
-
exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+ *\
|
|
5997
|
+
exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+ *\n(?=\S)/y, (0, combinator_1.inits)([(0, combinator_1.block)((0, combinator_1.union)([(0, combinator_1.validate)(({
|
|
6005
5998
|
context
|
|
6006
|
-
}) => context.header ?? true, (0, combinator_1.focus)(/(---+) *\
|
|
5999
|
+
}) => context.header ?? true, (0, combinator_1.focus)(/(---+) *\n(?:[A-Za-z][0-9A-Za-z]*(?:-[0-9A-Za-z]+)*:[ \t]+\S[^\n]*\n){1,100}\1 *(?:$|\n)/y, (0, combinator_1.convert)(source => (0, normalize_1.normalize)(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.Data((0, dom_1.html)('aside', {
|
|
6007
6000
|
class: 'header'
|
|
6008
6001
|
}, [(0, dom_1.html)('details', {
|
|
6009
6002
|
open: ''
|
|
@@ -6020,7 +6013,7 @@ exports.header = (0, combinator_1.lazy)(() => (0, combinator_1.validate)(/---+ *
|
|
|
6020
6013
|
translate: 'no',
|
|
6021
6014
|
...(0, util_1.invalid)('header', 'syntax', 'Invalid syntax')
|
|
6022
6015
|
}, (0, normalize_1.normalize)(source.slice(position))))]);
|
|
6023
|
-
}])), (0, combinator_1.clear)((0, source_1.str)(/ *\
|
|
6016
|
+
}])), (0, combinator_1.clear)((0, source_1.str)(/ *\n/y))])));
|
|
6024
6017
|
const field = (0, combinator_1.line)(({
|
|
6025
6018
|
context: {
|
|
6026
6019
|
source,
|
|
@@ -6202,7 +6195,7 @@ const inline_1 = __webpack_require__(7973);
|
|
|
6202
6195
|
const visibility_1 = __webpack_require__(6364);
|
|
6203
6196
|
const util_1 = __webpack_require__(4992);
|
|
6204
6197
|
const dom_1 = __webpack_require__(394);
|
|
6205
|
-
exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(128 /* State.annotation */, (0, combinator_1.surround)('((', (0, combinator_1.precedence)(1, (0, combinator_1.state)(128 /* State.annotation */, (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[')', 1]])))), '))', false, [1 |
|
|
6198
|
+
exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(128 /* State.annotation */, (0, combinator_1.surround)('((', (0, combinator_1.precedence)(1, (0, combinator_1.state)(128 /* State.annotation */, (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[')', 1]])))), '))', false, [1 | 4 /* Backtrack.common */, 3 | 128 /* Backtrack.doublebracket */], ([, ns], context) => context.linebreak === 0 ? new parser_1.List([new parser_1.Data((0, dom_1.html)('sup', {
|
|
6206
6199
|
class: 'annotation'
|
|
6207
6200
|
}, [(0, dom_1.html)('span', (0, dom_1.defrag)((0, util_1.unwrap)((0, visibility_1.trimBlankNodeEnd)(ns))))]))]) : undefined)));
|
|
6208
6201
|
|
|
@@ -6285,9 +6278,9 @@ const source_1 = __webpack_require__(8745);
|
|
|
6285
6278
|
const dom_1 = __webpack_require__(394);
|
|
6286
6279
|
// https://example/@user must be a user page or a redirect page going there.
|
|
6287
6280
|
// https://example/@user?ch=a+b must be a user channel page or a redirect page going there.
|
|
6288
|
-
exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)((0, combinator_1.surround)(/(?<![0-9a-z])@/yi, (0, source_1.str)(/[0-9a-z](?:[.-](?=[0-9a-z])|[0-9a-z]){0,254}\/|/yi), (0, source_1.str)(/[a-z][0-9a-z]*(?:[-.][0-9a-z]+)*(?![-.]?[0-9a-z@]|>>|:\S)/yi), false, [3 |
|
|
6281
|
+
exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)((0, combinator_1.surround)(/(?<![0-9a-z])@/yi, (0, source_1.str)(/[0-9a-z](?:[.-](?=[0-9a-z])|[0-9a-z]){0,254}\/|/yi), (0, source_1.str)(/[a-z][0-9a-z]*(?:[-.][0-9a-z]+)*(?![-.]?[0-9a-z@]|>>|:\S)/yi), false, [3 | 8 /* Backtrack.unescapable */]), (0, combinator_1.some)((0, combinator_1.surround)('#', (0, combinator_1.verify)((0, source_1.str)(new RegExp([/(?!['_])(?:[^\p{C}\p{S}\p{P}\s]|emoji|'(?=[0-9A-Za-z])|_(?=[^\p{C}\p{S}\p{P}\s]|emoji))+/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu')), ([{
|
|
6289
6282
|
value
|
|
6290
|
-
}]) => /^[0-9]{0,4}[^0-9]/.test(value)), new RegExp([/(?![0-9a-z@]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu'), false, [3 |
|
|
6283
|
+
}]) => /^[0-9]{0,4}[^0-9]/.test(value)), new RegExp([/(?![0-9a-z@]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu'), false, [3 | 8 /* Backtrack.unescapable */])), '', false, [], ([[{
|
|
6291
6284
|
value: host
|
|
6292
6285
|
}, {
|
|
6293
6286
|
value: account
|
|
@@ -6307,7 +6300,7 @@ exports.account = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /*
|
|
|
6307
6300
|
value: account
|
|
6308
6301
|
}]], context) => {
|
|
6309
6302
|
if (context.source[context.position] === '#') {
|
|
6310
|
-
return void (0, combinator_1.setBacktrack)(context,
|
|
6303
|
+
return void (0, combinator_1.setBacktrack)(context, 2 | 8 /* Backtrack.unescapable */, context.position - context.range);
|
|
6311
6304
|
}
|
|
6312
6305
|
return new parser_1.List([new parser_1.Data((0, dom_1.define)((0, link_1.parse)(new parser_1.List([new parser_1.Data(`@${host}${account}`)]), new parser_1.List([new parser_1.Data(host ? `https://${host}@${account}` : `/@${account}`)]), context), {
|
|
6313
6306
|
class: 'account'
|
|
@@ -6338,7 +6331,7 @@ const dom_1 = __webpack_require__(394);
|
|
|
6338
6331
|
// cid: YYYY-MMDD-HHMM-SSmmm
|
|
6339
6332
|
// 内部表現はUnixTimeに統一する(時系列順)
|
|
6340
6333
|
// 外部表現は投稿ごとに投稿者の投稿時のタイムゾーンに統一する(非時系列順)
|
|
6341
|
-
exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)(/(?<![0-9a-z])>>/yi, (0, source_1.str)(/[0-9a-z]+(?:-[0-9a-z]+)*(?!-?[0-9a-z@#]|>>|:\S)/yi), '', false, [3 |
|
|
6334
|
+
exports.anchor = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)(/(?<![0-9a-z])>>/yi, (0, source_1.str)(/[0-9a-z]+(?:-[0-9a-z]+)*(?!-?[0-9a-z@#]|>>|:\S)/yi), '', false, [3 | 8 /* Backtrack.unescapable */], ([, [{
|
|
6342
6335
|
value
|
|
6343
6336
|
}]], context) => new parser_1.List([new parser_1.Data((0, dom_1.define)((0, link_1.parse)(new parser_1.List([new parser_1.Data(`>>${value}`)]), new parser_1.List([new parser_1.Data(`?at=${value}`)]), context), {
|
|
6344
6337
|
class: 'anchor'
|
|
@@ -6363,7 +6356,7 @@ const dom_1 = __webpack_require__(394);
|
|
|
6363
6356
|
// https://html.spec.whatwg.org/multipage/input.html
|
|
6364
6357
|
exports.email = (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)(/(?<![0-9a-z][_.+-]?|[@#])(?=[0-9a-z])/yi, (0, combinator_1.verify)((0, source_1.str)(/[0-9a-z](?:[_.+-](?=[0-9a-z])|[0-9a-z]){0,63}@[0-9a-z](?:[.-](?=[0-9a-z])|[0-9a-z]){0,254}(?![.-]?[0-9a-z@#]|>>|:\S)/yi), ([{
|
|
6365
6358
|
value
|
|
6366
|
-
}]) => value.length <= 254), '', false, [3 |
|
|
6359
|
+
}]) => value.length <= 254), '', false, [3 | 8 /* Backtrack.unescapable */], ([, [{
|
|
6367
6360
|
value
|
|
6368
6361
|
}]]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('a', {
|
|
6369
6362
|
class: 'email',
|
|
@@ -6388,7 +6381,7 @@ const link_1 = __webpack_require__(3628);
|
|
|
6388
6381
|
const hashtag_1 = __webpack_require__(5764);
|
|
6389
6382
|
const source_1 = __webpack_require__(8745);
|
|
6390
6383
|
const dom_1 = __webpack_require__(394);
|
|
6391
|
-
exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)(new RegExp([/(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu'), (0, source_1.str)(new RegExp([/[0-9]{1,9}(?![0-9a-z@#]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu')), '', false, [1 |
|
|
6384
|
+
exports.hashnum = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)(new RegExp([/(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu'), (0, source_1.str)(new RegExp([/[0-9]{1,9}(?![0-9a-z@#]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, hashtag_1.emoji.source), 'yu')), '', false, [1 | 8 /* Backtrack.unescapable */], ([, [{
|
|
6392
6385
|
value
|
|
6393
6386
|
}]], context) => new parser_1.List([new parser_1.Data((0, dom_1.define)((0, link_1.parse)(new parser_1.List([new parser_1.Data(`#${value}`)]), new parser_1.List([new parser_1.Data(value)]), context), {
|
|
6394
6387
|
class: 'hashnum',
|
|
@@ -6417,7 +6410,7 @@ const dom_1 = __webpack_require__(394);
|
|
|
6417
6410
|
exports.emoji = /\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F|\u200D/u;
|
|
6418
6411
|
exports.hashtag = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(1 /* State.autolink */, (0, combinator_1.state)(1 /* State.autolink */, (0, combinator_1.surround)(new RegExp([/(?<![^\p{C}\p{S}\p{P}\s]|emoji)#/yu.source].join('|').replace(/emoji/g, exports.emoji.source), 'yu'), (0, combinator_1.verify)((0, source_1.str)(new RegExp([/(?!['_])(?:[^\p{C}\p{S}\p{P}\s]|emoji|'(?=[0-9A-Za-z])|_(?=[^\p{C}\p{S}\p{P}\s]|emoji))+/yu.source].join('|').replace(/emoji/g, exports.emoji.source), 'yu')), ([{
|
|
6419
6412
|
value
|
|
6420
|
-
}]) => /^[0-9]{0,4}[^0-9]/.test(value)), new RegExp([/(?![0-9a-z@#]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, exports.emoji.source), 'yu'), false, [3 |
|
|
6413
|
+
}]) => /^[0-9]{0,4}[^0-9]/.test(value)), new RegExp([/(?![0-9a-z@#]|>>|:\S|[^\p{C}\p{S}\p{P}\s]|emoji)/yu.source].join('|').replace(/emoji/g, exports.emoji.source), 'yu'), false, [3 | 8 /* Backtrack.unescapable */], ([, [{
|
|
6421
6414
|
value
|
|
6422
6415
|
}]], context) => new parser_1.List([new parser_1.Data((0, dom_1.define)((0, link_1.parse)(new parser_1.List([new parser_1.Data(`#${value}`)]), new parser_1.List([new parser_1.Data(`/hashtags/${value}`)]), context), {
|
|
6423
6416
|
class: 'hashtag'
|
|
@@ -6440,7 +6433,7 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
6440
6433
|
const inline_1 = __webpack_require__(7973);
|
|
6441
6434
|
const link_1 = __webpack_require__(3628);
|
|
6442
6435
|
const source_1 = __webpack_require__(8745);
|
|
6443
|
-
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, (0, combinator_1.verify)(bracket, ns => ns.length > 0))]), undefined, [[/[^\x21-\x7E]|\$/y, 9]])), false, [3 |
|
|
6436
|
+
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, (0, combinator_1.verify)(bracket, ns => ns.length > 0))]), undefined, [[/[^\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 */, ({
|
|
6444
6437
|
context
|
|
6445
6438
|
}) => new parser_1.List([new parser_1.Data((0, link_1.parse)(new parser_1.List(), new parser_1.List([new parser_1.Data(context.source)]), context))]))), (0, combinator_1.open)((0, source_1.str)(/[^:]+/y), (0, combinator_1.some)(inline_1.inline))])));
|
|
6446
6439
|
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 */, ({
|
|
@@ -6448,14 +6441,12 @@ exports.lineurl = (0, combinator_1.lazy)(() => (0, combinator_1.focus)(/(?<=^|[\
|
|
|
6448
6441
|
}) => {
|
|
6449
6442
|
const {
|
|
6450
6443
|
source,
|
|
6451
|
-
position
|
|
6452
|
-
range = 0
|
|
6444
|
+
position
|
|
6453
6445
|
} = context;
|
|
6454
|
-
context.position -=
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')')), (0, source_1.str)(')'), true, [3 | 0 /* Backtrack.autolink */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']')), (0, source_1.str)(']'), true, [3 | 0 /* Backtrack.autolink */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}')), (0, source_1.str)('}'), true, [3 | 0 /* Backtrack.autolink */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)(source_1.unescsource, '"'))), (0, source_1.str)('"'), true, [3 | 0 /* Backtrack.autolink */], undefined, () => new parser_1.List())]));
|
|
6446
|
+
context.position -= source[0] === '!' ? 1 : 0;
|
|
6447
|
+
return new parser_1.List([new parser_1.Data((0, link_1.parse)(new parser_1.List(), new parser_1.List([new parser_1.Data(source.slice(position))]), context))]);
|
|
6448
|
+
})), (0, source_1.str)(/[^:]+/y)])])));
|
|
6449
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ')')), (0, source_1.str)(')'), true, [3 | 8 /* Backtrack.unescapable */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), ']')), (0, source_1.str)(']'), true, [3 | 8 /* Backtrack.unescapable */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.unescsource]), '}')), (0, source_1.str)('}'), true, [3 | 8 /* Backtrack.unescapable */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)(source_1.unescsource, '"'))), (0, source_1.str)('"'), true, [3 | 8 /* Backtrack.unescapable */], undefined, () => new parser_1.List())]));
|
|
6459
6450
|
|
|
6460
6451
|
/***/ },
|
|
6461
6452
|
|
|
@@ -6502,17 +6493,33 @@ exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([input =>
|
|
|
6502
6493
|
return d1(input);
|
|
6503
6494
|
}
|
|
6504
6495
|
}]));
|
|
6505
|
-
const p1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ')', [[')', 1]]))), (0, source_1.str)(')'), true, [
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6496
|
+
const p1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ')', [[')', 1]]))), (0, source_1.str)(')'), true, [], ([as, bs = new parser_1.List(), cs], context) => {
|
|
6497
|
+
const {
|
|
6498
|
+
source,
|
|
6499
|
+
position,
|
|
6500
|
+
range = 0
|
|
6501
|
+
} = context;
|
|
6502
|
+
const head = position - range;
|
|
6503
|
+
if (context.linebreak !== 0 || source[position - 2] !== ')' || source[head + 1] !== '(') {
|
|
6504
|
+
(0, combinator_1.setBacktrack)(context, 2 | 128 /* Backtrack.doublebracket */, head);
|
|
6505
|
+
}
|
|
6510
6506
|
const str = source.slice(position - range + 1, position - 1);
|
|
6511
6507
|
return indexA.test(str) ? new parser_1.List([new parser_1.Data(as.head.value), new parser_1.Data(str), new parser_1.Data(cs.head.value)]) : new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
|
|
6512
6508
|
class: 'paren'
|
|
6513
6509
|
}, (0, dom_1.defrag)((0, util_1.unwrap)(as.import(bs).import(cs)))))]);
|
|
6514
|
-
}, ([as, bs = new parser_1.List()]) =>
|
|
6515
|
-
const
|
|
6510
|
+
}, ([as, bs = new parser_1.List()], context) => {
|
|
6511
|
+
const {
|
|
6512
|
+
source,
|
|
6513
|
+
position,
|
|
6514
|
+
range = 0
|
|
6515
|
+
} = context;
|
|
6516
|
+
const head = position - range;
|
|
6517
|
+
if (context.linebreak !== 0 || source[head + 1] !== '(') {
|
|
6518
|
+
(0, combinator_1.setBacktrack)(context, 2 | 128 /* Backtrack.doublebracket */, head);
|
|
6519
|
+
}
|
|
6520
|
+
return as.import(bs);
|
|
6521
|
+
}));
|
|
6522
|
+
const p2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ')', [[')', 1]]))), (0, source_1.str)(')'), true, [], ([as, bs = [], cs], {
|
|
6516
6523
|
source,
|
|
6517
6524
|
position,
|
|
6518
6525
|
range = 0
|
|
@@ -6522,7 +6529,7 @@ const p2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.
|
|
|
6522
6529
|
class: 'paren'
|
|
6523
6530
|
}, (0, dom_1.defrag)((0, util_1.unwrap)(as.import(bs).import(cs)))))]);
|
|
6524
6531
|
}, ([as, bs = new parser_1.List()]) => as.import(bs)));
|
|
6525
|
-
const s1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (0, source_1.str)(']'), true, [2 |
|
|
6532
|
+
const s1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (0, source_1.str)(']'), true, [2 | 4 /* Backtrack.common */], ([as, bs = new parser_1.List(), cs], context) => {
|
|
6526
6533
|
if (context.state & 8 /* State.link */) {
|
|
6527
6534
|
const {
|
|
6528
6535
|
source,
|
|
@@ -6530,16 +6537,21 @@ const s1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.
|
|
|
6530
6537
|
range = 0
|
|
6531
6538
|
} = context;
|
|
6532
6539
|
const head = position - range;
|
|
6533
|
-
if (context.linebreak !== 0 || source[position] !== '
|
|
6534
|
-
(0, combinator_1.setBacktrack)(context,
|
|
6540
|
+
if (context.linebreak !== 0 || source[position - 2] !== ']' || source[head + 1] !== '[') {
|
|
6541
|
+
(0, combinator_1.setBacktrack)(context, 2 | 128 /* Backtrack.doublebracket */, head);
|
|
6542
|
+
}
|
|
6543
|
+
if (context.linebreak !== 0) {
|
|
6544
|
+
(0, combinator_1.setBacktrack)(context, 2 | 128 /* Backtrack.doublebracket */ | 64 /* Backtrack.link */ | 32 /* Backtrack.ruby */, head);
|
|
6545
|
+
} else if (source[position] !== '{') {
|
|
6546
|
+
(0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */, head);
|
|
6535
6547
|
} else {
|
|
6536
6548
|
context.state ^= 8 /* State.link */;
|
|
6537
|
-
const result = !(0, combinator_1.isBacktrack)(context,
|
|
6549
|
+
const result = !(0, combinator_1.isBacktrack)(context, 1 | 64 /* Backtrack.link */) ? (0, link_1.textlink)({
|
|
6538
6550
|
context
|
|
6539
6551
|
}) : undefined;
|
|
6540
6552
|
context.position = position;
|
|
6541
6553
|
if (!result) {
|
|
6542
|
-
(0, combinator_1.setBacktrack)(context,
|
|
6554
|
+
(0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */, head);
|
|
6543
6555
|
}
|
|
6544
6556
|
context.state ^= 8 /* State.link */;
|
|
6545
6557
|
context.range = range;
|
|
@@ -6547,12 +6559,12 @@ const s1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.
|
|
|
6547
6559
|
}
|
|
6548
6560
|
return as.import(bs).import(cs);
|
|
6549
6561
|
}, ([as, bs = new parser_1.List()]) => as.import(bs)));
|
|
6550
|
-
const s2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (0, source_1.str)(']'), true, [
|
|
6551
|
-
const c1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, [
|
|
6552
|
-
const c2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, [
|
|
6562
|
+
const s2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))), (0, source_1.str)(']'), true, [], undefined, ([as, bs = new parser_1.List()]) => as.import(bs)));
|
|
6563
|
+
const c1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, [], undefined, ([as, bs = new parser_1.List()]) => as.import(bs)));
|
|
6564
|
+
const c2 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 1]]))), (0, source_1.str)('}'), true, [], undefined, ([as, bs = new parser_1.List()]) => as.import(bs)));
|
|
6553
6565
|
const d1 = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('"'),
|
|
6554
6566
|
// 改行の優先度を構文ごとに変える場合シグネチャの優先度対応が必要
|
|
6555
|
-
(0, combinator_1.precedence)(2, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, /["\n]/y, [['"', 2], ['\n', 3]]))), (0, source_1.str)('"'), true, [
|
|
6567
|
+
(0, combinator_1.precedence)(2, (0, combinator_1.recursion)(5 /* Recursion.bracket */, (0, combinator_1.some)(inline_1.inline, /["\n]/y, [['"', 2], ['\n', 3]]))), (0, source_1.str)('"'), true, [], undefined, ([as, bs = new parser_1.List()]) => as.import(bs)));
|
|
6556
6568
|
|
|
6557
6569
|
/***/ },
|
|
6558
6570
|
|
|
@@ -6808,7 +6820,7 @@ const source_1 = __webpack_require__(8745);
|
|
|
6808
6820
|
const visibility_1 = __webpack_require__(6364);
|
|
6809
6821
|
const util_1 = __webpack_require__(4992);
|
|
6810
6822
|
const dom_1 = __webpack_require__(394);
|
|
6811
|
-
exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(32 /* State.index */, (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)((0, source_1.str)('[#'), (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.inits)([inline_1.inline, exports.signature]), ']', [[']', 1]])))), (0, source_1.str)(']'), false, [3 |
|
|
6823
|
+
exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(32 /* State.index */, (0, combinator_1.fmap)((0, indexee_1.indexee)((0, combinator_1.surround)((0, source_1.str)('[#'), (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.inits)([inline_1.inline, exports.signature]), ']', [[']', 1]])))), (0, source_1.str)(']'), false, [3 | 4 /* Backtrack.common */], ([, bs], context) => context.linebreak === 0 && (0, visibility_1.trimBlankNodeEnd)(bs).length > 0 ? new parser_1.List([new parser_1.Data((0, dom_1.html)('a', {
|
|
6812
6824
|
'data-index': dataindex(bs)
|
|
6813
6825
|
}, (0, dom_1.defrag)((0, util_1.unwrap)(bs))))]) : undefined, undefined)), ns => {
|
|
6814
6826
|
if (ns.length === 1) {
|
|
@@ -6823,7 +6835,7 @@ exports.index = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(32 /*
|
|
|
6823
6835
|
return ns;
|
|
6824
6836
|
}
|
|
6825
6837
|
})));
|
|
6826
|
-
exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|', (0, combinator_1.surround)((0, source_1.str)(/\|(?!\\?\s)/y), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, (0, combinator_1.some)(source_1.txt, /(?:[$"`\[\](){}
|
|
6838
|
+
exports.signature = (0, combinator_1.lazy)(() => (0, combinator_1.validate)('|', (0, combinator_1.surround)((0, source_1.str)(/\|(?!\\?\s)/y), (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, (0, combinator_1.some)(source_1.txt, /(?:[$"`\[\](){}<>()[]{}|])/y)]), ']'), /(?=])/y, false, [3 | 16 /* Backtrack.escapable */], ([, ns], context) => {
|
|
6827
6839
|
const index = (0, indexee_1.identity)('index', undefined, ns.foldl((acc, {
|
|
6828
6840
|
value
|
|
6829
6841
|
}) => acc + value, ''))?.slice(7);
|
|
@@ -7028,7 +7040,7 @@ const source_1 = __webpack_require__(8745);
|
|
|
7028
7040
|
const dom_1 = __webpack_require__(394);
|
|
7029
7041
|
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]))/y);
|
|
7030
7042
|
exports.segment = (0, combinator_1.clear)((0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']'), body]));
|
|
7031
|
-
exports.label = (0, combinator_1.constraint)(16 /* State.label */, (0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']', false, [1 |
|
|
7043
|
+
exports.label = (0, combinator_1.constraint)(16 /* State.label */, (0, combinator_1.fmap)((0, combinator_1.union)([(0, combinator_1.surround)('[', body, ']', false, [1 | 4 /* Backtrack.common */]), body]), ([{
|
|
7032
7044
|
value
|
|
7033
7045
|
}]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('a', {
|
|
7034
7046
|
class: 'label',
|
|
@@ -7075,7 +7087,7 @@ const dom_1 = __webpack_require__(394);
|
|
|
7075
7087
|
// All syntax surrounded by square brackets shouldn't contain line breaks.
|
|
7076
7088
|
exports.placeholder = (0, combinator_1.lazy)(() => (0, combinator_1.surround)(
|
|
7077
7089
|
// ^はabbrで使用済みだが^:などのようにして分離使用可能
|
|
7078
|
-
(0, source_1.str)(/\[[:^|]/y), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])))), (0, source_1.str)(']'), false, [3 |
|
|
7090
|
+
(0, source_1.str)(/\[[:^|]/y), (0, combinator_1.precedence)(1, (0, combinator_1.recursion)(4 /* Recursion.inline */, (0, visibility_1.tightStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])))), (0, source_1.str)(']'), false, [3 | 4 /* Backtrack.common */], (_, context) => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
|
|
7079
7091
|
class: 'invalid',
|
|
7080
7092
|
...(0, util_1.invalid)('extension', 'syntax', `Invalid start symbol or linebreak`)
|
|
7081
7093
|
}, context.source.slice(context.position - context.range, context.position)))]), ([as, bs]) => bs && as.import(bs)));
|
|
@@ -7189,7 +7201,7 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
7189
7201
|
const source_1 = __webpack_require__(8745);
|
|
7190
7202
|
const util_1 = __webpack_require__(4992);
|
|
7191
7203
|
const dom_1 = __webpack_require__(394);
|
|
7192
|
-
exports.unsafehtmlentity = (0, combinator_1.surround)((0, source_1.str)('&'), (0, source_1.str)(/[0-9A-Za-z]+/y), (0, source_1.str)(';'), false, [3 |
|
|
7204
|
+
exports.unsafehtmlentity = (0, combinator_1.surround)((0, source_1.str)('&'), (0, source_1.str)(/[0-9A-Za-z]+/y), (0, source_1.str)(';'), false, [3 | 8 /* Backtrack.unescapable */], ([as, bs, cs]) => new parser_1.List([new parser_1.Data(parser(as.head.value + bs.head.value + cs.head.value))]), ([as, bs]) => new parser_1.List([new parser_1.Data(as.head.value + (bs?.head?.value ?? ''))]));
|
|
7193
7205
|
exports.htmlentity = (0, combinator_1.fmap)((0, combinator_1.union)([exports.unsafehtmlentity]), ([{
|
|
7194
7206
|
value
|
|
7195
7207
|
}]) => new parser_1.List([length === 1 || value.at(-1) !== ';' ? new parser_1.Data(value) : new parser_1.Data((0, dom_1.html)('span', {
|
|
@@ -7278,15 +7290,16 @@ const optspec = {
|
|
|
7278
7290
|
rel: ['nofollow']
|
|
7279
7291
|
};
|
|
7280
7292
|
Object.setPrototypeOf(optspec, null);
|
|
7281
|
-
exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */, (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.subsequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])), ']', true, [3 |
|
|
7293
|
+
exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /* State.link */, (0, combinator_1.precedence)(1, (0, combinator_1.state)(251 /* State.linkers */, (0, combinator_1.bind)((0, combinator_1.subsequence)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, visibility_1.trimBlankStart)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ']', [[']', 1]])), ']', true, [3 | 4 /* Backtrack.common */ | 64 /* Backtrack.link */, 2 | 32 /* Backtrack.ruby */], ([, ns = new parser_1.List()], context) => {
|
|
7294
|
+
if (context.linebreak !== 0) {
|
|
7295
|
+
const head = context.position - context.range;
|
|
7296
|
+
return void (0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */ | 32 /* Backtrack.ruby */, head);
|
|
7297
|
+
}
|
|
7298
|
+
return ns.push(new parser_1.Data("\u001F" /* Command.Separator */)) && ns;
|
|
7299
|
+
})),
|
|
7282
7300
|
// `{ `と`{`で個別にバックトラックが発生し+1nされる。
|
|
7283
7301
|
// 自己再帰的にパースしてもオプションの不要なパースによる計算量の増加により相殺される。
|
|
7284
|
-
(0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), / ?}/y, false, [
|
|
7285
|
-
if (!bs) return;
|
|
7286
|
-
const head = context.position - context.range;
|
|
7287
|
-
(0, combinator_1.setBacktrack)(context, [2 | 16 /* Backtrack.link */], head);
|
|
7288
|
-
return as.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && as;
|
|
7289
|
-
}))]), ([{
|
|
7302
|
+
(0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([exports.uri, (0, combinator_1.some)(exports.option)]), / ?}/y, false, [], undefined, ([as, bs]) => bs && as.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && as))]), ([{
|
|
7290
7303
|
value: content
|
|
7291
7304
|
}, {
|
|
7292
7305
|
value: params = undefined
|
|
@@ -7295,7 +7308,7 @@ exports.textlink = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(8 /
|
|
|
7295
7308
|
content.pop();
|
|
7296
7309
|
if (params === undefined) {
|
|
7297
7310
|
const head = context.position - context.range;
|
|
7298
|
-
return void (0, combinator_1.setBacktrack)(context,
|
|
7311
|
+
return void (0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */, head);
|
|
7299
7312
|
}
|
|
7300
7313
|
} else {
|
|
7301
7314
|
params = content;
|
|
@@ -7460,7 +7473,7 @@ const source_1 = __webpack_require__(8745);
|
|
|
7460
7473
|
const util_1 = __webpack_require__(4992);
|
|
7461
7474
|
const dom_1 = __webpack_require__(394);
|
|
7462
7475
|
const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![a-z])|:\/\//i;
|
|
7463
|
-
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 |
|
|
7476
|
+
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, /\s?\$|[`"{}\n]/y), (0, combinator_1.precedence)(4, bracket)]))), /\$(?![-0-9A-Za-z])/y, false, [3 | 16 /* Backtrack.escapable */])]), ({
|
|
7464
7477
|
context: {
|
|
7465
7478
|
source,
|
|
7466
7479
|
caches: {
|
|
@@ -7506,12 +7519,13 @@ const optspec = {
|
|
|
7506
7519
|
rel: undefined
|
|
7507
7520
|
};
|
|
7508
7521
|
Object.setPrototypeOf(optspec, null);
|
|
7509
|
-
exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.open)('!', (0, combinator_1.bind)((0, combinator_1.fmap)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']')), ']', true, [3 |
|
|
7510
|
-
if (
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7522
|
+
exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* State.media */, (0, combinator_1.open)('!', (0, combinator_1.bind)((0, combinator_1.fmap)((0, combinator_1.tails)([(0, combinator_1.dup)((0, combinator_1.surround)('[', (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, bracket, source_1.txt]), ']')), ']', true, [3 | 16 /* Backtrack.escapable */, 2 | 32 /* Backtrack.ruby */], ([, ns = new parser_1.List()], context) => {
|
|
7523
|
+
if (context.linebreak !== 0) {
|
|
7524
|
+
const head = context.position - context.range;
|
|
7525
|
+
return void (0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */ | 32 /* Backtrack.ruby */, head);
|
|
7526
|
+
}
|
|
7527
|
+
return ns;
|
|
7528
|
+
})), (0, combinator_1.dup)((0, combinator_1.surround)(/{(?![{}])/y, (0, combinator_1.inits)([link_1.uri, (0, combinator_1.some)(option)]), / ?}/y, false, [], undefined, ([as, bs]) => bs && as.import(bs).push(new parser_1.Data("\u0018" /* Command.Cancel */)) && as))]), nodes => nodes.length === 1 ? new parser_1.List([new parser_1.Data(new parser_1.List([new parser_1.Data('')])), nodes.delete(nodes.head)]) : new parser_1.List([new parser_1.Data(new parser_1.List([new parser_1.Data(nodes.head.value.foldl((acc, {
|
|
7515
7529
|
value
|
|
7516
7530
|
}) => acc + value, ''))])), nodes.delete(nodes.last)])), ([{
|
|
7517
7531
|
value: [{
|
|
@@ -7557,7 +7571,7 @@ exports.media = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(4 /* S
|
|
|
7557
7571
|
target: '_blank'
|
|
7558
7572
|
}, [el]))]);
|
|
7559
7573
|
}))));
|
|
7560
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.recursion)(6 /* Recursion.terminal */, (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, [3 |
|
|
7574
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.recursion)(6 /* Recursion.terminal */, (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, [3 | 16 /* Backtrack.escapable */], undefined, () => new parser_1.List()), (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, [3 | 16 /* Backtrack.escapable */], undefined, () => new parser_1.List()), (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, [3 | 16 /* Backtrack.escapable */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.some)((0, combinator_1.union)([htmlentity_1.unsafehtmlentity, source_1.txt]), '"')), (0, source_1.str)('"'), true, [3 | 16 /* Backtrack.escapable */], undefined, () => new parser_1.List())])));
|
|
7561
7575
|
const option = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, combinator_1.open)(/ /y, (0, source_1.str)(/[1-9][0-9]*/y)), (0, source_1.str)(/[x:]/y), (0, source_1.str)(/[1-9][0-9]*(?=[ }])/y), false, [], ([[{
|
|
7562
7576
|
value: a
|
|
7563
7577
|
}], [{
|
|
@@ -7611,7 +7625,7 @@ const source_1 = __webpack_require__(8745);
|
|
|
7611
7625
|
const visibility_1 = __webpack_require__(6364);
|
|
7612
7626
|
const util_1 = __webpack_require__(4992);
|
|
7613
7627
|
const dom_1 = __webpack_require__(394);
|
|
7614
|
-
exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64 /* State.reference */, (0, combinator_1.surround)((0, source_1.str)('[['), (0, combinator_1.precedence)(1, (0, combinator_1.state)(128 /* State.annotation */ | 64 /* State.reference */, (0, combinator_1.subsequence)([abbr, (0, visibility_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))]))), ']]', false, [1 |
|
|
7628
|
+
exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64 /* State.reference */, (0, combinator_1.surround)((0, source_1.str)('[['), (0, combinator_1.precedence)(1, (0, combinator_1.state)(128 /* State.annotation */ | 64 /* State.reference */, (0, combinator_1.subsequence)([abbr, (0, visibility_1.trimBlankStart)((0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]))]))), ']]', false, [1 | 4 /* Backtrack.common */, 3 | 128 /* Backtrack.doublebracket */], ([, ns], context) => {
|
|
7615
7629
|
const {
|
|
7616
7630
|
position,
|
|
7617
7631
|
range = 0,
|
|
@@ -7621,7 +7635,7 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
|
|
|
7621
7635
|
return new parser_1.List([new parser_1.Data((0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, dom_1.defrag)((0, util_1.unwrap)((0, visibility_1.trimBlankNodeEnd)(ns))))]))]);
|
|
7622
7636
|
} else {
|
|
7623
7637
|
const head = position - range;
|
|
7624
|
-
(0, combinator_1.setBacktrack)(context,
|
|
7638
|
+
(0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */, head, 2);
|
|
7625
7639
|
}
|
|
7626
7640
|
}, ([as, bs], context) => {
|
|
7627
7641
|
if (!bs) return;
|
|
@@ -7634,9 +7648,9 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
|
|
|
7634
7648
|
} = context;
|
|
7635
7649
|
const head = position - range;
|
|
7636
7650
|
if (source[position] !== ']') {
|
|
7637
|
-
(0, combinator_1.setBacktrack)(context,
|
|
7651
|
+
(0, combinator_1.setBacktrack)(context, 2 | 4 /* Backtrack.common */, head, 2);
|
|
7638
7652
|
} else if (linebreak !== 0) {
|
|
7639
|
-
(0, combinator_1.setBacktrack)(context,
|
|
7653
|
+
(0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */ | 32 /* Backtrack.ruby */, head, 2);
|
|
7640
7654
|
} else {
|
|
7641
7655
|
if (state & 128 /* State.annotation */) {
|
|
7642
7656
|
bs.push(new parser_1.Data(source[position]));
|
|
@@ -7644,23 +7658,23 @@ exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.constraint)(64
|
|
|
7644
7658
|
context.position += 1;
|
|
7645
7659
|
let result;
|
|
7646
7660
|
if (source[context.position] !== '{') {
|
|
7647
|
-
(0, combinator_1.setBacktrack)(context,
|
|
7661
|
+
(0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */, head + 1);
|
|
7648
7662
|
result = new parser_1.List();
|
|
7649
7663
|
} else {
|
|
7650
|
-
result = !(0, combinator_1.isBacktrack)(context,
|
|
7664
|
+
result = !(0, combinator_1.isBacktrack)(context, 1 | 64 /* Backtrack.link */) ? (0, link_1.textlink)({
|
|
7651
7665
|
context
|
|
7652
7666
|
}) : undefined;
|
|
7653
7667
|
context.range = range;
|
|
7654
7668
|
if (!result) {
|
|
7655
|
-
(0, combinator_1.setBacktrack)(context,
|
|
7669
|
+
(0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */, head + 1);
|
|
7656
7670
|
result = new parser_1.List();
|
|
7657
7671
|
}
|
|
7658
7672
|
}
|
|
7659
7673
|
if (context.position === source.length) {
|
|
7660
|
-
(0, combinator_1.setBacktrack)(context,
|
|
7674
|
+
(0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */, head);
|
|
7661
7675
|
} else {
|
|
7662
7676
|
const next = (0, combinator_1.surround)('', (0, combinator_1.some)(inline_1.inline, ']', [[']', 1]]), (0, source_1.str)(']'), true, [], ([, cs = new parser_1.List(), ds]) => cs.import(ds), ([, cs = new parser_1.List()]) => {
|
|
7663
|
-
(0, combinator_1.setBacktrack)(context,
|
|
7677
|
+
(0, combinator_1.setBacktrack)(context, 2 | 64 /* Backtrack.link */, head);
|
|
7664
7678
|
return cs;
|
|
7665
7679
|
})({
|
|
7666
7680
|
context
|
|
@@ -7758,17 +7772,17 @@ const source_1 = __webpack_require__(8745);
|
|
|
7758
7772
|
const visibility_1 = __webpack_require__(6364);
|
|
7759
7773
|
const util_1 = __webpack_require__(4992);
|
|
7760
7774
|
const dom_1 = __webpack_require__(394);
|
|
7761
|
-
exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.bind)((0, combinator_1.inits)([(0, combinator_1.dup)((0, combinator_1.surround)('[', text, ']', false, [1 |
|
|
7775
|
+
exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.bind)((0, combinator_1.inits)([(0, combinator_1.dup)((0, combinator_1.surround)('[', text, ']', false, [1 | 4 /* Backtrack.common */, 3 | 32 /* Backtrack.ruby */], ([, ns]) => {
|
|
7762
7776
|
ns && ns.last?.value === '' && ns.pop();
|
|
7763
7777
|
return (0, visibility_1.isTightNodeStart)(ns) ? ns : undefined;
|
|
7764
|
-
})), (0, combinator_1.dup)((0, combinator_1.surround)('(', text, ')', false, [
|
|
7778
|
+
})), (0, combinator_1.dup)((0, combinator_1.surround)('(', text, ')', false, [3 | 32 /* Backtrack.ruby */]))]), ([{
|
|
7765
7779
|
value: texts
|
|
7766
7780
|
}, {
|
|
7767
7781
|
value: rubies = undefined
|
|
7768
7782
|
} = {}], context) => {
|
|
7769
7783
|
if (rubies === undefined) {
|
|
7770
7784
|
const head = context.position - context.range;
|
|
7771
|
-
return void (0, combinator_1.setBacktrack)(context,
|
|
7785
|
+
return void (0, combinator_1.setBacktrack)(context, 2 | 32 /* Backtrack.ruby */, head);
|
|
7772
7786
|
}
|
|
7773
7787
|
switch (true) {
|
|
7774
7788
|
case texts.length >= rubies.length:
|
|
@@ -7791,7 +7805,7 @@ exports.ruby = (0, combinator_1.lazy)(() => (0, combinator_1.bind)((0, combinato
|
|
|
7791
7805
|
}, acc) => value + ' ' + acc, '').trim())), new parser_1.Data((0, dom_1.html)('rp', ')'))])))))]);
|
|
7792
7806
|
}
|
|
7793
7807
|
}));
|
|
7794
|
-
const delimiter = /[$"`\[\](){}
|
|
7808
|
+
const delimiter = /[$"`\[\](){}<>()[]{}|]|\\?\n/y;
|
|
7795
7809
|
const text = input => {
|
|
7796
7810
|
const {
|
|
7797
7811
|
context
|
|
@@ -7900,13 +7914,13 @@ const combinator_1 = __webpack_require__(3484);
|
|
|
7900
7914
|
const source_1 = __webpack_require__(8745);
|
|
7901
7915
|
const util_1 = __webpack_require__(4992);
|
|
7902
7916
|
const dom_1 = __webpack_require__(394);
|
|
7903
|
-
exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{{'), (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), (0, source_1.str)('}}'), true, [
|
|
7917
|
+
exports.template = (0, combinator_1.lazy)(() => (0, combinator_1.surround)((0, source_1.str)('{{'), (0, combinator_1.precedence)(1, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), (0, source_1.str)('}}'), true, [], ([as, bs = new parser_1.List(), cs]) => new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
|
|
7904
7918
|
class: 'template'
|
|
7905
7919
|
}, (0, dom_1.defrag)((0, util_1.unwrap)(as.import(bs).import(cs)))))]), ([, bs], context) => bs && new parser_1.List([new parser_1.Data((0, dom_1.html)('span', {
|
|
7906
7920
|
class: 'invalid',
|
|
7907
7921
|
...(0, util_1.invalid)('template', 'syntax', `Missing the closing symbol "}}"`)
|
|
7908
7922
|
}, context.source.slice(context.position - context.range, context.position)))])));
|
|
7909
|
-
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')')), (0, source_1.str)(')'), true, [3 |
|
|
7923
|
+
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, combinator_1.surround)((0, source_1.str)('('), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ')')), (0, source_1.str)(')'), true, [3 | 16 /* Backtrack.escapable */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), ']')), (0, source_1.str)(']'), true, [3 | 16 /* Backtrack.escapable */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)((0, combinator_1.union)([bracket, source_1.escsource]), '}')), (0, source_1.str)('}'), true, [3 | 16 /* Backtrack.escapable */], undefined, () => new parser_1.List()), (0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.precedence)(2, (0, combinator_1.recursion)(6 /* Recursion.terminal */, (0, combinator_1.some)(source_1.escsource, /["\n]/y, [['"', 2], ['\n', 3]]))), (0, source_1.str)('"'), true, [3 | 16 /* Backtrack.escapable */], undefined, ([as, bs]) => bs && as.import(bs))]));
|
|
7910
7924
|
|
|
7911
7925
|
/***/ },
|
|
7912
7926
|
|