@rohal12/spindle 0.64.9 → 0.64.10
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/dist/pkg/format.js +1 -1
- package/dist/pkg/headless.js +243 -157
- package/dist/pkg/story-variables.js +233 -143
- package/package.json +1 -1
- package/src/markup/grammar-shared.ts +2 -1
- package/src/markup/html-elements.ts +16 -0
- package/src/markup/render.tsx +3 -2
- package/src/markup/spindle.peggy +16 -8
- package/src/parser.ts +2 -1
- package/src/store.ts +6 -0
- package/src/story-api.ts +9 -3
- package/src/twine-editor/highlight.ts +7 -9
- package/src/utils/stable-key.ts +5 -6
- package/types/index.d.ts +5 -2
package/dist/pkg/headless.js
CHANGED
|
@@ -9570,6 +9570,22 @@ function useAction(opts) {
|
|
|
9570
9570
|
]);
|
|
9571
9571
|
return disabled ? "" : id;
|
|
9572
9572
|
}
|
|
9573
|
+
// src/markup/html-elements.ts
|
|
9574
|
+
/** HTML raw-text bodies preserve character references as written. */
|
|
9575
|
+
var RAW_TEXT_ELEMENTS = /* @__PURE__ */ new Set([
|
|
9576
|
+
"script",
|
|
9577
|
+
"style",
|
|
9578
|
+
"xmp",
|
|
9579
|
+
"iframe",
|
|
9580
|
+
"noembed",
|
|
9581
|
+
"noframes"
|
|
9582
|
+
]);
|
|
9583
|
+
/** Text-only bodies recognize their own end tag, never nested HTML tags. */
|
|
9584
|
+
var HTML_TEXT_ELEMENTS$1 = /* @__PURE__ */ new Set([
|
|
9585
|
+
...RAW_TEXT_ELEMENTS,
|
|
9586
|
+
"textarea",
|
|
9587
|
+
"title"
|
|
9588
|
+
]);
|
|
9573
9589
|
// src/markup/tokens.ts
|
|
9574
9590
|
/** Variable sigils: story ($), temporary (_), local (@), transient (%). */
|
|
9575
9591
|
var SIGIL_SCOPES$1 = {
|
|
@@ -9599,12 +9615,13 @@ function withSelectors$1(target, from) {
|
|
|
9599
9615
|
*/
|
|
9600
9616
|
var grammar_shared_default = {
|
|
9601
9617
|
SIGIL_SCOPES: SIGIL_SCOPES$1,
|
|
9602
|
-
withSelectors: withSelectors$1
|
|
9618
|
+
withSelectors: withSelectors$1,
|
|
9619
|
+
HTML_TEXT_ELEMENTS: HTML_TEXT_ELEMENTS$1
|
|
9603
9620
|
};
|
|
9604
9621
|
// src/markup/spindle.peggy
|
|
9605
9622
|
var LB = String.fromCharCode(123);
|
|
9606
9623
|
var RB = String.fromCharCode(125);
|
|
9607
|
-
var { SIGIL_SCOPES, withSelectors } = grammar_shared_default;
|
|
9624
|
+
var { SIGIL_SCOPES, withSelectors, HTML_TEXT_ELEMENTS } = grammar_shared_default;
|
|
9608
9625
|
var VOID_TAGS = /* @__PURE__ */ new Set([
|
|
9609
9626
|
"area",
|
|
9610
9627
|
"base",
|
|
@@ -10146,82 +10163,96 @@ function peg$parse(input, options) {
|
|
|
10146
10163
|
return joinText(items);
|
|
10147
10164
|
}
|
|
10148
10165
|
function peg$f1() {
|
|
10149
|
-
return !
|
|
10166
|
+
return !htmlTextTag;
|
|
10150
10167
|
}
|
|
10151
10168
|
function peg$f2() {
|
|
10152
|
-
return !
|
|
10169
|
+
return !htmlTextTag;
|
|
10153
10170
|
}
|
|
10154
|
-
function peg$f3(
|
|
10155
|
-
return
|
|
10171
|
+
function peg$f3() {
|
|
10172
|
+
return !htmlTextTag;
|
|
10156
10173
|
}
|
|
10157
10174
|
function peg$f4() {
|
|
10175
|
+
return !textMode && !htmlTextTag;
|
|
10176
|
+
}
|
|
10177
|
+
function peg$f5() {
|
|
10178
|
+
return !textMode && !htmlTextTag;
|
|
10179
|
+
}
|
|
10180
|
+
function peg$f6(tag) {
|
|
10181
|
+
if (!tag.isSelfClose && HTML_TEXT_ELEMENTS.has(tag.lower)) htmlTextTag = tag.lower;
|
|
10182
|
+
return tag;
|
|
10183
|
+
}
|
|
10184
|
+
function peg$f7() {
|
|
10158
10185
|
return !textMode;
|
|
10159
10186
|
}
|
|
10160
|
-
function peg$
|
|
10187
|
+
function peg$f8(tag) {
|
|
10188
|
+
return !htmlTextTag || tag.lower === htmlTextTag;
|
|
10189
|
+
}
|
|
10190
|
+
function peg$f9(tag) {
|
|
10191
|
+
htmlTextTag = "";
|
|
10161
10192
|
return VOID_TAGS.has(tag.lower) ? null : tag;
|
|
10162
10193
|
}
|
|
10163
|
-
function peg$
|
|
10194
|
+
function peg$f10(tag) {
|
|
10164
10195
|
rawName = tag.lower;
|
|
10165
10196
|
return tag.kind === "open" && hooks.isRaw(rawName);
|
|
10166
10197
|
}
|
|
10167
|
-
function peg$
|
|
10198
|
+
function peg$f11(tag, b) {
|
|
10168
10199
|
return b;
|
|
10169
10200
|
}
|
|
10170
|
-
function peg$
|
|
10201
|
+
function peg$f12(tag, body) {
|
|
10171
10202
|
return body ? [tag, body] : tag;
|
|
10172
10203
|
}
|
|
10173
|
-
function peg$
|
|
10204
|
+
function peg$f13(tag) {
|
|
10174
10205
|
return tag.kind === "close";
|
|
10175
10206
|
}
|
|
10176
|
-
function peg$
|
|
10207
|
+
function peg$f14(tag) {
|
|
10177
10208
|
return tag;
|
|
10178
10209
|
}
|
|
10179
|
-
function peg$
|
|
10210
|
+
function peg$f15() {
|
|
10180
10211
|
return !textMode;
|
|
10181
10212
|
}
|
|
10182
|
-
function peg$
|
|
10213
|
+
function peg$f16(tag) {
|
|
10183
10214
|
return tag;
|
|
10184
10215
|
}
|
|
10185
|
-
function peg$
|
|
10216
|
+
function peg$f17(start) {
|
|
10186
10217
|
return skipTo(hooks.rawBodyEnd(input, start, rawName));
|
|
10187
10218
|
}
|
|
10188
|
-
function peg$
|
|
10219
|
+
function peg$f18(start) {
|
|
10189
10220
|
return skipEnd - offset();
|
|
10190
10221
|
}
|
|
10191
|
-
function peg$
|
|
10222
|
+
function peg$f19(start, body, end) {
|
|
10192
10223
|
const loc = {
|
|
10193
10224
|
start: { offset: start },
|
|
10194
10225
|
end: { offset: start + body.length }
|
|
10195
10226
|
};
|
|
10196
10227
|
return [body ? lexeme("text", loc, { value: body }) : null, end];
|
|
10197
10228
|
}
|
|
10198
|
-
function peg$
|
|
10229
|
+
function peg$f20() {
|
|
10199
10230
|
return completionMode;
|
|
10200
10231
|
}
|
|
10201
|
-
function peg$
|
|
10232
|
+
function peg$f21(body) {
|
|
10202
10233
|
return lexeme("text", location(), { value: body });
|
|
10203
10234
|
}
|
|
10204
|
-
function peg$
|
|
10235
|
+
function peg$f22() {
|
|
10205
10236
|
return offset();
|
|
10206
10237
|
}
|
|
10207
|
-
function peg$
|
|
10238
|
+
function peg$f23(value) {
|
|
10208
10239
|
return lexeme("text", location(), { value });
|
|
10209
10240
|
}
|
|
10210
|
-
function peg$
|
|
10241
|
+
function peg$f24() {
|
|
10211
10242
|
return completionMode || offset() <= lastCommentClose;
|
|
10212
10243
|
}
|
|
10213
|
-
function peg$
|
|
10244
|
+
function peg$f25(value) {
|
|
10214
10245
|
const node = lexeme("text", location(), { value });
|
|
10215
10246
|
node.comment = true;
|
|
10216
10247
|
return node;
|
|
10217
10248
|
}
|
|
10218
|
-
function peg$
|
|
10249
|
+
function peg$f26(bs) {
|
|
10219
10250
|
return bs.length % 2 === 1;
|
|
10220
10251
|
}
|
|
10221
|
-
function peg$
|
|
10252
|
+
function peg$f27(bs, c) {
|
|
10222
10253
|
return c;
|
|
10223
10254
|
}
|
|
10224
|
-
function peg$
|
|
10255
|
+
function peg$f28(bs, brace) {
|
|
10225
10256
|
const loc = location();
|
|
10226
10257
|
const next = input.charAt(loc.end.offset);
|
|
10227
10258
|
if (textMode) {
|
|
@@ -10238,48 +10269,48 @@ function peg$parse(input, options) {
|
|
|
10238
10269
|
escaped.escape = true;
|
|
10239
10270
|
return bs.length > 1 ? [before, escaped] : escaped;
|
|
10240
10271
|
}
|
|
10241
|
-
function peg$
|
|
10272
|
+
function peg$f29() {
|
|
10242
10273
|
return lexeme("text", location(), { value: LB });
|
|
10243
10274
|
}
|
|
10244
|
-
function peg$
|
|
10245
|
-
return !textMode;
|
|
10275
|
+
function peg$f30() {
|
|
10276
|
+
return !textMode && !htmlTextTag;
|
|
10246
10277
|
}
|
|
10247
|
-
function peg$
|
|
10278
|
+
function peg$f31() {
|
|
10248
10279
|
return lexeme("text", location(), { value: "<" });
|
|
10249
10280
|
}
|
|
10250
|
-
function peg$
|
|
10281
|
+
function peg$f32() {
|
|
10251
10282
|
return lexeme("text", location(), { value: "[" });
|
|
10252
10283
|
}
|
|
10253
|
-
function peg$
|
|
10284
|
+
function peg$f33() {
|
|
10254
10285
|
return !textMode;
|
|
10255
10286
|
}
|
|
10256
|
-
function peg$
|
|
10287
|
+
function peg$f34(ss, s, at, inner) {
|
|
10257
10288
|
const link = lexeme("link", location(), parseLink(inner, at, (separator) => linkSeparatorIndex(inner, at, separator)));
|
|
10258
10289
|
link.selectorSpan = selectorSpan(s, ss, at);
|
|
10259
10290
|
return withSelectors(link, s);
|
|
10260
10291
|
}
|
|
10261
|
-
function peg$
|
|
10292
|
+
function peg$f35() {
|
|
10262
10293
|
return !textMode;
|
|
10263
10294
|
}
|
|
10264
|
-
function peg$
|
|
10295
|
+
function peg$f36() {
|
|
10265
10296
|
fail("Unclosed link: [[ without ]]", location(), "unclosed-link");
|
|
10266
10297
|
}
|
|
10267
|
-
function peg$
|
|
10298
|
+
function peg$f37(parts) {
|
|
10268
10299
|
return selectorsOf(parts);
|
|
10269
10300
|
}
|
|
10270
|
-
function peg$
|
|
10301
|
+
function peg$f38() {
|
|
10271
10302
|
return NO_SELECTORS;
|
|
10272
10303
|
}
|
|
10273
|
-
function peg$
|
|
10304
|
+
function peg$f39(s, end) {
|
|
10274
10305
|
return {
|
|
10275
10306
|
...s,
|
|
10276
10307
|
end
|
|
10277
10308
|
};
|
|
10278
10309
|
}
|
|
10279
|
-
function peg$
|
|
10310
|
+
function peg$f40(prefix, name) {
|
|
10280
10311
|
return [prefix, name];
|
|
10281
10312
|
}
|
|
10282
|
-
function peg$
|
|
10313
|
+
function peg$f41(ss, s, sigil, nameStart, name) {
|
|
10283
10314
|
const variable = lexeme("variable", location(), {
|
|
10284
10315
|
name,
|
|
10285
10316
|
nameStart,
|
|
@@ -10289,7 +10320,7 @@ function peg$parse(input, options) {
|
|
|
10289
10320
|
variable.selectorSpan = selectorSpan(s, ss, nameStart - 1);
|
|
10290
10321
|
return withSelectors(variable, s);
|
|
10291
10322
|
}
|
|
10292
|
-
function peg$
|
|
10323
|
+
function peg$f42(ss, s, after, expression) {
|
|
10293
10324
|
const node = lexeme("expression", location(), {
|
|
10294
10325
|
expression,
|
|
10295
10326
|
expressionStart: after,
|
|
@@ -10298,33 +10329,33 @@ function peg$parse(input, options) {
|
|
|
10298
10329
|
node.selectorSpan = selectorSpan(s, ss, after);
|
|
10299
10330
|
return withSelectors(node, s);
|
|
10300
10331
|
}
|
|
10301
|
-
function peg$
|
|
10332
|
+
function peg$f43() {
|
|
10302
10333
|
fail("Unclosed {" + input.substr(location().end.offset, 1) + "…: no } ends it", location(), "unclosed-expression");
|
|
10303
10334
|
}
|
|
10304
|
-
function peg$
|
|
10335
|
+
function peg$f44(start) {
|
|
10305
10336
|
const end = hooks.closeBrace(input, start, start);
|
|
10306
10337
|
return skipTo(end < 0 && completionMode ? input.length : end);
|
|
10307
10338
|
}
|
|
10308
|
-
function peg$
|
|
10339
|
+
function peg$f45(start) {
|
|
10309
10340
|
return skipEnd - offset();
|
|
10310
10341
|
}
|
|
10311
|
-
function peg$
|
|
10342
|
+
function peg$f46(start, code) {
|
|
10312
10343
|
return code;
|
|
10313
10344
|
}
|
|
10314
|
-
function peg$
|
|
10345
|
+
function peg$f47() {
|
|
10315
10346
|
return completionMode;
|
|
10316
10347
|
}
|
|
10317
|
-
function peg$
|
|
10348
|
+
function peg$f48(ss, s, start, close, name, nameEnd) {
|
|
10318
10349
|
const end = hooks.closeBrace(input, nameEnd, start);
|
|
10319
10350
|
return skipTo(end < 0 && completionMode ? input.length : end);
|
|
10320
10351
|
}
|
|
10321
|
-
function peg$
|
|
10352
|
+
function peg$f49(ss, s, start, close, name, nameEnd) {
|
|
10322
10353
|
return skipEnd - offset();
|
|
10323
10354
|
}
|
|
10324
|
-
function peg$
|
|
10355
|
+
function peg$f50(ss, s, start, close, name, nameEnd, args) {
|
|
10325
10356
|
return args;
|
|
10326
10357
|
}
|
|
10327
|
-
function peg$
|
|
10358
|
+
function peg$f51(ss, s, start, close, name, nameEnd, tail) {
|
|
10328
10359
|
const loc = location();
|
|
10329
10360
|
const lower = name.toLowerCase();
|
|
10330
10361
|
const tag = lexeme("macro", loc, {
|
|
@@ -10350,19 +10381,19 @@ function peg$parse(input, options) {
|
|
|
10350
10381
|
}
|
|
10351
10382
|
return tag;
|
|
10352
10383
|
}
|
|
10353
|
-
function peg$
|
|
10384
|
+
function peg$f52(s) {
|
|
10354
10385
|
fail("A closing tag starts with a letter after {/", location(), "invalid-closer");
|
|
10355
10386
|
}
|
|
10356
|
-
function peg$
|
|
10387
|
+
function peg$f53(value) {
|
|
10357
10388
|
return EMAIL_AUTOLINK.test(value);
|
|
10358
10389
|
}
|
|
10359
|
-
function peg$
|
|
10390
|
+
function peg$f54(value) {
|
|
10360
10391
|
return lexeme("text", location(), { value });
|
|
10361
10392
|
}
|
|
10362
|
-
function peg$
|
|
10393
|
+
function peg$f55(value) {
|
|
10363
10394
|
return lexeme("text", location(), { value });
|
|
10364
10395
|
}
|
|
10365
|
-
function peg$
|
|
10396
|
+
function peg$f56(tagStart, tag, list, slash) {
|
|
10366
10397
|
const lower = tag.toLowerCase();
|
|
10367
10398
|
return lexeme("html", location(), {
|
|
10368
10399
|
tag,
|
|
@@ -10375,7 +10406,7 @@ function peg$parse(input, options) {
|
|
|
10375
10406
|
isSelfClose: !!slash || VOID_TAGS.has(lower)
|
|
10376
10407
|
});
|
|
10377
10408
|
}
|
|
10378
|
-
function peg$
|
|
10409
|
+
function peg$f57(tag, bad) {
|
|
10379
10410
|
const c = input.charAt(bad);
|
|
10380
10411
|
if (!c) fail("Unclosed tag <" + tag + ": no > ends it (write < for a < that starts no tag)", location(), "unclosed-tag");
|
|
10381
10412
|
const at = {
|
|
@@ -10393,7 +10424,7 @@ function peg$parse(input, options) {
|
|
|
10393
10424
|
};
|
|
10394
10425
|
fail("Unexpected " + JSON.stringify(c) + " in the tag <" + tag + ">: expected an attribute, or > to end the tag", at, "unexpected-character");
|
|
10395
10426
|
}
|
|
10396
|
-
function peg$
|
|
10427
|
+
function peg$f58(tagStart, tag) {
|
|
10397
10428
|
return lexeme("html", location(), {
|
|
10398
10429
|
tag,
|
|
10399
10430
|
lower: tag.toLowerCase(),
|
|
@@ -10405,14 +10436,14 @@ function peg$parse(input, options) {
|
|
|
10405
10436
|
isSelfClose: false
|
|
10406
10437
|
});
|
|
10407
10438
|
}
|
|
10408
|
-
function peg$
|
|
10439
|
+
function peg$f59(nameStart, name) {
|
|
10409
10440
|
attrCode = hooks.isCodeAttribute(name);
|
|
10410
10441
|
return true;
|
|
10411
10442
|
}
|
|
10412
|
-
function peg$
|
|
10443
|
+
function peg$f60(nameStart, name, v) {
|
|
10413
10444
|
return v;
|
|
10414
10445
|
}
|
|
10415
|
-
function peg$
|
|
10446
|
+
function peg$f61(nameStart, name, value) {
|
|
10416
10447
|
const attribute = {
|
|
10417
10448
|
name,
|
|
10418
10449
|
value: value ? value.value : "",
|
|
@@ -10426,7 +10457,7 @@ function peg$parse(input, options) {
|
|
|
10426
10457
|
}
|
|
10427
10458
|
return attribute;
|
|
10428
10459
|
}
|
|
10429
|
-
function peg$
|
|
10460
|
+
function peg$f62(start, value, end) {
|
|
10430
10461
|
return {
|
|
10431
10462
|
value,
|
|
10432
10463
|
start,
|
|
@@ -10434,7 +10465,7 @@ function peg$parse(input, options) {
|
|
|
10434
10465
|
quote: "\""
|
|
10435
10466
|
};
|
|
10436
10467
|
}
|
|
10437
|
-
function peg$
|
|
10468
|
+
function peg$f63(start, value, end) {
|
|
10438
10469
|
return {
|
|
10439
10470
|
value,
|
|
10440
10471
|
start,
|
|
@@ -10442,36 +10473,36 @@ function peg$parse(input, options) {
|
|
|
10442
10473
|
quote: "'"
|
|
10443
10474
|
};
|
|
10444
10475
|
}
|
|
10445
|
-
function peg$
|
|
10476
|
+
function peg$f64(q) {
|
|
10446
10477
|
fail("Unclosed attribute value: the " + q + " here has no closing " + q, location(), "unclosed-attribute");
|
|
10447
10478
|
}
|
|
10448
|
-
function peg$
|
|
10479
|
+
function peg$f65(start, value, end) {
|
|
10449
10480
|
return {
|
|
10450
10481
|
value,
|
|
10451
10482
|
start,
|
|
10452
10483
|
end
|
|
10453
10484
|
};
|
|
10454
10485
|
}
|
|
10455
|
-
function peg$
|
|
10486
|
+
function peg$f66() {
|
|
10456
10487
|
return !attrCode;
|
|
10457
10488
|
}
|
|
10458
|
-
function peg$
|
|
10489
|
+
function peg$f67(bs) {
|
|
10459
10490
|
return bs.length % 2 === 1;
|
|
10460
10491
|
}
|
|
10461
|
-
function peg$
|
|
10492
|
+
function peg$f68() {
|
|
10462
10493
|
return !attrCode;
|
|
10463
10494
|
}
|
|
10464
|
-
function peg$
|
|
10495
|
+
function peg$f69(start, nameEnd) {
|
|
10465
10496
|
const end = hooks.closeBrace(input, nameEnd, start);
|
|
10466
10497
|
return skipTo(end < 0 && completionMode ? input.length : end);
|
|
10467
10498
|
}
|
|
10468
|
-
function peg$
|
|
10499
|
+
function peg$f70(start, nameEnd) {
|
|
10469
10500
|
return skipEnd - offset();
|
|
10470
10501
|
}
|
|
10471
|
-
function peg$
|
|
10502
|
+
function peg$f71() {
|
|
10472
10503
|
return !attrCode;
|
|
10473
10504
|
}
|
|
10474
|
-
function peg$
|
|
10505
|
+
function peg$f72() {
|
|
10475
10506
|
return attrCode;
|
|
10476
10507
|
}
|
|
10477
10508
|
let peg$currPos = options.peg$currPos | 0;
|
|
@@ -10607,15 +10638,66 @@ function peg$parse(input, options) {
|
|
|
10607
10638
|
if (s0 === peg$FAILED) {
|
|
10608
10639
|
s0 = peg$parseEscape();
|
|
10609
10640
|
if (s0 === peg$FAILED) {
|
|
10610
|
-
s0 = peg$
|
|
10641
|
+
s0 = peg$currPos;
|
|
10642
|
+
peg$savedPos = peg$currPos;
|
|
10643
|
+
s1 = peg$f1();
|
|
10644
|
+
if (s1) s1 = void 0;
|
|
10645
|
+
else s1 = peg$FAILED;
|
|
10646
|
+
if (s1 !== peg$FAILED) {
|
|
10647
|
+
s2 = peg$parseComment();
|
|
10648
|
+
if (s2 !== peg$FAILED) {
|
|
10649
|
+
s1 = [s1, s2];
|
|
10650
|
+
s0 = s1;
|
|
10651
|
+
} else {
|
|
10652
|
+
peg$currPos = s0;
|
|
10653
|
+
s0 = peg$FAILED;
|
|
10654
|
+
}
|
|
10655
|
+
} else {
|
|
10656
|
+
peg$currPos = s0;
|
|
10657
|
+
s0 = peg$FAILED;
|
|
10658
|
+
}
|
|
10611
10659
|
if (s0 === peg$FAILED) {
|
|
10612
|
-
s0 = peg$
|
|
10660
|
+
s0 = peg$currPos;
|
|
10661
|
+
peg$savedPos = peg$currPos;
|
|
10662
|
+
s1 = peg$f2();
|
|
10663
|
+
if (s1) s1 = void 0;
|
|
10664
|
+
else s1 = peg$FAILED;
|
|
10665
|
+
if (s1 !== peg$FAILED) {
|
|
10666
|
+
s2 = peg$parseLinkLexeme();
|
|
10667
|
+
if (s2 !== peg$FAILED) {
|
|
10668
|
+
s1 = [s1, s2];
|
|
10669
|
+
s0 = s1;
|
|
10670
|
+
} else {
|
|
10671
|
+
peg$currPos = s0;
|
|
10672
|
+
s0 = peg$FAILED;
|
|
10673
|
+
}
|
|
10674
|
+
} else {
|
|
10675
|
+
peg$currPos = s0;
|
|
10676
|
+
s0 = peg$FAILED;
|
|
10677
|
+
}
|
|
10613
10678
|
if (s0 === peg$FAILED) {
|
|
10614
|
-
s0 = peg$
|
|
10679
|
+
s0 = peg$currPos;
|
|
10680
|
+
peg$savedPos = peg$currPos;
|
|
10681
|
+
s1 = peg$f3();
|
|
10682
|
+
if (s1) s1 = void 0;
|
|
10683
|
+
else s1 = peg$FAILED;
|
|
10684
|
+
if (s1 !== peg$FAILED) {
|
|
10685
|
+
s2 = peg$parseEmailAutolink();
|
|
10686
|
+
if (s2 !== peg$FAILED) {
|
|
10687
|
+
s1 = [s1, s2];
|
|
10688
|
+
s0 = s1;
|
|
10689
|
+
} else {
|
|
10690
|
+
peg$currPos = s0;
|
|
10691
|
+
s0 = peg$FAILED;
|
|
10692
|
+
}
|
|
10693
|
+
} else {
|
|
10694
|
+
peg$currPos = s0;
|
|
10695
|
+
s0 = peg$FAILED;
|
|
10696
|
+
}
|
|
10615
10697
|
if (s0 === peg$FAILED) {
|
|
10616
10698
|
s0 = peg$currPos;
|
|
10617
10699
|
peg$savedPos = peg$currPos;
|
|
10618
|
-
s1 = peg$
|
|
10700
|
+
s1 = peg$f4();
|
|
10619
10701
|
if (s1) s1 = void 0;
|
|
10620
10702
|
else s1 = peg$FAILED;
|
|
10621
10703
|
if (s1 !== peg$FAILED) {
|
|
@@ -10634,14 +10716,14 @@ function peg$parse(input, options) {
|
|
|
10634
10716
|
if (s0 === peg$FAILED) {
|
|
10635
10717
|
s0 = peg$currPos;
|
|
10636
10718
|
peg$savedPos = peg$currPos;
|
|
10637
|
-
s1 = peg$
|
|
10719
|
+
s1 = peg$f5();
|
|
10638
10720
|
if (s1) s1 = void 0;
|
|
10639
10721
|
else s1 = peg$FAILED;
|
|
10640
10722
|
if (s1 !== peg$FAILED) {
|
|
10641
10723
|
s2 = peg$parseHtmlOpen();
|
|
10642
10724
|
if (s2 !== peg$FAILED) {
|
|
10643
10725
|
peg$savedPos = s0;
|
|
10644
|
-
s0 = peg$
|
|
10726
|
+
s0 = peg$f6(s2);
|
|
10645
10727
|
} else {
|
|
10646
10728
|
peg$currPos = s0;
|
|
10647
10729
|
s0 = peg$FAILED;
|
|
@@ -10653,14 +10735,23 @@ function peg$parse(input, options) {
|
|
|
10653
10735
|
if (s0 === peg$FAILED) {
|
|
10654
10736
|
s0 = peg$currPos;
|
|
10655
10737
|
peg$savedPos = peg$currPos;
|
|
10656
|
-
s1 = peg$
|
|
10738
|
+
s1 = peg$f7();
|
|
10657
10739
|
if (s1) s1 = void 0;
|
|
10658
10740
|
else s1 = peg$FAILED;
|
|
10659
10741
|
if (s1 !== peg$FAILED) {
|
|
10660
10742
|
s2 = peg$parseHtmlClose();
|
|
10661
10743
|
if (s2 !== peg$FAILED) {
|
|
10662
|
-
peg$savedPos =
|
|
10663
|
-
|
|
10744
|
+
peg$savedPos = peg$currPos;
|
|
10745
|
+
s3 = peg$f8(s2);
|
|
10746
|
+
if (s3) s3 = void 0;
|
|
10747
|
+
else s3 = peg$FAILED;
|
|
10748
|
+
if (s3 !== peg$FAILED) {
|
|
10749
|
+
peg$savedPos = s0;
|
|
10750
|
+
s0 = peg$f9(s2);
|
|
10751
|
+
} else {
|
|
10752
|
+
peg$currPos = s0;
|
|
10753
|
+
s0 = peg$FAILED;
|
|
10754
|
+
}
|
|
10664
10755
|
} else {
|
|
10665
10756
|
peg$currPos = s0;
|
|
10666
10757
|
s0 = peg$FAILED;
|
|
@@ -10677,14 +10768,14 @@ function peg$parse(input, options) {
|
|
|
10677
10768
|
if (s1 !== peg$FAILED) {
|
|
10678
10769
|
s2 = peg$currPos;
|
|
10679
10770
|
peg$savedPos = peg$currPos;
|
|
10680
|
-
s3 = peg$
|
|
10771
|
+
s3 = peg$f10(s1);
|
|
10681
10772
|
if (s3) s3 = void 0;
|
|
10682
10773
|
else s3 = peg$FAILED;
|
|
10683
10774
|
if (s3 !== peg$FAILED) {
|
|
10684
10775
|
s4 = peg$parseRawTokens();
|
|
10685
10776
|
if (s4 !== peg$FAILED) {
|
|
10686
10777
|
peg$savedPos = s2;
|
|
10687
|
-
s2 = peg$
|
|
10778
|
+
s2 = peg$f11(s1, s4);
|
|
10688
10779
|
} else {
|
|
10689
10780
|
peg$currPos = s2;
|
|
10690
10781
|
s2 = peg$FAILED;
|
|
@@ -10695,7 +10786,7 @@ function peg$parse(input, options) {
|
|
|
10695
10786
|
}
|
|
10696
10787
|
if (s2 === peg$FAILED) s2 = null;
|
|
10697
10788
|
peg$savedPos = s0;
|
|
10698
|
-
s0 = peg$
|
|
10789
|
+
s0 = peg$f12(s1, s2);
|
|
10699
10790
|
} else {
|
|
10700
10791
|
peg$currPos = s0;
|
|
10701
10792
|
s0 = peg$FAILED;
|
|
@@ -10718,12 +10809,12 @@ function peg$parse(input, options) {
|
|
|
10718
10809
|
s1 = peg$parseMacroTag();
|
|
10719
10810
|
if (s1 !== peg$FAILED) {
|
|
10720
10811
|
peg$savedPos = peg$currPos;
|
|
10721
|
-
s2 = peg$
|
|
10812
|
+
s2 = peg$f13(s1);
|
|
10722
10813
|
if (s2) s2 = void 0;
|
|
10723
10814
|
else s2 = peg$FAILED;
|
|
10724
10815
|
if (s2 !== peg$FAILED) {
|
|
10725
10816
|
peg$savedPos = s0;
|
|
10726
|
-
s0 = peg$
|
|
10817
|
+
s0 = peg$f14(s1);
|
|
10727
10818
|
} else {
|
|
10728
10819
|
peg$currPos = s0;
|
|
10729
10820
|
s0 = peg$FAILED;
|
|
@@ -10735,14 +10826,14 @@ function peg$parse(input, options) {
|
|
|
10735
10826
|
if (s0 === peg$FAILED) {
|
|
10736
10827
|
s0 = peg$currPos;
|
|
10737
10828
|
peg$savedPos = peg$currPos;
|
|
10738
|
-
s1 = peg$
|
|
10829
|
+
s1 = peg$f15();
|
|
10739
10830
|
if (s1) s1 = void 0;
|
|
10740
10831
|
else s1 = peg$FAILED;
|
|
10741
10832
|
if (s1 !== peg$FAILED) {
|
|
10742
10833
|
s2 = peg$parseHtmlClose();
|
|
10743
10834
|
if (s2 !== peg$FAILED) {
|
|
10744
10835
|
peg$savedPos = s0;
|
|
10745
|
-
s0 = peg$
|
|
10836
|
+
s0 = peg$f16(s2);
|
|
10746
10837
|
} else {
|
|
10747
10838
|
peg$currPos = s0;
|
|
10748
10839
|
s0 = peg$FAILED;
|
|
@@ -10759,12 +10850,12 @@ function peg$parse(input, options) {
|
|
|
10759
10850
|
s0 = peg$currPos;
|
|
10760
10851
|
s1 = peg$parseHere();
|
|
10761
10852
|
peg$savedPos = peg$currPos;
|
|
10762
|
-
s2 = peg$
|
|
10853
|
+
s2 = peg$f17(s1);
|
|
10763
10854
|
if (s2) s2 = void 0;
|
|
10764
10855
|
else s2 = peg$FAILED;
|
|
10765
10856
|
if (s2 !== peg$FAILED) {
|
|
10766
10857
|
s3 = peg$currPos;
|
|
10767
|
-
s4 = peg$
|
|
10858
|
+
s4 = peg$f18(s1);
|
|
10768
10859
|
s5 = peg$currPos;
|
|
10769
10860
|
s6 = [];
|
|
10770
10861
|
if (s6.length >= (s4 | 0)) s7 = peg$FAILED;
|
|
@@ -10797,7 +10888,7 @@ function peg$parse(input, options) {
|
|
|
10797
10888
|
s4 = peg$parseCloseTag();
|
|
10798
10889
|
if (s4 !== peg$FAILED) {
|
|
10799
10890
|
peg$savedPos = s0;
|
|
10800
|
-
s0 = peg$
|
|
10891
|
+
s0 = peg$f19(s1, s3, s4);
|
|
10801
10892
|
} else {
|
|
10802
10893
|
peg$currPos = s0;
|
|
10803
10894
|
s0 = peg$FAILED;
|
|
@@ -10813,7 +10904,7 @@ function peg$parse(input, options) {
|
|
|
10813
10904
|
if (s0 === peg$FAILED) {
|
|
10814
10905
|
s0 = peg$currPos;
|
|
10815
10906
|
peg$savedPos = peg$currPos;
|
|
10816
|
-
s1 = peg$
|
|
10907
|
+
s1 = peg$f20();
|
|
10817
10908
|
if (s1) s1 = void 0;
|
|
10818
10909
|
else s1 = peg$FAILED;
|
|
10819
10910
|
if (s1 !== peg$FAILED) {
|
|
@@ -10838,7 +10929,7 @@ function peg$parse(input, options) {
|
|
|
10838
10929
|
}
|
|
10839
10930
|
s2 = input.substring(s2, peg$currPos);
|
|
10840
10931
|
peg$savedPos = s0;
|
|
10841
|
-
s0 = peg$
|
|
10932
|
+
s0 = peg$f21(s2);
|
|
10842
10933
|
} else {
|
|
10843
10934
|
peg$currPos = s0;
|
|
10844
10935
|
s0 = peg$FAILED;
|
|
@@ -10851,7 +10942,7 @@ function peg$parse(input, options) {
|
|
|
10851
10942
|
s0 = peg$currPos;
|
|
10852
10943
|
s1 = "";
|
|
10853
10944
|
peg$savedPos = s0;
|
|
10854
|
-
s1 = peg$
|
|
10945
|
+
s1 = peg$f22();
|
|
10855
10946
|
s0 = s1;
|
|
10856
10947
|
return s0;
|
|
10857
10948
|
}
|
|
@@ -10880,7 +10971,7 @@ function peg$parse(input, options) {
|
|
|
10880
10971
|
else s1 = s2;
|
|
10881
10972
|
if (s1 !== peg$FAILED) {
|
|
10882
10973
|
peg$savedPos = s0;
|
|
10883
|
-
s1 = peg$
|
|
10974
|
+
s1 = peg$f23(s1);
|
|
10884
10975
|
}
|
|
10885
10976
|
s0 = s1;
|
|
10886
10977
|
return s0;
|
|
@@ -10916,7 +11007,7 @@ function peg$parse(input, options) {
|
|
|
10916
11007
|
if (s4 === peg$FAILED) {
|
|
10917
11008
|
s4 = peg$currPos;
|
|
10918
11009
|
peg$savedPos = peg$currPos;
|
|
10919
|
-
s5 = peg$
|
|
11010
|
+
s5 = peg$f24();
|
|
10920
11011
|
if (s5) s5 = void 0;
|
|
10921
11012
|
else s5 = peg$FAILED;
|
|
10922
11013
|
if (s5 !== peg$FAILED) {
|
|
@@ -11034,7 +11125,7 @@ function peg$parse(input, options) {
|
|
|
11034
11125
|
else s1 = s2;
|
|
11035
11126
|
if (s1 !== peg$FAILED) {
|
|
11036
11127
|
peg$savedPos = s0;
|
|
11037
|
-
s1 = peg$
|
|
11128
|
+
s1 = peg$f25(s1);
|
|
11038
11129
|
}
|
|
11039
11130
|
s0 = s1;
|
|
11040
11131
|
return s0;
|
|
@@ -11067,7 +11158,7 @@ function peg$parse(input, options) {
|
|
|
11067
11158
|
if (s1 !== peg$FAILED) {
|
|
11068
11159
|
s2 = peg$currPos;
|
|
11069
11160
|
peg$savedPos = peg$currPos;
|
|
11070
|
-
s3 = peg$
|
|
11161
|
+
s3 = peg$f26(s1);
|
|
11071
11162
|
if (s3) s3 = void 0;
|
|
11072
11163
|
else s3 = peg$FAILED;
|
|
11073
11164
|
if (s3 !== peg$FAILED) {
|
|
@@ -11079,7 +11170,7 @@ function peg$parse(input, options) {
|
|
|
11079
11170
|
}
|
|
11080
11171
|
if (s4 !== peg$FAILED) {
|
|
11081
11172
|
peg$savedPos = s2;
|
|
11082
|
-
s2 = peg$
|
|
11173
|
+
s2 = peg$f27(s1, s4);
|
|
11083
11174
|
} else {
|
|
11084
11175
|
peg$currPos = s2;
|
|
11085
11176
|
s2 = peg$FAILED;
|
|
@@ -11090,7 +11181,7 @@ function peg$parse(input, options) {
|
|
|
11090
11181
|
}
|
|
11091
11182
|
if (s2 === peg$FAILED) s2 = null;
|
|
11092
11183
|
peg$savedPos = s0;
|
|
11093
|
-
s0 = peg$
|
|
11184
|
+
s0 = peg$f28(s1, s2);
|
|
11094
11185
|
} else {
|
|
11095
11186
|
peg$currPos = s0;
|
|
11096
11187
|
s0 = peg$FAILED;
|
|
@@ -11138,7 +11229,7 @@ function peg$parse(input, options) {
|
|
|
11138
11229
|
}
|
|
11139
11230
|
if (s2 !== peg$FAILED) {
|
|
11140
11231
|
peg$savedPos = s0;
|
|
11141
|
-
s0 = peg$
|
|
11232
|
+
s0 = peg$f29();
|
|
11142
11233
|
} else {
|
|
11143
11234
|
peg$currPos = s0;
|
|
11144
11235
|
s0 = peg$FAILED;
|
|
@@ -11153,7 +11244,7 @@ function peg$parse(input, options) {
|
|
|
11153
11244
|
peg$silentFails++;
|
|
11154
11245
|
s2 = peg$currPos;
|
|
11155
11246
|
peg$savedPos = peg$currPos;
|
|
11156
|
-
s3 = peg$
|
|
11247
|
+
s3 = peg$f30();
|
|
11157
11248
|
if (s3) s3 = void 0;
|
|
11158
11249
|
else s3 = peg$FAILED;
|
|
11159
11250
|
if (s3 !== peg$FAILED) {
|
|
@@ -11185,7 +11276,7 @@ function peg$parse(input, options) {
|
|
|
11185
11276
|
}
|
|
11186
11277
|
if (s2 !== peg$FAILED) {
|
|
11187
11278
|
peg$savedPos = s0;
|
|
11188
|
-
s0 = peg$
|
|
11279
|
+
s0 = peg$f31();
|
|
11189
11280
|
} else {
|
|
11190
11281
|
peg$currPos = s0;
|
|
11191
11282
|
s0 = peg$FAILED;
|
|
@@ -11205,7 +11296,7 @@ function peg$parse(input, options) {
|
|
|
11205
11296
|
}
|
|
11206
11297
|
if (s1 !== peg$FAILED) {
|
|
11207
11298
|
peg$savedPos = s0;
|
|
11208
|
-
s1 = peg$
|
|
11299
|
+
s1 = peg$f32();
|
|
11209
11300
|
}
|
|
11210
11301
|
s0 = s1;
|
|
11211
11302
|
}
|
|
@@ -11216,7 +11307,7 @@ function peg$parse(input, options) {
|
|
|
11216
11307
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
|
11217
11308
|
s0 = peg$currPos;
|
|
11218
11309
|
peg$savedPos = peg$currPos;
|
|
11219
|
-
s1 = peg$
|
|
11310
|
+
s1 = peg$f33();
|
|
11220
11311
|
if (s1) s1 = void 0;
|
|
11221
11312
|
else s1 = peg$FAILED;
|
|
11222
11313
|
if (s1 !== peg$FAILED) {
|
|
@@ -11245,7 +11336,7 @@ function peg$parse(input, options) {
|
|
|
11245
11336
|
if (s7 === peg$FAILED) s7 = peg$parseOpenEnd();
|
|
11246
11337
|
if (s7 !== peg$FAILED) {
|
|
11247
11338
|
peg$savedPos = s0;
|
|
11248
|
-
s0 = peg$
|
|
11339
|
+
s0 = peg$f34(s3, s4, s5, s6);
|
|
11249
11340
|
} else {
|
|
11250
11341
|
peg$currPos = s0;
|
|
11251
11342
|
s0 = peg$FAILED;
|
|
@@ -11265,7 +11356,7 @@ function peg$parse(input, options) {
|
|
|
11265
11356
|
if (s0 === peg$FAILED) {
|
|
11266
11357
|
s0 = peg$currPos;
|
|
11267
11358
|
peg$savedPos = peg$currPos;
|
|
11268
|
-
s1 = peg$
|
|
11359
|
+
s1 = peg$f35();
|
|
11269
11360
|
if (s1) s1 = void 0;
|
|
11270
11361
|
else s1 = peg$FAILED;
|
|
11271
11362
|
if (s1 !== peg$FAILED) {
|
|
@@ -11278,7 +11369,7 @@ function peg$parse(input, options) {
|
|
|
11278
11369
|
}
|
|
11279
11370
|
if (s2 !== peg$FAILED) {
|
|
11280
11371
|
peg$savedPos = s0;
|
|
11281
|
-
s0 = peg$
|
|
11372
|
+
s0 = peg$f36();
|
|
11282
11373
|
} else {
|
|
11283
11374
|
peg$currPos = s0;
|
|
11284
11375
|
s0 = peg$FAILED;
|
|
@@ -11406,7 +11497,7 @@ function peg$parse(input, options) {
|
|
|
11406
11497
|
}
|
|
11407
11498
|
if (s2 === peg$FAILED) s2 = null;
|
|
11408
11499
|
peg$savedPos = s0;
|
|
11409
|
-
s0 = peg$
|
|
11500
|
+
s0 = peg$f37(s1);
|
|
11410
11501
|
} else {
|
|
11411
11502
|
peg$currPos = s0;
|
|
11412
11503
|
s0 = peg$FAILED;
|
|
@@ -11415,7 +11506,7 @@ function peg$parse(input, options) {
|
|
|
11415
11506
|
s0 = peg$currPos;
|
|
11416
11507
|
s1 = "";
|
|
11417
11508
|
peg$savedPos = s0;
|
|
11418
|
-
s1 = peg$
|
|
11509
|
+
s1 = peg$f38();
|
|
11419
11510
|
s0 = s1;
|
|
11420
11511
|
}
|
|
11421
11512
|
return s0;
|
|
@@ -11445,7 +11536,7 @@ function peg$parse(input, options) {
|
|
|
11445
11536
|
}
|
|
11446
11537
|
}
|
|
11447
11538
|
peg$savedPos = s0;
|
|
11448
|
-
s0 = peg$
|
|
11539
|
+
s0 = peg$f39(s1, s2);
|
|
11449
11540
|
} else {
|
|
11450
11541
|
peg$currPos = s0;
|
|
11451
11542
|
s0 = peg$FAILED;
|
|
@@ -11471,7 +11562,7 @@ function peg$parse(input, options) {
|
|
|
11471
11562
|
}
|
|
11472
11563
|
s2 = input.substring(s2, peg$currPos);
|
|
11473
11564
|
peg$savedPos = s0;
|
|
11474
|
-
s0 = peg$
|
|
11565
|
+
s0 = peg$f40(s1, s2);
|
|
11475
11566
|
} else {
|
|
11476
11567
|
peg$currPos = s0;
|
|
11477
11568
|
s0 = peg$FAILED;
|
|
@@ -11592,7 +11683,7 @@ function peg$parse(input, options) {
|
|
|
11592
11683
|
s7 = peg$parseBraceEnd();
|
|
11593
11684
|
if (s7 !== peg$FAILED) {
|
|
11594
11685
|
peg$savedPos = s0;
|
|
11595
|
-
s0 = peg$
|
|
11686
|
+
s0 = peg$f41(s2, s3, s4, s5, s6);
|
|
11596
11687
|
} else {
|
|
11597
11688
|
peg$currPos = s0;
|
|
11598
11689
|
s0 = peg$FAILED;
|
|
@@ -11642,7 +11733,7 @@ function peg$parse(input, options) {
|
|
|
11642
11733
|
s7 = peg$parseBraceEnd();
|
|
11643
11734
|
if (s7 !== peg$FAILED) {
|
|
11644
11735
|
peg$savedPos = s0;
|
|
11645
|
-
s0 = peg$
|
|
11736
|
+
s0 = peg$f42(s2, s3, s4, s6);
|
|
11646
11737
|
} else {
|
|
11647
11738
|
peg$currPos = s0;
|
|
11648
11739
|
s0 = peg$FAILED;
|
|
@@ -11690,7 +11781,7 @@ function peg$parse(input, options) {
|
|
|
11690
11781
|
} else s3 = peg$FAILED;
|
|
11691
11782
|
if (s3 !== peg$FAILED) {
|
|
11692
11783
|
peg$savedPos = s0;
|
|
11693
|
-
s0 = peg$
|
|
11784
|
+
s0 = peg$f43();
|
|
11694
11785
|
} else {
|
|
11695
11786
|
peg$currPos = s0;
|
|
11696
11787
|
s0 = peg$FAILED;
|
|
@@ -11712,12 +11803,12 @@ function peg$parse(input, options) {
|
|
|
11712
11803
|
s0 = peg$currPos;
|
|
11713
11804
|
s1 = peg$parseHere();
|
|
11714
11805
|
peg$savedPos = peg$currPos;
|
|
11715
|
-
s2 = peg$
|
|
11806
|
+
s2 = peg$f44(s1);
|
|
11716
11807
|
if (s2) s2 = void 0;
|
|
11717
11808
|
else s2 = peg$FAILED;
|
|
11718
11809
|
if (s2 !== peg$FAILED) {
|
|
11719
11810
|
s3 = peg$currPos;
|
|
11720
|
-
s4 = peg$
|
|
11811
|
+
s4 = peg$f45(s1);
|
|
11721
11812
|
s5 = peg$currPos;
|
|
11722
11813
|
s6 = [];
|
|
11723
11814
|
if (s6.length >= (s4 | 0)) s7 = peg$FAILED;
|
|
@@ -11748,7 +11839,7 @@ function peg$parse(input, options) {
|
|
|
11748
11839
|
else s3 = s4;
|
|
11749
11840
|
if (s3 !== peg$FAILED) {
|
|
11750
11841
|
peg$savedPos = s0;
|
|
11751
|
-
s0 = peg$
|
|
11842
|
+
s0 = peg$f46(s1, s3);
|
|
11752
11843
|
} else {
|
|
11753
11844
|
peg$currPos = s0;
|
|
11754
11845
|
s0 = peg$FAILED;
|
|
@@ -11763,7 +11854,7 @@ function peg$parse(input, options) {
|
|
|
11763
11854
|
let s0, s1, s2, s3;
|
|
11764
11855
|
s0 = peg$currPos;
|
|
11765
11856
|
peg$savedPos = peg$currPos;
|
|
11766
|
-
s1 = peg$
|
|
11857
|
+
s1 = peg$f47();
|
|
11767
11858
|
if (s1) s1 = void 0;
|
|
11768
11859
|
else s1 = peg$FAILED;
|
|
11769
11860
|
if (s1 !== peg$FAILED) {
|
|
@@ -11835,12 +11926,12 @@ function peg$parse(input, options) {
|
|
|
11835
11926
|
s7 = peg$parseHere();
|
|
11836
11927
|
s8 = peg$currPos;
|
|
11837
11928
|
peg$savedPos = peg$currPos;
|
|
11838
|
-
s9 = peg$
|
|
11929
|
+
s9 = peg$f48(s2, s3, s4, s5, s6, s7);
|
|
11839
11930
|
if (s9) s9 = void 0;
|
|
11840
11931
|
else s9 = peg$FAILED;
|
|
11841
11932
|
if (s9 !== peg$FAILED) {
|
|
11842
11933
|
s10 = peg$currPos;
|
|
11843
|
-
s11 = peg$
|
|
11934
|
+
s11 = peg$f49(s2, s3, s4, s5, s6, s7);
|
|
11844
11935
|
s12 = peg$currPos;
|
|
11845
11936
|
s13 = [];
|
|
11846
11937
|
if (s13.length >= (s11 | 0)) s14 = peg$FAILED;
|
|
@@ -11873,7 +11964,7 @@ function peg$parse(input, options) {
|
|
|
11873
11964
|
s11 = peg$parseBraceEnd();
|
|
11874
11965
|
if (s11 !== peg$FAILED) {
|
|
11875
11966
|
peg$savedPos = s8;
|
|
11876
|
-
s8 = peg$
|
|
11967
|
+
s8 = peg$f50(s2, s3, s4, s5, s6, s7, s10);
|
|
11877
11968
|
} else {
|
|
11878
11969
|
peg$currPos = s8;
|
|
11879
11970
|
s8 = peg$FAILED;
|
|
@@ -11888,7 +11979,7 @@ function peg$parse(input, options) {
|
|
|
11888
11979
|
}
|
|
11889
11980
|
if (s8 === peg$FAILED) s8 = null;
|
|
11890
11981
|
peg$savedPos = s0;
|
|
11891
|
-
s0 = peg$
|
|
11982
|
+
s0 = peg$f51(s2, s3, s4, s5, s6, s7, s8);
|
|
11892
11983
|
} else {
|
|
11893
11984
|
peg$currPos = s0;
|
|
11894
11985
|
s0 = peg$FAILED;
|
|
@@ -11922,7 +12013,7 @@ function peg$parse(input, options) {
|
|
|
11922
12013
|
}
|
|
11923
12014
|
if (s3 !== peg$FAILED) {
|
|
11924
12015
|
peg$savedPos = s0;
|
|
11925
|
-
s0 = peg$
|
|
12016
|
+
s0 = peg$f52(s2);
|
|
11926
12017
|
} else {
|
|
11927
12018
|
peg$currPos = s0;
|
|
11928
12019
|
s0 = peg$FAILED;
|
|
@@ -12072,12 +12163,12 @@ function peg$parse(input, options) {
|
|
|
12072
12163
|
else s1 = s2;
|
|
12073
12164
|
if (s1 !== peg$FAILED) {
|
|
12074
12165
|
peg$savedPos = peg$currPos;
|
|
12075
|
-
s2 = peg$
|
|
12166
|
+
s2 = peg$f53(s1);
|
|
12076
12167
|
if (s2) s2 = void 0;
|
|
12077
12168
|
else s2 = peg$FAILED;
|
|
12078
12169
|
if (s2 !== peg$FAILED) {
|
|
12079
12170
|
peg$savedPos = s0;
|
|
12080
|
-
s0 = peg$
|
|
12171
|
+
s0 = peg$f54(s1);
|
|
12081
12172
|
} else {
|
|
12082
12173
|
peg$currPos = s0;
|
|
12083
12174
|
s0 = peg$FAILED;
|
|
@@ -12254,7 +12345,7 @@ function peg$parse(input, options) {
|
|
|
12254
12345
|
else s1 = s2;
|
|
12255
12346
|
if (s1 !== peg$FAILED) {
|
|
12256
12347
|
peg$savedPos = s0;
|
|
12257
|
-
s1 = peg$
|
|
12348
|
+
s1 = peg$f55(s1);
|
|
12258
12349
|
}
|
|
12259
12350
|
s0 = s1;
|
|
12260
12351
|
return s0;
|
|
@@ -12298,7 +12389,7 @@ function peg$parse(input, options) {
|
|
|
12298
12389
|
if (s7 === peg$FAILED) s7 = peg$parseOpenEnd();
|
|
12299
12390
|
if (s7 !== peg$FAILED) {
|
|
12300
12391
|
peg$savedPos = s0;
|
|
12301
|
-
s0 = peg$
|
|
12392
|
+
s0 = peg$f56(s2, s3, s4, s6);
|
|
12302
12393
|
} else {
|
|
12303
12394
|
peg$currPos = s0;
|
|
12304
12395
|
s0 = peg$FAILED;
|
|
@@ -12363,7 +12454,7 @@ function peg$parse(input, options) {
|
|
|
12363
12454
|
s5 = peg$parse_();
|
|
12364
12455
|
s6 = peg$parseHere();
|
|
12365
12456
|
peg$savedPos = s0;
|
|
12366
|
-
s0 = peg$
|
|
12457
|
+
s0 = peg$f57(s2, s6);
|
|
12367
12458
|
} else {
|
|
12368
12459
|
peg$currPos = s0;
|
|
12369
12460
|
s0 = peg$FAILED;
|
|
@@ -12403,7 +12494,7 @@ function peg$parse(input, options) {
|
|
|
12403
12494
|
}
|
|
12404
12495
|
if (s5 !== peg$FAILED) {
|
|
12405
12496
|
peg$savedPos = s0;
|
|
12406
|
-
s0 = peg$
|
|
12497
|
+
s0 = peg$f58(s2, s3);
|
|
12407
12498
|
} else {
|
|
12408
12499
|
peg$currPos = s0;
|
|
12409
12500
|
s0 = peg$FAILED;
|
|
@@ -12538,7 +12629,7 @@ function peg$parse(input, options) {
|
|
|
12538
12629
|
else s3 = s4;
|
|
12539
12630
|
if (s3 !== peg$FAILED) {
|
|
12540
12631
|
peg$savedPos = peg$currPos;
|
|
12541
|
-
s4 = peg$
|
|
12632
|
+
s4 = peg$f59(s2, s3);
|
|
12542
12633
|
if (s4) s4 = void 0;
|
|
12543
12634
|
else s4 = peg$FAILED;
|
|
12544
12635
|
if (s4 !== peg$FAILED) {
|
|
@@ -12556,7 +12647,7 @@ function peg$parse(input, options) {
|
|
|
12556
12647
|
s9 = peg$parseAttrValue();
|
|
12557
12648
|
if (s9 !== peg$FAILED) {
|
|
12558
12649
|
peg$savedPos = s5;
|
|
12559
|
-
s5 = peg$
|
|
12650
|
+
s5 = peg$f60(s2, s3, s9);
|
|
12560
12651
|
} else {
|
|
12561
12652
|
peg$currPos = s5;
|
|
12562
12653
|
s5 = peg$FAILED;
|
|
@@ -12567,7 +12658,7 @@ function peg$parse(input, options) {
|
|
|
12567
12658
|
}
|
|
12568
12659
|
if (s5 === peg$FAILED) s5 = null;
|
|
12569
12660
|
peg$savedPos = s0;
|
|
12570
|
-
s0 = peg$
|
|
12661
|
+
s0 = peg$f61(s2, s3, s5);
|
|
12571
12662
|
} else {
|
|
12572
12663
|
peg$currPos = s0;
|
|
12573
12664
|
s0 = peg$FAILED;
|
|
@@ -12625,7 +12716,7 @@ function peg$parse(input, options) {
|
|
|
12625
12716
|
if (s5 === peg$FAILED) s5 = peg$parseOpenEnd();
|
|
12626
12717
|
if (s5 !== peg$FAILED) {
|
|
12627
12718
|
peg$savedPos = s0;
|
|
12628
|
-
s0 = peg$
|
|
12719
|
+
s0 = peg$f62(s2, s3, s4);
|
|
12629
12720
|
} else {
|
|
12630
12721
|
peg$currPos = s0;
|
|
12631
12722
|
s0 = peg$FAILED;
|
|
@@ -12680,7 +12771,7 @@ function peg$parse(input, options) {
|
|
|
12680
12771
|
if (s5 === peg$FAILED) s5 = peg$parseOpenEnd();
|
|
12681
12772
|
if (s5 !== peg$FAILED) {
|
|
12682
12773
|
peg$savedPos = s0;
|
|
12683
|
-
s0 = peg$
|
|
12774
|
+
s0 = peg$f63(s2, s3, s4);
|
|
12684
12775
|
} else {
|
|
12685
12776
|
peg$currPos = s0;
|
|
12686
12777
|
s0 = peg$FAILED;
|
|
@@ -12699,7 +12790,7 @@ function peg$parse(input, options) {
|
|
|
12699
12790
|
}
|
|
12700
12791
|
if (s1 !== peg$FAILED) {
|
|
12701
12792
|
peg$savedPos = s0;
|
|
12702
|
-
s1 = peg$
|
|
12793
|
+
s1 = peg$f64(s1);
|
|
12703
12794
|
}
|
|
12704
12795
|
s0 = s1;
|
|
12705
12796
|
if (s0 === peg$FAILED) {
|
|
@@ -12725,7 +12816,7 @@ function peg$parse(input, options) {
|
|
|
12725
12816
|
s2 = input.substring(s2, peg$currPos);
|
|
12726
12817
|
s3 = peg$parseHere();
|
|
12727
12818
|
peg$savedPos = s0;
|
|
12728
|
-
s0 = peg$
|
|
12819
|
+
s0 = peg$f65(s1, s2, s3);
|
|
12729
12820
|
}
|
|
12730
12821
|
}
|
|
12731
12822
|
}
|
|
@@ -12735,7 +12826,7 @@ function peg$parse(input, options) {
|
|
|
12735
12826
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
|
|
12736
12827
|
s0 = peg$currPos;
|
|
12737
12828
|
peg$savedPos = peg$currPos;
|
|
12738
|
-
s1 = peg$
|
|
12829
|
+
s1 = peg$f66();
|
|
12739
12830
|
if (s1) s1 = void 0;
|
|
12740
12831
|
else s1 = peg$FAILED;
|
|
12741
12832
|
if (s1 !== peg$FAILED) {
|
|
@@ -12764,7 +12855,7 @@ function peg$parse(input, options) {
|
|
|
12764
12855
|
if (s2 !== peg$FAILED) {
|
|
12765
12856
|
s3 = peg$currPos;
|
|
12766
12857
|
peg$savedPos = peg$currPos;
|
|
12767
|
-
s4 = peg$
|
|
12858
|
+
s4 = peg$f67(s2);
|
|
12768
12859
|
if (s4) s4 = void 0;
|
|
12769
12860
|
else s4 = peg$FAILED;
|
|
12770
12861
|
if (s4 !== peg$FAILED) {
|
|
@@ -12803,7 +12894,7 @@ function peg$parse(input, options) {
|
|
|
12803
12894
|
if (s0 === peg$FAILED) {
|
|
12804
12895
|
s0 = peg$currPos;
|
|
12805
12896
|
peg$savedPos = peg$currPos;
|
|
12806
|
-
s1 = peg$
|
|
12897
|
+
s1 = peg$f68();
|
|
12807
12898
|
if (s1) s1 = void 0;
|
|
12808
12899
|
else s1 = peg$FAILED;
|
|
12809
12900
|
if (s1 !== peg$FAILED) {
|
|
@@ -12830,12 +12921,12 @@ function peg$parse(input, options) {
|
|
|
12830
12921
|
if (s6 !== peg$FAILED) {
|
|
12831
12922
|
s7 = peg$parseHere();
|
|
12832
12923
|
peg$savedPos = peg$currPos;
|
|
12833
|
-
s8 = peg$
|
|
12924
|
+
s8 = peg$f69(s4, s7);
|
|
12834
12925
|
if (s8) s8 = void 0;
|
|
12835
12926
|
else s8 = peg$FAILED;
|
|
12836
12927
|
if (s8 !== peg$FAILED) {
|
|
12837
12928
|
s9 = peg$currPos;
|
|
12838
|
-
s10 = peg$
|
|
12929
|
+
s10 = peg$f70(s4, s7);
|
|
12839
12930
|
s11 = peg$currPos;
|
|
12840
12931
|
s12 = [];
|
|
12841
12932
|
if (s12.length >= (s10 | 0)) s13 = peg$FAILED;
|
|
@@ -12911,7 +13002,7 @@ function peg$parse(input, options) {
|
|
|
12911
13002
|
if (s0 === peg$FAILED) {
|
|
12912
13003
|
s0 = peg$currPos;
|
|
12913
13004
|
peg$savedPos = peg$currPos;
|
|
12914
|
-
s1 = peg$
|
|
13005
|
+
s1 = peg$f71();
|
|
12915
13006
|
if (s1) s1 = void 0;
|
|
12916
13007
|
else s1 = peg$FAILED;
|
|
12917
13008
|
if (s1 !== peg$FAILED) {
|
|
@@ -12996,7 +13087,7 @@ function peg$parse(input, options) {
|
|
|
12996
13087
|
if (s0 === peg$FAILED) {
|
|
12997
13088
|
s0 = peg$currPos;
|
|
12998
13089
|
peg$savedPos = peg$currPos;
|
|
12999
|
-
s1 = peg$
|
|
13090
|
+
s1 = peg$f72();
|
|
13000
13091
|
if (s1) s1 = void 0;
|
|
13001
13092
|
else s1 = peg$FAILED;
|
|
13002
13093
|
if (s1 !== peg$FAILED) {
|
|
@@ -13089,6 +13180,8 @@ function peg$parse(input, options) {
|
|
|
13089
13180
|
let attrCode = false;
|
|
13090
13181
|
/** The macro whose raw body is being read. */
|
|
13091
13182
|
let rawName = "";
|
|
13183
|
+
/** The HTML text-only body being read; its own closer ends this context. */
|
|
13184
|
+
let htmlTextTag = "";
|
|
13092
13185
|
/**
|
|
13093
13186
|
* The index in `inner` (at `at` in the input) of the first `separator` that
|
|
13094
13187
|
* is not inside a {…} of the label: its code (`{if $a || $b}`, a string with
|
|
@@ -16667,12 +16760,7 @@ var STRUCTURAL_ELEMENTS = /* @__PURE__ */ new Set([
|
|
|
16667
16760
|
"datalist"
|
|
16668
16761
|
]);
|
|
16669
16762
|
/** Elements whose content is literal text, not markdown. */
|
|
16670
|
-
var PREFORMATTED_ELEMENTS = /* @__PURE__ */ new Set([
|
|
16671
|
-
"pre",
|
|
16672
|
-
"textarea",
|
|
16673
|
-
"style",
|
|
16674
|
-
"script"
|
|
16675
|
-
]);
|
|
16763
|
+
var PREFORMATTED_ELEMENTS = /* @__PURE__ */ new Set(["pre", ...HTML_TEXT_ELEMENTS$1]);
|
|
16676
16764
|
var WidgetChildrenContext = createContext(null);
|
|
16677
16765
|
function placeholderHtml(nonce, index) {
|
|
16678
16766
|
return `<span data-tw=${nonce}:${index}></span>`;
|
|
@@ -17165,7 +17253,7 @@ function HtmlNodeRenderer({ node }) {
|
|
|
17165
17253
|
let children = void 0;
|
|
17166
17254
|
let structural = false;
|
|
17167
17255
|
if (node.children.length > 0) {
|
|
17168
|
-
if (tag
|
|
17256
|
+
if (RAW_TEXT_ELEMENTS.has(tag)) children = node.children.map((n) => n.type === "text" ? n.value : renderSingleNode(n));
|
|
17169
17257
|
else if (rawContent || isRawRoot) children = renderInlineNodes(node.children);
|
|
17170
17258
|
else {
|
|
17171
17259
|
const leadAt = leadingPartIndex(tag, node.children);
|
|
@@ -19398,6 +19486,7 @@ function persistSession(get) {
|
|
|
19398
19486
|
const { storyData, currentPassage, variables, history, historyIndex, visitCounts, renderCounts } = get();
|
|
19399
19487
|
if (!storyData) return void 0;
|
|
19400
19488
|
if (sessionMoments.length > history.length) sessionMoments.length = history.length;
|
|
19489
|
+
for (let i = 0; i < sessionMoments.length; i++) sessionMoments[i] = savedMoment(history[i], sessionMoments[i].variables);
|
|
19401
19490
|
if (sessionMoments.length < history.length) {
|
|
19402
19491
|
if (history.length - sessionMoments.length === 1) {
|
|
19403
19492
|
const i = history.length - 1;
|
|
@@ -21188,7 +21277,7 @@ var escapeTextReferences = (text) => escapeAttributeReferences(text).replace(/</
|
|
|
21188
21277
|
* HtmlNodeRenderer), for which the browser did not decode any either.
|
|
21189
21278
|
*/
|
|
21190
21279
|
function isLiteralTextElement(parent) {
|
|
21191
|
-
return
|
|
21280
|
+
return RAW_TEXT_ELEMENTS.has(parent.localName) && parent.namespaceURI === HTML_NAMESPACE;
|
|
21192
21281
|
}
|
|
21193
21282
|
/**
|
|
21194
21283
|
* `value` with the text in it escaped by `escape`, but not markup
|
|
@@ -21831,11 +21920,8 @@ function keyOf(val, seen) {
|
|
|
21831
21920
|
const keys = className === void 0 ? [] : extraKeys(obj);
|
|
21832
21921
|
return named(keys.length ? `${key}${fieldsOf(obj, keys, seen)}` : key);
|
|
21833
21922
|
};
|
|
21834
|
-
if (val instanceof Date || val instanceof RegExp) {
|
|
21835
|
-
if (className !== void 0 && extraKeys(obj).length) seen.set(obj, seen.size);
|
|
21836
|
-
return withFields(val instanceof Date ? `Date(${Date.prototype.getTime.call(val)})` : `RegExp(${regExpText(val)}@${val.lastIndex})`);
|
|
21837
|
-
}
|
|
21838
21923
|
seen.set(obj, seen.size);
|
|
21924
|
+
if (val instanceof Date || val instanceof RegExp) return withFields(val instanceof Date ? `Date(${Date.prototype.getTime.call(val)})` : `RegExp(${regExpText(val)}@${val.lastIndex})`);
|
|
21839
21925
|
if (Array.isArray(val)) {
|
|
21840
21926
|
const items = [];
|
|
21841
21927
|
let next = 0;
|
|
@@ -22153,8 +22239,8 @@ function createStoryAPI() {
|
|
|
22153
22239
|
if (event === "variableChanged") ensureVariableChangedSubscription();
|
|
22154
22240
|
return trackRuntimeUnsub(on(event, callback));
|
|
22155
22241
|
},
|
|
22156
|
-
async waitForActions() {
|
|
22157
|
-
await settleRunningActions();
|
|
22242
|
+
async waitForActions(options = {}) {
|
|
22243
|
+
if (options.includeRunningActions !== false) await settleRunningActions();
|
|
22158
22244
|
await new Promise((resolve) => {
|
|
22159
22245
|
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
|
|
22160
22246
|
});
|