@depup/markdown-it 15.0.1-depup.8 → 15.0.2-depup.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/README.md +5 -4
- package/changes.json +7 -3
- package/dist/browser/markdown-it.esm.min.mjs +442 -434
- package/dist/browser/markdown-it.esm.min.mjs.map +1 -1
- package/dist/browser/markdown-it.umd.min.js +2 -2
- package/dist/browser/markdown-it.umd.min.js.map +1 -1
- package/dist/markdown-it.cjs.js +32 -16
- package/dist/markdown-it.cjs.js.map +1 -1
- package/dist/markdown-it.mjs +32 -16
- package/dist/markdown-it.mjs.map +1 -1
- package/package.json +11 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! markdown-it 15.0.
|
|
1
|
+
/*! markdown-it 15.0.2 https://github.com/markdown-it/markdown-it @license MIT */
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var e = Object.defineProperty, t = (t, n) => {
|
|
4
4
|
let r = {};
|
|
@@ -313,49 +313,49 @@ var E;
|
|
|
313
313
|
e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.LOWER_Z = 122] = "LOWER_Z", e[e.UPPER_A = 65] = "UPPER_A", e[e.UPPER_F = 70] = "UPPER_F", e[e.UPPER_Z = 90] = "UPPER_Z";
|
|
314
314
|
})(E || (E = {}));
|
|
315
315
|
var fe = 32;
|
|
316
|
-
function
|
|
316
|
+
function D(e) {
|
|
317
317
|
return e >= E.ZERO && e <= E.NINE;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function pe(e) {
|
|
320
320
|
return e >= E.UPPER_A && e <= E.UPPER_F || e >= E.LOWER_A && e <= E.LOWER_F;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
return e >= E.UPPER_A && e <= E.UPPER_Z || e >= E.LOWER_A && e <= E.LOWER_Z ||
|
|
322
|
+
function me(e) {
|
|
323
|
+
return e >= E.UPPER_A && e <= E.UPPER_Z || e >= E.LOWER_A && e <= E.LOWER_Z || D(e);
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
return e === E.EQUALS ||
|
|
325
|
+
function he(e) {
|
|
326
|
+
return e === E.EQUALS || me(e);
|
|
327
327
|
}
|
|
328
|
-
var
|
|
328
|
+
var O;
|
|
329
329
|
(function(e) {
|
|
330
330
|
e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
|
|
331
|
-
})(
|
|
332
|
-
var
|
|
331
|
+
})(O || (O = {}));
|
|
332
|
+
var k;
|
|
333
333
|
(function(e) {
|
|
334
334
|
e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
|
|
335
|
-
})(
|
|
336
|
-
var
|
|
335
|
+
})(k || (k = {}));
|
|
336
|
+
var ge = class {
|
|
337
337
|
constructor(e, t, n) {
|
|
338
|
-
T(this, "decodeTree", void 0), T(this, "emitCodePoint", void 0), T(this, "errors", void 0), T(this, "state",
|
|
338
|
+
T(this, "decodeTree", void 0), T(this, "emitCodePoint", void 0), T(this, "errors", void 0), T(this, "state", O.EntityStart), T(this, "consumed", 1), T(this, "result", 0), T(this, "treeIndex", 0), T(this, "excess", 1), T(this, "decodeMode", k.Strict), T(this, "runConsumed", 0), this.decodeTree = e, this.emitCodePoint = t, this.errors = n;
|
|
339
339
|
}
|
|
340
340
|
startEntity(e) {
|
|
341
|
-
this.decodeMode = e, this.state =
|
|
341
|
+
this.decodeMode = e, this.state = O.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1, this.runConsumed = 0;
|
|
342
342
|
}
|
|
343
343
|
write(e, t) {
|
|
344
344
|
switch (this.state) {
|
|
345
|
-
case
|
|
346
|
-
case
|
|
347
|
-
case
|
|
348
|
-
case
|
|
349
|
-
case
|
|
345
|
+
case O.EntityStart: return e.charCodeAt(t) === E.NUM ? (this.state = O.NumericStart, this.consumed += 1, this.stateNumericStart(e, t + 1)) : (this.state = O.NamedEntity, this.stateNamedEntity(e, t));
|
|
346
|
+
case O.NumericStart: return this.stateNumericStart(e, t);
|
|
347
|
+
case O.NumericDecimal: return this.stateNumericDecimal(e, t);
|
|
348
|
+
case O.NumericHex: return this.stateNumericHex(e, t);
|
|
349
|
+
case O.NamedEntity: return this.stateNamedEntity(e, t);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
stateNumericStart(e, t) {
|
|
353
|
-
return t >= e.length ? -1 : (e.charCodeAt(t) | fe) === E.LOWER_X ? (this.state =
|
|
353
|
+
return t >= e.length ? -1 : (e.charCodeAt(t) | fe) === E.LOWER_X ? (this.state = O.NumericHex, this.consumed += 1, this.stateNumericHex(e, t + 1)) : (this.state = O.NumericDecimal, this.stateNumericDecimal(e, t));
|
|
354
354
|
}
|
|
355
355
|
stateNumericHex(e, t) {
|
|
356
356
|
for (; t < e.length;) {
|
|
357
357
|
let n = e.charCodeAt(t);
|
|
358
|
-
if (
|
|
358
|
+
if (D(n) || pe(n)) {
|
|
359
359
|
let e = n <= E.NINE ? n - E.ZERO : (n | fe) - E.LOWER_A + 10;
|
|
360
360
|
this.result = this.result * 16 + e, this.consumed++, t++;
|
|
361
361
|
} else return this.emitNumericEntity(n, 3);
|
|
@@ -365,7 +365,7 @@ var _e = class {
|
|
|
365
365
|
stateNumericDecimal(e, t) {
|
|
366
366
|
for (; t < e.length;) {
|
|
367
367
|
let n = e.charCodeAt(t);
|
|
368
|
-
if (
|
|
368
|
+
if (D(n)) this.result = this.result * 10 + (n - E.ZERO), this.consumed++, t++;
|
|
369
369
|
else return this.emitNumericEntity(n, 2);
|
|
370
370
|
}
|
|
371
371
|
return -1;
|
|
@@ -376,7 +376,7 @@ var _e = class {
|
|
|
376
376
|
return (n = this.errors) == null || n.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
377
377
|
}
|
|
378
378
|
if (e === E.SEMI) this.consumed += 1;
|
|
379
|
-
else if (this.decodeMode ===
|
|
379
|
+
else if (this.decodeMode === k.Strict) return 0;
|
|
380
380
|
return this.emitCodePoint(se(this.result), this.consumed), this.errors && (e !== E.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
|
|
381
381
|
}
|
|
382
382
|
stateNamedEntity(e, t) {
|
|
@@ -400,10 +400,10 @@ var _e = class {
|
|
|
400
400
|
if (t >= e.length) break;
|
|
401
401
|
let a = e.charCodeAt(t);
|
|
402
402
|
if (a === E.SEMI && i !== 0 && (r & C.FLAG13) !== 0) return this.emitNamedEntityData(this.treeIndex, i, this.consumed + this.excess);
|
|
403
|
-
if (this.treeIndex =
|
|
403
|
+
if (this.treeIndex = ve(n, r, this.treeIndex + Math.max(1, i), a), this.treeIndex < 0) return this.result === 0 || this.decodeMode === k.Attribute && (i === 0 || he(a)) ? 0 : this.emitNotTerminatedNamedEntity();
|
|
404
404
|
if (r = n[this.treeIndex], i = (r & C.VALUE_LENGTH) >> 14, i !== 0) {
|
|
405
405
|
if (a === E.SEMI) return this.emitNamedEntityData(this.treeIndex, i, this.consumed + this.excess);
|
|
406
|
-
this.decodeMode !==
|
|
406
|
+
this.decodeMode !== k.Strict && (r & C.FLAG13) === 0 && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
|
|
407
407
|
}
|
|
408
408
|
t++, this.excess++;
|
|
409
409
|
}
|
|
@@ -420,18 +420,18 @@ var _e = class {
|
|
|
420
420
|
}
|
|
421
421
|
end() {
|
|
422
422
|
switch (this.state) {
|
|
423
|
-
case
|
|
424
|
-
case
|
|
425
|
-
case
|
|
426
|
-
case
|
|
423
|
+
case O.NamedEntity: return this.result !== 0 && (this.decodeMode !== k.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
|
424
|
+
case O.NumericDecimal: return this.emitNumericEntity(0, 2);
|
|
425
|
+
case O.NumericHex: return this.emitNumericEntity(0, 3);
|
|
426
|
+
case O.NumericStart:
|
|
427
427
|
var e;
|
|
428
428
|
return (e = this.errors) == null || e.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
429
|
-
case
|
|
429
|
+
case O.EntityStart: return 0;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
};
|
|
433
|
-
function
|
|
434
|
-
let t = "", n = new
|
|
433
|
+
function _e(e) {
|
|
434
|
+
let t = "", n = new ge(e, (e) => t += String.fromCodePoint(e));
|
|
435
435
|
return function(e, r) {
|
|
436
436
|
let i = 0, a = 0;
|
|
437
437
|
for (; (a = e.indexOf("&", a)) >= 0;) {
|
|
@@ -447,7 +447,7 @@ function ve(e) {
|
|
|
447
447
|
return t = "", o;
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function ve(e, t, n, r) {
|
|
451
451
|
let i = (t & C.BRANCH_LENGTH) >> 7, a = t & C.JUMP_TABLE;
|
|
452
452
|
if (i === 0) return a !== 0 && r === a ? n : -1;
|
|
453
453
|
if (a) {
|
|
@@ -463,43 +463,43 @@ function ye(e, t, n, r) {
|
|
|
463
463
|
}
|
|
464
464
|
return -1;
|
|
465
465
|
}
|
|
466
|
-
var
|
|
467
|
-
function
|
|
468
|
-
return
|
|
466
|
+
var ye = /* #__PURE__ */ _e(le);
|
|
467
|
+
function be(e) {
|
|
468
|
+
return ye(e, k.Strict);
|
|
469
469
|
}
|
|
470
470
|
//#endregion
|
|
471
471
|
//#region src/common/utils.ts
|
|
472
|
-
var
|
|
473
|
-
arrayReplaceAt: () =>
|
|
474
|
-
asciiTrim: () =>
|
|
475
|
-
callable: () =>
|
|
476
|
-
escapeHtml: () =>
|
|
477
|
-
escapeRE: () =>
|
|
478
|
-
fromCodePoint: () =>
|
|
479
|
-
isMdAsciiPunct: () =>
|
|
480
|
-
isPunctChar: () =>
|
|
481
|
-
isPunctCharCode: () =>
|
|
482
|
-
isSpace: () =>
|
|
483
|
-
isValidEntityCode: () =>
|
|
484
|
-
isWhiteSpace: () =>
|
|
485
|
-
lib: () =>
|
|
486
|
-
normalizeReference: () =>
|
|
487
|
-
unescapeAll: () =>
|
|
488
|
-
unescapeMd: () =>
|
|
472
|
+
var xe = /* @__PURE__ */ t({
|
|
473
|
+
arrayReplaceAt: () => Ce,
|
|
474
|
+
asciiTrim: () => R,
|
|
475
|
+
callable: () => Se,
|
|
476
|
+
escapeHtml: () => M,
|
|
477
|
+
escapeRE: () => Fe,
|
|
478
|
+
fromCodePoint: () => A,
|
|
479
|
+
isMdAsciiPunct: () => I,
|
|
480
|
+
isPunctChar: () => Ie,
|
|
481
|
+
isPunctCharCode: () => F,
|
|
482
|
+
isSpace: () => N,
|
|
483
|
+
isValidEntityCode: () => we,
|
|
484
|
+
isWhiteSpace: () => P,
|
|
485
|
+
lib: () => Re,
|
|
486
|
+
normalizeReference: () => L,
|
|
487
|
+
unescapeAll: () => j,
|
|
488
|
+
unescapeMd: () => ke
|
|
489
489
|
});
|
|
490
|
-
function
|
|
490
|
+
function Se(e) {
|
|
491
491
|
let t = function(...n) {
|
|
492
492
|
return Reflect.construct(e, n, new.target && new.target !== t ? new.target : e);
|
|
493
493
|
};
|
|
494
494
|
return Object.defineProperty(t, "name", { value: e.name }), Object.setPrototypeOf(t, e), t.prototype = e.prototype, t;
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function Ce(e, t, n) {
|
|
497
497
|
return [].concat(e.slice(0, t), n, e.slice(t + 1));
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function we(e) {
|
|
500
500
|
return !(e >= 55296 && e <= 57343 || e >= 64976 && e <= 65007 || (e & 65535) == 65535 || (e & 65535) == 65534 || e >= 0 && e <= 8 || e === 11 || e >= 14 && e <= 31 || e >= 127 && e <= 159 || e > 1114111);
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function A(e) {
|
|
503
503
|
if (e > 65535) {
|
|
504
504
|
e -= 65536;
|
|
505
505
|
let t = 55296 + (e >> 10), n = 56320 + (e & 1023);
|
|
@@ -507,47 +507,47 @@ function k(e) {
|
|
|
507
507
|
}
|
|
508
508
|
return String.fromCharCode(e);
|
|
509
509
|
}
|
|
510
|
-
var
|
|
511
|
-
function
|
|
512
|
-
if (t.charCodeAt(0) === 35 &&
|
|
510
|
+
var Te = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, Ee = RegExp(`${Te.source}|&([a-z#][a-z0-9]{1,31});`, "gi"), De = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
|
|
511
|
+
function Oe(e, t) {
|
|
512
|
+
if (t.charCodeAt(0) === 35 && De.test(t)) {
|
|
513
513
|
let n = t[1].toLowerCase() === "x" ? parseInt(t.slice(2), 16) : parseInt(t.slice(1), 10);
|
|
514
|
-
return
|
|
514
|
+
return we(n) ? A(n) : e;
|
|
515
515
|
}
|
|
516
|
-
let n =
|
|
516
|
+
let n = be(e);
|
|
517
517
|
return n === e ? e : n;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return e.indexOf("\\") < 0 ? e : e.replace(
|
|
519
|
+
function ke(e) {
|
|
520
|
+
return e.indexOf("\\") < 0 ? e : e.replace(Te, "$1");
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
return e.indexOf("\\") < 0 && e.indexOf("&") < 0 ? e : e.replace(
|
|
524
|
-
return t ||
|
|
522
|
+
function j(e) {
|
|
523
|
+
return e.indexOf("\\") < 0 && e.indexOf("&") < 0 ? e : e.replace(Ee, function(e, t, n) {
|
|
524
|
+
return t || Oe(e, n);
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
|
-
var
|
|
527
|
+
var Ae = /[&<>"]/, je = /[&<>"]/g, Me = {
|
|
528
528
|
"&": "&",
|
|
529
529
|
"<": "<",
|
|
530
530
|
">": ">",
|
|
531
531
|
"\"": """
|
|
532
532
|
};
|
|
533
|
-
function
|
|
534
|
-
return
|
|
533
|
+
function Ne(e) {
|
|
534
|
+
return Me[e];
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
return
|
|
536
|
+
function M(e) {
|
|
537
|
+
return Ae.test(e) ? e.replace(je, Ne) : e;
|
|
538
538
|
}
|
|
539
|
-
var
|
|
540
|
-
function
|
|
541
|
-
return e.replace(
|
|
539
|
+
var Pe = /[.?*+^$[\]\\(){}|-]/g;
|
|
540
|
+
function Fe(e) {
|
|
541
|
+
return e.replace(Pe, "\\$&");
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function N(e) {
|
|
544
544
|
switch (e) {
|
|
545
545
|
case 9:
|
|
546
546
|
case 32: return !0;
|
|
547
547
|
}
|
|
548
548
|
return !1;
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function P(e) {
|
|
551
551
|
if (e >= 8192 && e <= 8202) return !0;
|
|
552
552
|
switch (e) {
|
|
553
553
|
case 9:
|
|
@@ -564,13 +564,13 @@ function N(e) {
|
|
|
564
564
|
}
|
|
565
565
|
return !1;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function Ie(e) {
|
|
568
568
|
return S.test(e) || ie.test(e);
|
|
569
569
|
}
|
|
570
|
-
function P(e) {
|
|
571
|
-
return Le(k(e));
|
|
572
|
-
}
|
|
573
570
|
function F(e) {
|
|
571
|
+
return Ie(A(e));
|
|
572
|
+
}
|
|
573
|
+
function I(e) {
|
|
574
574
|
switch (e) {
|
|
575
575
|
case 33:
|
|
576
576
|
case 34:
|
|
@@ -607,26 +607,26 @@ function F(e) {
|
|
|
607
607
|
default: return !1;
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function L(e) {
|
|
611
611
|
return e = e.trim().replace(/\s+/g, " "), e.toLowerCase().toUpperCase();
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function Le(e) {
|
|
614
614
|
return e === 32 || e === 9 || e === 10 || e === 13;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function R(e) {
|
|
617
617
|
let t = 0;
|
|
618
|
-
for (; t < e.length &&
|
|
618
|
+
for (; t < e.length && Le(e.charCodeAt(t)); t++);
|
|
619
619
|
let n = e.length - 1;
|
|
620
|
-
for (; n >= t &&
|
|
620
|
+
for (; n >= t && Le(e.charCodeAt(n)); n--);
|
|
621
621
|
return e.slice(t, n + 1);
|
|
622
622
|
}
|
|
623
|
-
var
|
|
623
|
+
var Re = {
|
|
624
624
|
mdurl: ee,
|
|
625
625
|
ucmicro: te
|
|
626
626
|
};
|
|
627
627
|
//#endregion
|
|
628
628
|
//#region src/helpers/parse_link_label.ts
|
|
629
|
-
function
|
|
629
|
+
function ze(e, t, n) {
|
|
630
630
|
let r, i, a, o, s = e.posMax, c = e.pos;
|
|
631
631
|
for (e.pos = t + 1, r = 1; e.pos < s;) {
|
|
632
632
|
if (a = e.src.charCodeAt(e.pos), a === 93 && (r--, r === 0)) {
|
|
@@ -643,7 +643,7 @@ function Be(e, t, n) {
|
|
|
643
643
|
}
|
|
644
644
|
//#endregion
|
|
645
645
|
//#region src/helpers/parse_link_destination.ts
|
|
646
|
-
function
|
|
646
|
+
function Be(e, t, n) {
|
|
647
647
|
let r, i = t, a = {
|
|
648
648
|
ok: !1,
|
|
649
649
|
pos: 0,
|
|
@@ -652,7 +652,7 @@ function Ve(e, t, n) {
|
|
|
652
652
|
if (e.charCodeAt(i) === 60) {
|
|
653
653
|
for (i++; i < n;) {
|
|
654
654
|
if (r = e.charCodeAt(i), r === 10 || r === 60) return a;
|
|
655
|
-
if (r === 62) return a.pos = i + 1, a.str =
|
|
655
|
+
if (r === 62) return a.pos = i + 1, a.str = j(e.slice(t + 1, i)), a.ok = !0, a;
|
|
656
656
|
if (r === 92 && i + 1 < n) {
|
|
657
657
|
i += 2;
|
|
658
658
|
continue;
|
|
@@ -678,11 +678,11 @@ function Ve(e, t, n) {
|
|
|
678
678
|
}
|
|
679
679
|
i++;
|
|
680
680
|
}
|
|
681
|
-
return t === i || o !== 0 ? a : (a.str =
|
|
681
|
+
return t === i || o !== 0 ? a : (a.str = j(e.slice(t, i)), a.pos = i, a.ok = !0, a);
|
|
682
682
|
}
|
|
683
683
|
//#endregion
|
|
684
684
|
//#region src/helpers/parse_link_title.ts
|
|
685
|
-
function
|
|
685
|
+
function Ve(e, t, n, r) {
|
|
686
686
|
let i, a = t, o = {
|
|
687
687
|
ok: !1,
|
|
688
688
|
can_continue: !1,
|
|
@@ -698,19 +698,19 @@ function He(e, t, n, r) {
|
|
|
698
698
|
t++, a++, r === 40 && (r = 41), o.marker = r;
|
|
699
699
|
}
|
|
700
700
|
for (; a < n;) {
|
|
701
|
-
if (i = e.charCodeAt(a), i === o.marker) return o.pos = a + 1, o.str +=
|
|
701
|
+
if (i = e.charCodeAt(a), i === o.marker) return o.pos = a + 1, o.str += j(e.slice(t, a)), o.ok = !0, o;
|
|
702
702
|
if (i === 40 && o.marker === 41) return o;
|
|
703
703
|
i === 92 && a + 1 < n && a++, a++;
|
|
704
704
|
}
|
|
705
|
-
return o.can_continue = !0, o.str +=
|
|
705
|
+
return o.can_continue = !0, o.str += j(e.slice(t, a)), o;
|
|
706
706
|
}
|
|
707
707
|
//#endregion
|
|
708
708
|
//#region src/helpers/index.ts
|
|
709
|
-
var
|
|
710
|
-
parseLinkDestination: () =>
|
|
711
|
-
parseLinkLabel: () =>
|
|
712
|
-
parseLinkTitle: () =>
|
|
713
|
-
}),
|
|
709
|
+
var He = /* @__PURE__ */ t({
|
|
710
|
+
parseLinkDestination: () => Be,
|
|
711
|
+
parseLinkLabel: () => ze,
|
|
712
|
+
parseLinkTitle: () => Ve
|
|
713
|
+
}), z = class {
|
|
714
714
|
constructor(e, t, n) {
|
|
715
715
|
T(this, "map", null), T(this, "level", 0), T(this, "children", null), T(this, "content", ""), T(this, "markup", ""), T(this, "info", ""), T(this, "block", !1), T(this, "hidden", !1), this.type = e, this.tag = t, this.attrs = null, this.nesting = n, this.meta = null;
|
|
716
716
|
}
|
|
@@ -735,7 +735,7 @@ var Ue = /* @__PURE__ */ t({
|
|
|
735
735
|
let n = this.attrIndex(e);
|
|
736
736
|
n < 0 ? this.attrPush([e, t]) : this.attrs[n][1] = `${this.attrs[n][1]} ${t}`;
|
|
737
737
|
}
|
|
738
|
-
},
|
|
738
|
+
}, B = class {
|
|
739
739
|
constructor() {
|
|
740
740
|
T(this, "__rules__", []), T(this, "__cache__", null);
|
|
741
741
|
}
|
|
@@ -822,21 +822,21 @@ var Ue = /* @__PURE__ */ t({
|
|
|
822
822
|
getRules(e) {
|
|
823
823
|
return this.__cache__ || this.__compile__(), this.__cache__[e] || [];
|
|
824
824
|
}
|
|
825
|
-
},
|
|
826
|
-
|
|
825
|
+
}, V = {};
|
|
826
|
+
V.code_inline = function(e, t, n, r, i) {
|
|
827
827
|
let a = e[t];
|
|
828
|
-
return `<code${i.renderAttrs(a)}>${
|
|
829
|
-
},
|
|
828
|
+
return `<code${i.renderAttrs(a)}>${M(a.content)}</code>`;
|
|
829
|
+
}, V.code_block = function(e, t, n, r, i) {
|
|
830
830
|
let a = e[t];
|
|
831
|
-
return `<pre${i.renderAttrs(a)}><code>${
|
|
832
|
-
},
|
|
833
|
-
let a = e[t], o = a.info ?
|
|
831
|
+
return `<pre${i.renderAttrs(a)}><code>${M(e[t].content)}</code></pre>\n`;
|
|
832
|
+
}, V.fence = function(e, t, n, r, i) {
|
|
833
|
+
let a = e[t], o = a.info ? j(a.info).trim() : "", s = "", c = "";
|
|
834
834
|
if (o) {
|
|
835
835
|
let e = o.split(/(\s+)/g);
|
|
836
836
|
s = e[0], c = e.slice(2).join("");
|
|
837
837
|
}
|
|
838
838
|
let l;
|
|
839
|
-
if (l = n.highlight && n.highlight(a.content, s, c) ||
|
|
839
|
+
if (l = n.highlight && n.highlight(a.content, s, c) || M(a.content), l.indexOf("<pre") === 0) return l + "\n";
|
|
840
840
|
if (o) {
|
|
841
841
|
let e = a.attrIndex("class"), t = a.attrs ? a.attrs.slice() : [];
|
|
842
842
|
e < 0 ? t.push(["class", `${n.langPrefix}${s}`]) : (t[e] = [t[e][0], t[e][1]], t[e][1] += ` ${n.langPrefix}${s}`);
|
|
@@ -844,28 +844,28 @@ B.code_inline = function(e, t, n, r, i) {
|
|
|
844
844
|
return `<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`;
|
|
845
845
|
}
|
|
846
846
|
return `<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`;
|
|
847
|
-
},
|
|
847
|
+
}, V.image = function(e, t, n, r, i) {
|
|
848
848
|
let a = e[t];
|
|
849
849
|
return a.attrs[a.attrIndex("alt")][1] = i.renderInlineAsText(a.children, n, r), i.renderToken(e, t, n);
|
|
850
|
-
},
|
|
850
|
+
}, V.hardbreak = function(e, t, n) {
|
|
851
851
|
return n.xhtmlOut ? "<br />\n" : "<br>\n";
|
|
852
|
-
},
|
|
852
|
+
}, V.softbreak = function(e, t, n) {
|
|
853
853
|
return n.breaks ? n.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
|
|
854
|
-
},
|
|
855
|
-
return
|
|
856
|
-
},
|
|
854
|
+
}, V.text = function(e, t) {
|
|
855
|
+
return M(e[t].content);
|
|
856
|
+
}, V.html_block = function(e, t) {
|
|
857
857
|
return e[t].content;
|
|
858
|
-
},
|
|
858
|
+
}, V.html_inline = function(e, t) {
|
|
859
859
|
return e[t].content;
|
|
860
860
|
};
|
|
861
|
-
var
|
|
861
|
+
var Ue = class {
|
|
862
862
|
constructor() {
|
|
863
|
-
T(this, "rules", Object.assign({},
|
|
863
|
+
T(this, "rules", Object.assign({}, V));
|
|
864
864
|
}
|
|
865
865
|
renderAttrs(e) {
|
|
866
866
|
let t, n, r;
|
|
867
867
|
if (!e.attrs) return "";
|
|
868
|
-
for (r = "", t = 0, n = e.attrs.length; t < n; t++) r += ` ${
|
|
868
|
+
for (r = "", t = 0, n = e.attrs.length; t < n; t++) r += ` ${M(e.attrs[t][0])}="${M(String(e.attrs[t][1]))}"`;
|
|
869
869
|
return r;
|
|
870
870
|
}
|
|
871
871
|
renderToken(e, t, n) {
|
|
@@ -920,31 +920,31 @@ var We = class {
|
|
|
920
920
|
}
|
|
921
921
|
return r;
|
|
922
922
|
}
|
|
923
|
-
},
|
|
923
|
+
}, We = class {
|
|
924
924
|
constructor(e, t, n) {
|
|
925
|
-
T(this, "tokens", []), T(this, "inlineMode", !1), T(this, "Token",
|
|
925
|
+
T(this, "tokens", []), T(this, "inlineMode", !1), T(this, "Token", z), this.src = e, this.env = n, this.md = t;
|
|
926
926
|
}
|
|
927
|
-
},
|
|
928
|
-
function
|
|
927
|
+
}, Ge = /\r\n?/g, Ke = /\0/g;
|
|
928
|
+
function qe(e) {
|
|
929
929
|
let t;
|
|
930
|
-
t = e.src.replace(
|
|
930
|
+
t = e.src.replace(Ge, "\n"), t = t.replace(Ke, "�"), e.src = t;
|
|
931
931
|
}
|
|
932
932
|
//#endregion
|
|
933
933
|
//#region src/rules_core/block.ts
|
|
934
|
-
function
|
|
934
|
+
function Je(e) {
|
|
935
935
|
let t;
|
|
936
936
|
e.inlineMode ? (t = new e.Token("inline", "", 0), t.content = e.src, t.map = [0, 1], t.children = [], e.tokens.push(t)) : e.md.block.parse(e.src, e.md, e.env, e.tokens);
|
|
937
937
|
}
|
|
938
938
|
//#endregion
|
|
939
939
|
//#region src/rules_core/strip_references.ts
|
|
940
|
-
function
|
|
940
|
+
function Ye(e) {
|
|
941
941
|
let t = e.tokens, n = 0;
|
|
942
942
|
for (let e = 0; e < t.length; e++) t[e].type !== "reference_definition" && (e !== n && (t[n] = t[e]), n++);
|
|
943
943
|
t.length !== n && (t.length = n);
|
|
944
944
|
}
|
|
945
945
|
//#endregion
|
|
946
946
|
//#region src/rules_core/inline.ts
|
|
947
|
-
function
|
|
947
|
+
function Xe(e) {
|
|
948
948
|
let t = e.tokens;
|
|
949
949
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
950
950
|
let r = t[n];
|
|
@@ -953,13 +953,13 @@ function Ze(e) {
|
|
|
953
953
|
}
|
|
954
954
|
//#endregion
|
|
955
955
|
//#region src/rules_core/linkify.ts
|
|
956
|
-
function
|
|
956
|
+
function Ze(e) {
|
|
957
957
|
return /^<a[>\s]/i.test(e);
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function Qe(e) {
|
|
960
960
|
return /^<\/a\s*>/i.test(e);
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function $e(e) {
|
|
963
963
|
let t = e.tokens;
|
|
964
964
|
if (e.md.options.linkify) for (let n = 0, r = t.length; n < r; n++) {
|
|
965
965
|
if (t[n].type !== "inline" || !e.md.linkify.test(t[n].content)) continue;
|
|
@@ -970,7 +970,7 @@ function et(e) {
|
|
|
970
970
|
for (t--; r[t].level !== n.level && r[t].type !== "link_open";) t--;
|
|
971
971
|
continue;
|
|
972
972
|
}
|
|
973
|
-
if (n.type === "html_inline" && (
|
|
973
|
+
if (n.type === "html_inline" && (Ze(n.content) && a > 0 && a--, Qe(n.content) && a++), !(a > 0) && n.type === "text" && e.md.linkify.test(n.content)) {
|
|
974
974
|
let a = n.content, o = e.md.linkify.match(a), s = [], c = n.level, l = 0;
|
|
975
975
|
o.length > 0 && o[0].index === 0 && t > 0 && r[t - 1].type === "text_special" && (o = o.slice(1));
|
|
976
976
|
for (let t = 0; t < o.length; t++) {
|
|
@@ -1018,42 +1018,48 @@ function et(e) {
|
|
|
1018
1018
|
}
|
|
1019
1019
|
//#endregion
|
|
1020
1020
|
//#region src/rules_core/replacements.ts
|
|
1021
|
-
var
|
|
1021
|
+
var et = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/, tt = /\((c|tm|r)\)/i, nt = /\((c|tm|r)\)/gi, rt = {
|
|
1022
1022
|
c: "©",
|
|
1023
1023
|
r: "®",
|
|
1024
1024
|
tm: "™"
|
|
1025
1025
|
};
|
|
1026
|
-
function
|
|
1027
|
-
return
|
|
1026
|
+
function it(e, t) {
|
|
1027
|
+
return rt[t.toLowerCase()];
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function at(e) {
|
|
1030
1030
|
let t = 0;
|
|
1031
1031
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
1032
1032
|
let r = e[n];
|
|
1033
|
-
r.type === "text" && !t && (r.content = r.content.replace(
|
|
1033
|
+
r.type === "text" && !t && (r.content = r.content.replace(nt, it)), r.type === "link_open" && r.info === "auto" && t--, r.type === "link_close" && r.info === "auto" && t++;
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function ot(e) {
|
|
1037
1037
|
let t = 0;
|
|
1038
1038
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
1039
1039
|
let r = e[n];
|
|
1040
|
-
r.type === "text" && !t &&
|
|
1040
|
+
r.type === "text" && !t && et.test(r.content) && (r.content = r.content.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/gm, "$1—").replace(/(^|\s)--(?=\s|$)/gm, "$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm, "$1–")), r.type === "link_open" && r.info === "auto" && t--, r.type === "link_close" && r.info === "auto" && t++;
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function st(e) {
|
|
1044
1044
|
let t;
|
|
1045
|
-
if (e.md.options.typographer) for (t = e.tokens.length - 1; t >= 0; t--) e.tokens[t].type === "inline" && (
|
|
1045
|
+
if (e.md.options.typographer) for (t = e.tokens.length - 1; t >= 0; t--) e.tokens[t].type === "inline" && (tt.test(e.tokens[t].content) && at(e.tokens[t].children), et.test(e.tokens[t].content) && ot(e.tokens[t].children));
|
|
1046
1046
|
}
|
|
1047
1047
|
//#endregion
|
|
1048
1048
|
//#region src/rules_core/smartquotes.ts
|
|
1049
|
-
var
|
|
1050
|
-
function
|
|
1049
|
+
var ct = /['"]/, lt = /['"]/g, ut = "’", dt = 1e3;
|
|
1050
|
+
function ft(e, t, n) {
|
|
1051
|
+
for (; e.length > n;) {
|
|
1052
|
+
let n = e.pop();
|
|
1053
|
+
n.isSingleQuote ? t.single = n.prevSameQuoteIdx : t.double = n.prevSameQuoteIdx;
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
function H(e, t, n, r) {
|
|
1051
1057
|
e[t] || (e[t] = []), e[t].push({
|
|
1052
1058
|
pos: n,
|
|
1053
1059
|
ch: r
|
|
1054
1060
|
});
|
|
1055
1061
|
}
|
|
1056
|
-
function
|
|
1062
|
+
function pt(e, t) {
|
|
1057
1063
|
let n = "", r = 0;
|
|
1058
1064
|
t.sort((e, t) => e.pos - t.pos);
|
|
1059
1065
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -1062,107 +1068,109 @@ function ft(e, t) {
|
|
|
1062
1068
|
}
|
|
1063
1069
|
return n + e.slice(r);
|
|
1064
1070
|
}
|
|
1065
|
-
function
|
|
1066
|
-
let n, r = [], i = {
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
let
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1071
|
+
function mt(e, t) {
|
|
1072
|
+
let n, r = [], i = {
|
|
1073
|
+
single: -1,
|
|
1074
|
+
double: -1
|
|
1075
|
+
}, a = {};
|
|
1076
|
+
for (let o = 0; o < e.length; o++) {
|
|
1077
|
+
let s = e[o], c = e[o].level;
|
|
1078
|
+
for (n = r.length - 1; n >= 0 && !(r[n].level <= c); n--);
|
|
1079
|
+
if (ft(r, i, n + 1), s.type !== "text") continue;
|
|
1080
|
+
let l = s.content, u = 0, d = l.length;
|
|
1081
|
+
OUTER: for (; u < d;) {
|
|
1082
|
+
lt.lastIndex = u;
|
|
1083
|
+
let s = lt.exec(l);
|
|
1084
|
+
if (!s) break;
|
|
1085
|
+
let f = !0, p = !0;
|
|
1086
|
+
u = s.index + 1;
|
|
1087
|
+
let m = s[0] === "'", h = 32;
|
|
1088
|
+
if (s.index - 1 >= 0) h = l.charCodeAt(s.index - 1);
|
|
1089
|
+
else for (n = o - 1; n >= 0 && e[n].type !== "softbreak" && e[n].type !== "hardbreak"; n--) if (e[n].content) {
|
|
1090
|
+
h = e[n].content.charCodeAt(e[n].content.length - 1);
|
|
1082
1091
|
break;
|
|
1083
1092
|
}
|
|
1084
|
-
let
|
|
1085
|
-
if (
|
|
1086
|
-
else for (n =
|
|
1087
|
-
|
|
1093
|
+
let g = 32;
|
|
1094
|
+
if (u < d) g = l.charCodeAt(u);
|
|
1095
|
+
else for (n = o + 1; n < e.length && e[n].type !== "softbreak" && e[n].type !== "hardbreak"; n++) if (e[n].content) {
|
|
1096
|
+
g = e[n].content.charCodeAt(0);
|
|
1088
1097
|
break;
|
|
1089
1098
|
}
|
|
1090
|
-
let
|
|
1091
|
-
if (
|
|
1092
|
-
|
|
1099
|
+
let _ = I(h) || F(h), v = I(g) || F(g), y = P(h), b = P(g);
|
|
1100
|
+
if (b ? f = !1 : v && (y || _ || (f = !1)), y ? p = !1 : _ && (b || v || (p = !1)), g === 34 && s[0] === "\"" && h >= 48 && h <= 57 && (p = f = !1), f && p && (f = _, p = v), !f && !p) {
|
|
1101
|
+
m && H(a, o, s.index, ut);
|
|
1093
1102
|
continue;
|
|
1094
1103
|
}
|
|
1095
|
-
if (
|
|
1096
|
-
let e = r[n];
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
e = r[n];
|
|
1100
|
-
let s, c;
|
|
1101
|
-
p ? (s = t.md.options.quotes[2], c = t.md.options.quotes[3]) : (s = t.md.options.quotes[0], c = t.md.options.quotes[1]), V(i, a, o.index, c), V(i, e.token, e.pos, s), r.length = n;
|
|
1102
|
-
continue OUTER;
|
|
1103
|
-
}
|
|
1104
|
+
if (p && (n = m ? i.single : i.double, n >= 0 && r[n].level === c)) {
|
|
1105
|
+
let e = r[n], c, l;
|
|
1106
|
+
m ? (c = t.md.options.quotes[2], l = t.md.options.quotes[3]) : (c = t.md.options.quotes[0], l = t.md.options.quotes[1]), H(a, o, s.index, l), H(a, e.tokenIdx, e.contentPos, c), ft(r, i, n);
|
|
1107
|
+
continue OUTER;
|
|
1104
1108
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1109
|
+
if (f) {
|
|
1110
|
+
if (r.length >= dt) return;
|
|
1111
|
+
r.push({
|
|
1112
|
+
tokenIdx: o,
|
|
1113
|
+
contentPos: s.index,
|
|
1114
|
+
isSingleQuote: m,
|
|
1115
|
+
level: c,
|
|
1116
|
+
prevSameQuoteIdx: m ? i.single : i.double
|
|
1117
|
+
}), m ? i.single = r.length - 1 : i.double = r.length - 1;
|
|
1118
|
+
} else p && m && H(a, o, s.index, ut);
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
Object.keys(a).forEach(function(t) {
|
|
1114
1122
|
let n = Number(t);
|
|
1115
|
-
e[n].content =
|
|
1123
|
+
e[n].content = pt(e[n].content, a[t]);
|
|
1116
1124
|
});
|
|
1117
1125
|
}
|
|
1118
|
-
function
|
|
1119
|
-
if (e.md.options.typographer) for (let t = e.tokens.length - 1; t >= 0; t--) e.tokens[t].type !== "inline" || !
|
|
1126
|
+
function ht(e) {
|
|
1127
|
+
if (e.md.options.typographer) for (let t = e.tokens.length - 1; t >= 0; t--) e.tokens[t].type !== "inline" || !ct.test(e.tokens[t].content) || mt(e.tokens[t].children, e);
|
|
1120
1128
|
}
|
|
1121
1129
|
//#endregion
|
|
1122
1130
|
//#region src/rules_core/text_join.ts
|
|
1123
|
-
function
|
|
1131
|
+
function gt(e) {
|
|
1124
1132
|
let t, n, r = e.length;
|
|
1125
1133
|
for (t = 0; t < r; t++) e[t].type === "text_special" && (e[t].type = "text");
|
|
1126
1134
|
for (t = n = 0; t < r; t++) e[t].type === "text" && t + 1 < r && e[t + 1].type === "text" ? e[t + 1].content = e[t].content + e[t + 1].content : (t !== n && (e[n] = e[t]), n++);
|
|
1127
1135
|
t !== n && (e.length = n);
|
|
1128
1136
|
}
|
|
1129
|
-
function
|
|
1137
|
+
function _t(e) {
|
|
1130
1138
|
let t, n, r = e.tokens, i = r.length;
|
|
1131
1139
|
for (let e = 0; e < i; e++) {
|
|
1132
1140
|
if (r[e].type !== "inline") continue;
|
|
1133
1141
|
let i = r[e].children, a = i.length;
|
|
1134
|
-
for (t = 0; t < a; t++) i[t].type === "text_special" && (i[t].type = "text"), i[t].children &&
|
|
1142
|
+
for (t = 0; t < a; t++) i[t].type === "text_special" && (i[t].type = "text"), i[t].children && gt(i[t].children);
|
|
1135
1143
|
for (t = n = 0; t < a; t++) i[t].type === "text" && t + 1 < a && i[t + 1].type === "text" ? i[t + 1].content = i[t].content + i[t + 1].content : (t !== n && (i[n] = i[t]), n++);
|
|
1136
1144
|
t !== n && (i.length = n);
|
|
1137
1145
|
}
|
|
1138
1146
|
}
|
|
1139
1147
|
//#endregion
|
|
1140
1148
|
//#region src/parser_core.ts
|
|
1141
|
-
var
|
|
1142
|
-
["normalize",
|
|
1143
|
-
["block",
|
|
1144
|
-
["strip_references",
|
|
1145
|
-
["inline",
|
|
1146
|
-
["linkify",
|
|
1147
|
-
["replacements",
|
|
1148
|
-
["smartquotes",
|
|
1149
|
-
["text_join",
|
|
1150
|
-
],
|
|
1149
|
+
var U = [
|
|
1150
|
+
["normalize", qe],
|
|
1151
|
+
["block", Je],
|
|
1152
|
+
["strip_references", Ye],
|
|
1153
|
+
["inline", Xe],
|
|
1154
|
+
["linkify", $e],
|
|
1155
|
+
["replacements", st],
|
|
1156
|
+
["smartquotes", ht],
|
|
1157
|
+
["text_join", _t]
|
|
1158
|
+
], vt = class {
|
|
1151
1159
|
constructor() {
|
|
1152
|
-
T(this, "ruler", new
|
|
1153
|
-
for (let e = 0; e <
|
|
1160
|
+
T(this, "ruler", new B()), T(this, "State", We);
|
|
1161
|
+
for (let e = 0; e < U.length; e++) this.ruler.push(U[e][0], U[e][1]);
|
|
1154
1162
|
}
|
|
1155
1163
|
process(e) {
|
|
1156
1164
|
let t = this.ruler.getRules("");
|
|
1157
1165
|
for (let n = 0, r = t.length; n < r; n++) t[n](e);
|
|
1158
1166
|
}
|
|
1159
|
-
},
|
|
1167
|
+
}, yt = class {
|
|
1160
1168
|
constructor(e, t, n, r) {
|
|
1161
|
-
T(this, "bMarks", []), T(this, "eMarks", []), T(this, "tShift", []), T(this, "sCount", []), T(this, "bsCount", []), T(this, "blkIndent", 0), T(this, "line", 0), T(this, "lineMax", 0), T(this, "tight", !1), T(this, "listIndent", -1), T(this, "parentType", "root"), T(this, "level", 0), T(this, "Token",
|
|
1169
|
+
T(this, "bMarks", []), T(this, "eMarks", []), T(this, "tShift", []), T(this, "sCount", []), T(this, "bsCount", []), T(this, "blkIndent", 0), T(this, "line", 0), T(this, "lineMax", 0), T(this, "tight", !1), T(this, "listIndent", -1), T(this, "parentType", "root"), T(this, "level", 0), T(this, "Token", z), this.src = e, this.md = t, this.env = n, this.tokens = r;
|
|
1162
1170
|
let i = this.src;
|
|
1163
1171
|
for (let e = 0, t = 0, n = 0, r = 0, a = i.length, o = !1; t < a; t++) {
|
|
1164
1172
|
let s = i.charCodeAt(t);
|
|
1165
|
-
if (!o) if (
|
|
1173
|
+
if (!o) if (N(s)) {
|
|
1166
1174
|
n++, s === 9 ? r += 4 - r % 4 : r++;
|
|
1167
1175
|
continue;
|
|
1168
1176
|
} else o = !0;
|
|
@@ -1171,7 +1179,7 @@ var H = [
|
|
|
1171
1179
|
this.bMarks.push(i.length), this.eMarks.push(i.length), this.tShift.push(0), this.sCount.push(0), this.bsCount.push(0), this.lineMax = this.bMarks.length - 1;
|
|
1172
1180
|
}
|
|
1173
1181
|
push(e, t, n) {
|
|
1174
|
-
let r = new
|
|
1182
|
+
let r = new z(e, t, n);
|
|
1175
1183
|
return r.block = !0, n < 0 && this.level--, r.level = this.level, n > 0 && this.level++, this.tokens.push(r), r;
|
|
1176
1184
|
}
|
|
1177
1185
|
isEmpty(e) {
|
|
@@ -1182,12 +1190,12 @@ var H = [
|
|
|
1182
1190
|
return e;
|
|
1183
1191
|
}
|
|
1184
1192
|
skipSpaces(e) {
|
|
1185
|
-
for (let t = this.src.length; e < t &&
|
|
1193
|
+
for (let t = this.src.length; e < t && N(this.src.charCodeAt(e)); e++);
|
|
1186
1194
|
return e;
|
|
1187
1195
|
}
|
|
1188
1196
|
skipSpacesBack(e, t) {
|
|
1189
1197
|
if (e <= t) return e;
|
|
1190
|
-
for (; e > t;) if (!
|
|
1198
|
+
for (; e > t;) if (!N(this.src.charCodeAt(--e))) return e + 1;
|
|
1191
1199
|
return e;
|
|
1192
1200
|
}
|
|
1193
1201
|
skipChars(e, t) {
|
|
@@ -1206,7 +1214,7 @@ var H = [
|
|
|
1206
1214
|
let e = 0, s = this.bMarks[o], c = s, l;
|
|
1207
1215
|
for (l = o + 1 < t || r ? this.eMarks[o] + 1 : this.eMarks[o]; c < l && e < n;) {
|
|
1208
1216
|
let t = this.src.charCodeAt(c);
|
|
1209
|
-
if (
|
|
1217
|
+
if (N(t)) t === 9 ? e += 4 - (e + this.bsCount[o]) % 4 : e++;
|
|
1210
1218
|
else if (c - s < this.tShift[o]) e++;
|
|
1211
1219
|
else break;
|
|
1212
1220
|
c++;
|
|
@@ -1215,17 +1223,17 @@ var H = [
|
|
|
1215
1223
|
}
|
|
1216
1224
|
return i.join("");
|
|
1217
1225
|
}
|
|
1218
|
-
},
|
|
1219
|
-
function
|
|
1226
|
+
}, bt = 65536;
|
|
1227
|
+
function W(e, t) {
|
|
1220
1228
|
let n = e.bMarks[t] + e.tShift[t], r = e.eMarks[t];
|
|
1221
1229
|
return e.src.slice(n, r);
|
|
1222
1230
|
}
|
|
1223
|
-
function
|
|
1231
|
+
function xt(e) {
|
|
1224
1232
|
let t = [], n = e.length, r = 0, i = e.charCodeAt(r), a = !1, o = 0, s = "";
|
|
1225
1233
|
for (; r < n;) i === 124 && (a ? (s += e.substring(o, r - 1), o = r) : (t.push(s + e.substring(o, r)), s = "", o = r + 1)), a = i === 92, r++, i = e.charCodeAt(r);
|
|
1226
1234
|
return t.push(s + e.substring(o)), t;
|
|
1227
1235
|
}
|
|
1228
|
-
function
|
|
1236
|
+
function St(e, t, n, r) {
|
|
1229
1237
|
if (t + 2 > n) return !1;
|
|
1230
1238
|
let i = t + 1;
|
|
1231
1239
|
if (e.sCount[i] < e.blkIndent || e.sCount[i] - e.blkIndent >= 4) return !1;
|
|
@@ -1234,13 +1242,13 @@ function xt(e, t, n, r) {
|
|
|
1234
1242
|
let o = e.src.charCodeAt(a++);
|
|
1235
1243
|
if (o !== 124 && o !== 45 && o !== 58 || a >= e.eMarks[i]) return !1;
|
|
1236
1244
|
let s = e.src.charCodeAt(a++);
|
|
1237
|
-
if (s !== 124 && s !== 45 && s !== 58 && !
|
|
1245
|
+
if (s !== 124 && s !== 45 && s !== 58 && !N(s) || o === 45 && N(s)) return !1;
|
|
1238
1246
|
for (; a < e.eMarks[i];) {
|
|
1239
1247
|
let t = e.src.charCodeAt(a);
|
|
1240
|
-
if (t !== 124 && t !== 45 && t !== 58 && !
|
|
1248
|
+
if (t !== 124 && t !== 45 && t !== 58 && !N(t)) return !1;
|
|
1241
1249
|
a++;
|
|
1242
1250
|
}
|
|
1243
|
-
let c =
|
|
1251
|
+
let c = W(e, t + 1), l = c.split("|"), u = [];
|
|
1244
1252
|
for (let e = 0; e < l.length; e++) {
|
|
1245
1253
|
let t = l[e].trim();
|
|
1246
1254
|
if (!t) {
|
|
@@ -1250,8 +1258,8 @@ function xt(e, t, n, r) {
|
|
|
1250
1258
|
if (!/^:?-+:?$/.test(t)) return !1;
|
|
1251
1259
|
t.charCodeAt(t.length - 1) === 58 ? u.push(t.charCodeAt(0) === 58 ? "center" : "right") : t.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
|
1252
1260
|
}
|
|
1253
|
-
if (c =
|
|
1254
|
-
l =
|
|
1261
|
+
if (c = W(e, t).trim(), c.indexOf("|") === -1 || e.sCount[t] - e.blkIndent >= 4) return !1;
|
|
1262
|
+
l = xt(c), l.length && l[0] === "" && l.shift(), l.length && l[l.length - 1] === "" && l.pop();
|
|
1255
1263
|
let d = l.length;
|
|
1256
1264
|
if (d === 0 || d !== u.length) return !1;
|
|
1257
1265
|
if (r) return !0;
|
|
@@ -1277,7 +1285,7 @@ function xt(e, t, n, r) {
|
|
|
1277
1285
|
r = !0;
|
|
1278
1286
|
break;
|
|
1279
1287
|
}
|
|
1280
|
-
if (r || (c =
|
|
1288
|
+
if (r || (c = W(e, i).trim(), !c) || e.sCount[i] - e.blkIndent >= 4 || (l = xt(c), l.length && l[0] === "" && l.shift(), l.length && l[l.length - 1] === "" && l.pop(), y += d - l.length, y > bt)) break;
|
|
1281
1289
|
if (i === t + 2) {
|
|
1282
1290
|
let n = e.push("tbody_open", "tbody", 1);
|
|
1283
1291
|
n.map = v = [t + 2, 0];
|
|
@@ -1296,7 +1304,7 @@ function xt(e, t, n, r) {
|
|
|
1296
1304
|
}
|
|
1297
1305
|
//#endregion
|
|
1298
1306
|
//#region src/rules_block/code.ts
|
|
1299
|
-
function
|
|
1307
|
+
function Ct(e, t, n) {
|
|
1300
1308
|
if (e.sCount[t] - e.blkIndent < 4) return !1;
|
|
1301
1309
|
let r = t + 1, i = r;
|
|
1302
1310
|
for (; r < n;) {
|
|
@@ -1316,7 +1324,7 @@ function St(e, t, n) {
|
|
|
1316
1324
|
}
|
|
1317
1325
|
//#endregion
|
|
1318
1326
|
//#region src/rules_block/fence.ts
|
|
1319
|
-
function
|
|
1327
|
+
function wt(e, t, n, r) {
|
|
1320
1328
|
let i = e.bMarks[t] + e.tShift[t], a = e.eMarks[t];
|
|
1321
1329
|
if (e.sCount[t] - e.blkIndent >= 4 || i + 3 > a) return !1;
|
|
1322
1330
|
let o = e.src.charCodeAt(i);
|
|
@@ -1339,7 +1347,7 @@ function Ct(e, t, n, r) {
|
|
|
1339
1347
|
}
|
|
1340
1348
|
//#endregion
|
|
1341
1349
|
//#region src/rules_block/blockquote.ts
|
|
1342
|
-
function
|
|
1350
|
+
function Tt(e, t, n, r) {
|
|
1343
1351
|
let i = e.bMarks[t] + e.tShift[t], a = e.eMarks[t], o = e.lineMax;
|
|
1344
1352
|
if (e.sCount[t] - e.blkIndent >= 4 || e.src.charCodeAt(i) !== 62) return !1;
|
|
1345
1353
|
if (r) return !0;
|
|
@@ -1355,7 +1363,7 @@ function wt(e, t, n, r) {
|
|
|
1355
1363
|
let o = t;
|
|
1356
1364
|
for (s.push(e.bMarks[m]), e.bMarks[m] = i; i < a;) {
|
|
1357
1365
|
let t = e.src.charCodeAt(i);
|
|
1358
|
-
if (
|
|
1366
|
+
if (N(t)) t === 9 ? o += 4 - (o + e.bsCount[m] + +!!r) % 4 : o++;
|
|
1359
1367
|
else break;
|
|
1360
1368
|
i++;
|
|
1361
1369
|
}
|
|
@@ -1387,7 +1395,7 @@ function wt(e, t, n, r) {
|
|
|
1387
1395
|
}
|
|
1388
1396
|
//#endregion
|
|
1389
1397
|
//#region src/rules_block/hr.ts
|
|
1390
|
-
function
|
|
1398
|
+
function Et(e, t, n, r) {
|
|
1391
1399
|
let i = e.eMarks[t];
|
|
1392
1400
|
if (e.sCount[t] - e.blkIndent >= 4) return !1;
|
|
1393
1401
|
let a = e.bMarks[t] + e.tShift[t], o = e.src.charCodeAt(a++);
|
|
@@ -1395,7 +1403,7 @@ function Tt(e, t, n, r) {
|
|
|
1395
1403
|
let s = 1;
|
|
1396
1404
|
for (; a < i;) {
|
|
1397
1405
|
let t = e.src.charCodeAt(a++);
|
|
1398
|
-
if (t !== o && !
|
|
1406
|
+
if (t !== o && !N(t)) return !1;
|
|
1399
1407
|
t === o && s++;
|
|
1400
1408
|
}
|
|
1401
1409
|
if (s < 3) return !1;
|
|
@@ -1406,11 +1414,11 @@ function Tt(e, t, n, r) {
|
|
|
1406
1414
|
}
|
|
1407
1415
|
//#endregion
|
|
1408
1416
|
//#region src/rules_block/list.ts
|
|
1409
|
-
function
|
|
1417
|
+
function Dt(e, t) {
|
|
1410
1418
|
let n = e.eMarks[t], r = e.bMarks[t] + e.tShift[t], i = e.src.charCodeAt(r++);
|
|
1411
|
-
return i !== 42 && i !== 45 && i !== 43 || r < n && !
|
|
1419
|
+
return i !== 42 && i !== 45 && i !== 43 || r < n && !N(e.src.charCodeAt(r)) ? -1 : r;
|
|
1412
1420
|
}
|
|
1413
|
-
function
|
|
1421
|
+
function Ot(e, t) {
|
|
1414
1422
|
let n = e.bMarks[t] + e.tShift[t], r = e.eMarks[t], i = n;
|
|
1415
1423
|
if (i + 1 >= r) return -1;
|
|
1416
1424
|
let a = e.src.charCodeAt(i++);
|
|
@@ -1424,21 +1432,21 @@ function Dt(e, t) {
|
|
|
1424
1432
|
if (a === 41 || a === 46) break;
|
|
1425
1433
|
return -1;
|
|
1426
1434
|
}
|
|
1427
|
-
return i < r && (a = e.src.charCodeAt(i), !
|
|
1435
|
+
return i < r && (a = e.src.charCodeAt(i), !N(a)) ? -1 : i;
|
|
1428
1436
|
}
|
|
1429
|
-
function
|
|
1437
|
+
function kt(e, t) {
|
|
1430
1438
|
let n = e.level + 2;
|
|
1431
1439
|
for (let r = t + 2, i = e.tokens.length - 2; r < i; r++) e.tokens[r].level === n && e.tokens[r].type === "paragraph_open" && (e.tokens[r + 2].hidden = !0, e.tokens[r].hidden = !0, r += 2);
|
|
1432
1440
|
}
|
|
1433
|
-
function
|
|
1441
|
+
function At(e, t, n, r) {
|
|
1434
1442
|
let i, a, o, s, c = t, l = !0;
|
|
1435
1443
|
if (e.sCount[c] - e.blkIndent >= 4 || e.listIndent >= 0 && e.sCount[c] - e.listIndent >= 4 && e.sCount[c] < e.blkIndent) return !1;
|
|
1436
1444
|
let u = !1;
|
|
1437
1445
|
r && e.parentType === "paragraph" && e.sCount[c] >= e.blkIndent && (u = !0);
|
|
1438
1446
|
let d, f, p;
|
|
1439
|
-
if ((p =
|
|
1447
|
+
if ((p = Ot(e, c)) >= 0) {
|
|
1440
1448
|
if (d = !0, o = e.bMarks[c] + e.tShift[c], f = Number(e.src.slice(o, p - 1)), u && f !== 1) return !1;
|
|
1441
|
-
} else if ((p =
|
|
1449
|
+
} else if ((p = Dt(e, c)) >= 0) d = !1;
|
|
1442
1450
|
else return !1;
|
|
1443
1451
|
if (u && e.skipSpaces(p) >= e.eMarks[c]) return !1;
|
|
1444
1452
|
if (r) return !0;
|
|
@@ -1472,16 +1480,16 @@ function kt(e, t, n, r) {
|
|
|
1472
1480
|
}
|
|
1473
1481
|
if (x) break;
|
|
1474
1482
|
if (d) {
|
|
1475
|
-
if (p =
|
|
1483
|
+
if (p = Ot(e, c), p < 0) break;
|
|
1476
1484
|
o = e.bMarks[c] + e.tShift[c];
|
|
1477
|
-
} else if (p =
|
|
1485
|
+
} else if (p = Dt(e, c), p < 0) break;
|
|
1478
1486
|
if (m !== e.src.charCodeAt(p - 1)) break;
|
|
1479
1487
|
}
|
|
1480
|
-
return s = d ? e.push("ordered_list_close", "ol", -1) : e.push("bullet_list_close", "ul", -1), s.markup = String.fromCharCode(m), g[1] = c, e.line = c, e.parentType = y, l &&
|
|
1488
|
+
return s = d ? e.push("ordered_list_close", "ol", -1) : e.push("bullet_list_close", "ul", -1), s.markup = String.fromCharCode(m), g[1] = c, e.line = c, e.parentType = y, l && kt(e, h), !0;
|
|
1481
1489
|
}
|
|
1482
1490
|
//#endregion
|
|
1483
1491
|
//#region src/rules_block/reference.ts
|
|
1484
|
-
function
|
|
1492
|
+
function jt(e, t, n, r) {
|
|
1485
1493
|
let i = e.bMarks[t] + e.tShift[t], a = e.eMarks[t], o = t + 1;
|
|
1486
1494
|
if (e.sCount[t] - e.blkIndent >= 4 || e.src.charCodeAt(i) !== 91) return !1;
|
|
1487
1495
|
function s(t) {
|
|
@@ -1525,7 +1533,7 @@ function At(e, t, n, r) {
|
|
|
1525
1533
|
if (e === 10) {
|
|
1526
1534
|
let e = s(o);
|
|
1527
1535
|
e !== null && (c += e, a = c.length, o++);
|
|
1528
|
-
} else if (!
|
|
1536
|
+
} else if (!N(e)) break;
|
|
1529
1537
|
}
|
|
1530
1538
|
let u = e.md.helpers.parseLinkDestination(c, i, a);
|
|
1531
1539
|
if (!u.ok) return !1;
|
|
@@ -1538,7 +1546,7 @@ function At(e, t, n, r) {
|
|
|
1538
1546
|
if (e === 10) {
|
|
1539
1547
|
let e = s(o);
|
|
1540
1548
|
e !== null && (c += e, a = c.length, o++);
|
|
1541
|
-
} else if (!
|
|
1549
|
+
} else if (!N(e)) break;
|
|
1542
1550
|
}
|
|
1543
1551
|
let h = e.md.helpers.parseLinkTitle(c, i, a);
|
|
1544
1552
|
for (; h.can_continue;) {
|
|
@@ -1547,10 +1555,10 @@ function At(e, t, n, r) {
|
|
|
1547
1555
|
c += t, i = a, a = c.length, o++, h = e.md.helpers.parseLinkTitle(c, i, a, h);
|
|
1548
1556
|
}
|
|
1549
1557
|
let g;
|
|
1550
|
-
for (i < a && m !== i && h.ok ? (g = h.str, i = h.pos) : (g = "", i = f, o = p); i < a &&
|
|
1551
|
-
if (i < a && c.charCodeAt(i) !== 10 && g) for (g = "", i = f, o = p; i < a &&
|
|
1558
|
+
for (i < a && m !== i && h.ok ? (g = h.str, i = h.pos) : (g = "", i = f, o = p); i < a && N(c.charCodeAt(i));) i++;
|
|
1559
|
+
if (i < a && c.charCodeAt(i) !== 10 && g) for (g = "", i = f, o = p; i < a && N(c.charCodeAt(i));) i++;
|
|
1552
1560
|
if (i < a && c.charCodeAt(i) !== 10) return !1;
|
|
1553
|
-
let _ =
|
|
1561
|
+
let _ = L(c.slice(1, l));
|
|
1554
1562
|
if (!_) return !1;
|
|
1555
1563
|
/* istanbul ignore if */
|
|
1556
1564
|
if (r) return !0;
|
|
@@ -1565,7 +1573,7 @@ function At(e, t, n, r) {
|
|
|
1565
1573
|
}
|
|
1566
1574
|
//#endregion
|
|
1567
1575
|
//#region src/common/html_blocks.ts
|
|
1568
|
-
var
|
|
1576
|
+
var Mt = /* @__PURE__ */ "address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul".split("."), Nt = "<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>", Pt = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>", Ft = RegExp(`^(?:${Nt}|${Pt}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`), It = RegExp(`^(?:${Nt}|${Pt})`), G = [
|
|
1569
1577
|
[
|
|
1570
1578
|
/^<(script|pre|style|textarea)(?=(\s|>|$))/i,
|
|
1571
1579
|
/<\/(script|pre|style|textarea)>/i,
|
|
@@ -1592,26 +1600,26 @@ var jt = /* @__PURE__ */ "address.article.aside.base.basefont.blockquote.body.ca
|
|
|
1592
1600
|
!0
|
|
1593
1601
|
],
|
|
1594
1602
|
[
|
|
1595
|
-
RegExp(`^</?(${
|
|
1603
|
+
RegExp(`^</?(${Mt.join("|")})(?=(\\s|/?>|$))`, "i"),
|
|
1596
1604
|
/^$/,
|
|
1597
1605
|
!0
|
|
1598
1606
|
],
|
|
1599
1607
|
[
|
|
1600
|
-
RegExp(`${
|
|
1608
|
+
RegExp(`${It.source}\\s*$`),
|
|
1601
1609
|
/^$/,
|
|
1602
1610
|
!1
|
|
1603
1611
|
]
|
|
1604
1612
|
];
|
|
1605
|
-
function
|
|
1613
|
+
function Lt(e, t, n, r) {
|
|
1606
1614
|
let i = e.bMarks[t] + e.tShift[t], a = e.eMarks[t];
|
|
1607
1615
|
if (e.sCount[t] - e.blkIndent >= 4 || !e.md.options.html || e.src.charCodeAt(i) !== 60) return !1;
|
|
1608
1616
|
let o = e.src.slice(i, a), s = 0;
|
|
1609
|
-
for (; s <
|
|
1610
|
-
if (s ===
|
|
1611
|
-
if (r) return
|
|
1612
|
-
let c = t + 1, l =
|
|
1613
|
-
if (!
|
|
1614
|
-
for (; c < n && !(e.sCount[c] < e.blkIndent && (l || !e.isEmpty(c))); c++) if (i = e.bMarks[c] + e.tShift[c], a = e.eMarks[c], o = e.src.slice(i, a),
|
|
1617
|
+
for (; s < G.length && !G[s][0].test(o); s++);
|
|
1618
|
+
if (s === G.length) return !1;
|
|
1619
|
+
if (r) return G[s][2];
|
|
1620
|
+
let c = t + 1, l = G[s][1].test("");
|
|
1621
|
+
if (!G[s][1].test(o)) {
|
|
1622
|
+
for (; c < n && !(e.sCount[c] < e.blkIndent && (l || !e.isEmpty(c))); c++) if (i = e.bMarks[c] + e.tShift[c], a = e.eMarks[c], o = e.src.slice(i, a), G[s][1].test(o)) {
|
|
1615
1623
|
o.length !== 0 && c++;
|
|
1616
1624
|
break;
|
|
1617
1625
|
}
|
|
@@ -1622,28 +1630,28 @@ function It(e, t, n, r) {
|
|
|
1622
1630
|
}
|
|
1623
1631
|
//#endregion
|
|
1624
1632
|
//#region src/rules_block/heading.ts
|
|
1625
|
-
function
|
|
1633
|
+
function Rt(e, t, n, r) {
|
|
1626
1634
|
let i = e.bMarks[t] + e.tShift[t], a = e.eMarks[t];
|
|
1627
1635
|
if (e.sCount[t] - e.blkIndent >= 4) return !1;
|
|
1628
1636
|
let o = e.src.charCodeAt(i);
|
|
1629
1637
|
if (o !== 35 || i >= a) return !1;
|
|
1630
1638
|
let s = 1;
|
|
1631
1639
|
for (o = e.src.charCodeAt(++i); o === 35 && i < a && s <= 6;) s++, o = e.src.charCodeAt(++i);
|
|
1632
|
-
if (s > 6 || i < a && !
|
|
1640
|
+
if (s > 6 || i < a && !N(o)) return !1;
|
|
1633
1641
|
if (r) return !0;
|
|
1634
1642
|
a = e.skipSpacesBack(a, i);
|
|
1635
1643
|
let c = e.skipCharsBack(a, 35, i);
|
|
1636
|
-
c > i &&
|
|
1644
|
+
c > i && N(e.src.charCodeAt(c - 1)) && (a = c), e.line = t + 1;
|
|
1637
1645
|
let l = e.push("heading_open", `h${s}`, 1);
|
|
1638
1646
|
l.markup = "########".slice(0, s), l.map = [t, e.line];
|
|
1639
1647
|
let u = e.push("inline", "", 0);
|
|
1640
|
-
u.content =
|
|
1648
|
+
u.content = R(e.src.slice(i, a)), u.map = [t, e.line], u.children = [];
|
|
1641
1649
|
let d = e.push("heading_close", `h${s}`, -1);
|
|
1642
1650
|
return d.markup = "########".slice(0, s), !0;
|
|
1643
1651
|
}
|
|
1644
1652
|
//#endregion
|
|
1645
1653
|
//#region src/rules_block/lheading.ts
|
|
1646
|
-
function
|
|
1654
|
+
function zt(e, t, n) {
|
|
1647
1655
|
let r = e.md.block.ruler.getRules("paragraph");
|
|
1648
1656
|
if (e.sCount[t] - e.blkIndent >= 4) return !1;
|
|
1649
1657
|
let i = e.parentType;
|
|
@@ -1667,7 +1675,7 @@ function Rt(e, t, n) {
|
|
|
1667
1675
|
if (t) break;
|
|
1668
1676
|
}
|
|
1669
1677
|
if (!a) return e.parentType = i, !1;
|
|
1670
|
-
let c =
|
|
1678
|
+
let c = R(e.getLines(t, s, e.blkIndent, !1));
|
|
1671
1679
|
e.line = s + 1;
|
|
1672
1680
|
let l = e.push("heading_open", `h${a}`, 1);
|
|
1673
1681
|
l.markup = String.fromCharCode(o), l.map = [t, e.line];
|
|
@@ -1678,7 +1686,7 @@ function Rt(e, t, n) {
|
|
|
1678
1686
|
}
|
|
1679
1687
|
//#endregion
|
|
1680
1688
|
//#region src/rules_block/paragraph.ts
|
|
1681
|
-
function
|
|
1689
|
+
function Bt(e, t, n) {
|
|
1682
1690
|
let r = e.md.block.ruler.getRules("paragraph"), i = e.parentType, a = t + 1;
|
|
1683
1691
|
for (e.parentType = "paragraph"; a < n && !e.isEmpty(a); a++) {
|
|
1684
1692
|
if (e.sCount[a] - e.blkIndent > 3 || e.sCount[a] < 0) continue;
|
|
@@ -1689,7 +1697,7 @@ function zt(e, t, n) {
|
|
|
1689
1697
|
}
|
|
1690
1698
|
if (t) break;
|
|
1691
1699
|
}
|
|
1692
|
-
let o =
|
|
1700
|
+
let o = R(e.getLines(t, a, e.blkIndent, !1));
|
|
1693
1701
|
e.line = a;
|
|
1694
1702
|
let s = e.push("paragraph_open", "p", 1);
|
|
1695
1703
|
s.map = [t, e.line];
|
|
@@ -1698,16 +1706,16 @@ function zt(e, t, n) {
|
|
|
1698
1706
|
}
|
|
1699
1707
|
//#endregion
|
|
1700
1708
|
//#region src/parser_block.ts
|
|
1701
|
-
var
|
|
1709
|
+
var K = [
|
|
1702
1710
|
[
|
|
1703
1711
|
"table",
|
|
1704
|
-
|
|
1712
|
+
St,
|
|
1705
1713
|
["paragraph", "reference"]
|
|
1706
1714
|
],
|
|
1707
|
-
["code",
|
|
1715
|
+
["code", Ct],
|
|
1708
1716
|
[
|
|
1709
1717
|
"fence",
|
|
1710
|
-
|
|
1718
|
+
wt,
|
|
1711
1719
|
[
|
|
1712
1720
|
"paragraph",
|
|
1713
1721
|
"reference",
|
|
@@ -1717,7 +1725,7 @@ var G = [
|
|
|
1717
1725
|
],
|
|
1718
1726
|
[
|
|
1719
1727
|
"blockquote",
|
|
1720
|
-
|
|
1728
|
+
Tt,
|
|
1721
1729
|
[
|
|
1722
1730
|
"paragraph",
|
|
1723
1731
|
"reference",
|
|
@@ -1727,7 +1735,7 @@ var G = [
|
|
|
1727
1735
|
],
|
|
1728
1736
|
[
|
|
1729
1737
|
"hr",
|
|
1730
|
-
|
|
1738
|
+
Et,
|
|
1731
1739
|
[
|
|
1732
1740
|
"paragraph",
|
|
1733
1741
|
"reference",
|
|
@@ -1737,17 +1745,17 @@ var G = [
|
|
|
1737
1745
|
],
|
|
1738
1746
|
[
|
|
1739
1747
|
"list",
|
|
1740
|
-
|
|
1748
|
+
At,
|
|
1741
1749
|
[
|
|
1742
1750
|
"paragraph",
|
|
1743
1751
|
"reference",
|
|
1744
1752
|
"blockquote"
|
|
1745
1753
|
]
|
|
1746
1754
|
],
|
|
1747
|
-
["reference",
|
|
1755
|
+
["reference", jt],
|
|
1748
1756
|
[
|
|
1749
1757
|
"html_block",
|
|
1750
|
-
|
|
1758
|
+
Lt,
|
|
1751
1759
|
[
|
|
1752
1760
|
"paragraph",
|
|
1753
1761
|
"reference",
|
|
@@ -1756,19 +1764,19 @@ var G = [
|
|
|
1756
1764
|
],
|
|
1757
1765
|
[
|
|
1758
1766
|
"heading",
|
|
1759
|
-
|
|
1767
|
+
Rt,
|
|
1760
1768
|
[
|
|
1761
1769
|
"paragraph",
|
|
1762
1770
|
"reference",
|
|
1763
1771
|
"blockquote"
|
|
1764
1772
|
]
|
|
1765
1773
|
],
|
|
1766
|
-
["lheading",
|
|
1767
|
-
["paragraph",
|
|
1768
|
-
],
|
|
1774
|
+
["lheading", zt],
|
|
1775
|
+
["paragraph", Bt]
|
|
1776
|
+
], Vt = class {
|
|
1769
1777
|
constructor() {
|
|
1770
|
-
T(this, "ruler", new
|
|
1771
|
-
for (let e = 0; e <
|
|
1778
|
+
T(this, "ruler", new B()), T(this, "State", yt);
|
|
1779
|
+
for (let e = 0; e < K.length; e++) this.ruler.push(K[e][0], K[e][1], { alt: (K[e][2] || []).slice() });
|
|
1772
1780
|
}
|
|
1773
1781
|
tokenize(e, t, n) {
|
|
1774
1782
|
let r = this.ruler.getRules(""), i = r.length, a = e.md.options.maxNesting, o = t, s = !1;
|
|
@@ -1791,17 +1799,17 @@ var G = [
|
|
|
1791
1799
|
let i = new this.State(e, t, n, r);
|
|
1792
1800
|
this.tokenize(i, i.line, i.lineMax);
|
|
1793
1801
|
}
|
|
1794
|
-
},
|
|
1802
|
+
}, Ht = class {
|
|
1795
1803
|
constructor(e, t, n, r) {
|
|
1796
|
-
T(this, "pos", 0), T(this, "level", 0), T(this, "pending", ""), T(this, "pendingLevel", 0), T(this, "cache", {}), T(this, "backticks", {}), T(this, "backticksScanned", !1), T(this, "linkLevel", 0), T(this, "delimiters", []), T(this, "_prev_delimiters", []), T(this, "Token",
|
|
1804
|
+
T(this, "pos", 0), T(this, "level", 0), T(this, "pending", ""), T(this, "pendingLevel", 0), T(this, "cache", {}), T(this, "backticks", {}), T(this, "backticksScanned", !1), T(this, "linkLevel", 0), T(this, "delimiters", []), T(this, "_prev_delimiters", []), T(this, "Token", z), this.src = e, this.env = n, this.md = t, this.tokens = r, this.tokens_meta = Array(r.length), this.posMax = this.src.length;
|
|
1797
1805
|
}
|
|
1798
1806
|
pushPending() {
|
|
1799
|
-
let e = new
|
|
1807
|
+
let e = new z("text", "", 0);
|
|
1800
1808
|
return e.content = this.pending, e.level = this.pendingLevel, this.tokens.push(e), this.pending = "", e;
|
|
1801
1809
|
}
|
|
1802
1810
|
push(e, t, n) {
|
|
1803
1811
|
this.pending && this.pushPending();
|
|
1804
|
-
let r = new
|
|
1812
|
+
let r = new z(e, t, n), i;
|
|
1805
1813
|
return n < 0 && (this.level--, this.delimiters = this._prev_delimiters.pop()), r.level = this.level, n > 0 && (this.level++, this._prev_delimiters.push(this.delimiters), this.delimiters = [], i = { delimiters: this.delimiters }), this.pendingLevel = this.level, this.tokens.push(r), this.tokens_meta.push(i), r;
|
|
1806
1814
|
}
|
|
1807
1815
|
scanDelims(e, t) {
|
|
@@ -1819,7 +1827,7 @@ var G = [
|
|
|
1819
1827
|
let e = this.src.charCodeAt(a + 1);
|
|
1820
1828
|
s = (e & 64512) == 56320 ? 65536 + (s - 55296 << 10) + (e - 56320) : 65533;
|
|
1821
1829
|
} else (s & 64512) == 56320 && (s = 65533);
|
|
1822
|
-
let c =
|
|
1830
|
+
let c = I(i) || F(i), l = I(s) || F(s), u = P(i), d = P(s), f = !d && (!l || u || c), p = !u && (!c || d || l);
|
|
1823
1831
|
return {
|
|
1824
1832
|
can_open: f && (t || !p || c),
|
|
1825
1833
|
can_close: p && (t || !f || l),
|
|
@@ -1829,7 +1837,7 @@ var G = [
|
|
|
1829
1837
|
};
|
|
1830
1838
|
//#endregion
|
|
1831
1839
|
//#region src/rules_inline/text.ts
|
|
1832
|
-
function
|
|
1840
|
+
function Ut(e) {
|
|
1833
1841
|
switch (e) {
|
|
1834
1842
|
case 10:
|
|
1835
1843
|
case 33:
|
|
@@ -1857,26 +1865,26 @@ function Ht(e) {
|
|
|
1857
1865
|
default: return !1;
|
|
1858
1866
|
}
|
|
1859
1867
|
}
|
|
1860
|
-
function
|
|
1868
|
+
function Wt(e, t) {
|
|
1861
1869
|
let n = e.pos;
|
|
1862
|
-
for (; n < e.posMax && !
|
|
1870
|
+
for (; n < e.posMax && !Ut(e.src.charCodeAt(n));) n++;
|
|
1863
1871
|
return n !== e.pos && (t || (e.pending += e.src.slice(e.pos, n)), e.pos = n, !0);
|
|
1864
1872
|
}
|
|
1865
1873
|
//#endregion
|
|
1866
1874
|
//#region src/rules_inline/linkify.ts
|
|
1867
|
-
function
|
|
1875
|
+
function Gt(e) {
|
|
1868
1876
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
1869
1877
|
}
|
|
1870
|
-
function
|
|
1878
|
+
function Kt(e) {
|
|
1871
1879
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || e === 43 || e === 45 || e === 46;
|
|
1872
1880
|
}
|
|
1873
|
-
function
|
|
1881
|
+
function qt(e, t) {
|
|
1874
1882
|
if (!e.md.options.linkify || e.linkLevel > 0) return !1;
|
|
1875
1883
|
let n = e.pos, r = e.posMax;
|
|
1876
1884
|
if (n + 3 > r || e.src.charCodeAt(n) !== 58 || e.src.charCodeAt(n + 1) !== 47 || e.src.charCodeAt(n + 2) !== 47) return !1;
|
|
1877
1885
|
let i = n - Math.min(10, e.pending.length, n), a = n;
|
|
1878
|
-
for (; a > i &&
|
|
1879
|
-
if (a === n || !
|
|
1886
|
+
for (; a > i && Kt(e.src.charCodeAt(a - 1));) a--;
|
|
1887
|
+
if (a === n || !Gt(e.src.charCodeAt(a))) return !1;
|
|
1880
1888
|
let o = n - a, s = e.md.linkify.matchAtStart(e.src.slice(a));
|
|
1881
1889
|
if (!s) return !1;
|
|
1882
1890
|
let c = s.url;
|
|
@@ -1899,7 +1907,7 @@ function Kt(e, t) {
|
|
|
1899
1907
|
}
|
|
1900
1908
|
//#endregion
|
|
1901
1909
|
//#region src/rules_inline/newline.ts
|
|
1902
|
-
function
|
|
1910
|
+
function Jt(e, t) {
|
|
1903
1911
|
let n = e.pos;
|
|
1904
1912
|
if (e.src.charCodeAt(n) !== 10) return !1;
|
|
1905
1913
|
let r = e.pending.length - 1, i = e.posMax;
|
|
@@ -1909,22 +1917,22 @@ function qt(e, t) {
|
|
|
1909
1917
|
e.pending = e.pending.slice(0, t), e.push("hardbreak", "br", 0);
|
|
1910
1918
|
} else e.pending = e.pending.slice(0, -1), e.push("softbreak", "br", 0);
|
|
1911
1919
|
else e.push("softbreak", "br", 0);
|
|
1912
|
-
for (n++; n < i &&
|
|
1920
|
+
for (n++; n < i && N(e.src.charCodeAt(n));) n++;
|
|
1913
1921
|
return e.pos = n, !0;
|
|
1914
1922
|
}
|
|
1915
1923
|
//#endregion
|
|
1916
1924
|
//#region src/rules_inline/escape.ts
|
|
1917
|
-
var
|
|
1918
|
-
for (let e = 0; e < 256; e++)
|
|
1925
|
+
var q = [];
|
|
1926
|
+
for (let e = 0; e < 256; e++) q.push(0);
|
|
1919
1927
|
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e) {
|
|
1920
|
-
|
|
1928
|
+
q[e.charCodeAt(0)] = 1;
|
|
1921
1929
|
});
|
|
1922
|
-
function
|
|
1930
|
+
function Yt(e, t) {
|
|
1923
1931
|
let n = e.pos, r = e.posMax;
|
|
1924
1932
|
if (e.src.charCodeAt(n) !== 92 || (n++, n >= r)) return !1;
|
|
1925
1933
|
let i = e.src.charCodeAt(n);
|
|
1926
1934
|
if (i === 10) {
|
|
1927
|
-
for (t || e.push("hardbreak", "br", 0), n++; n < r && (i = e.src.charCodeAt(n),
|
|
1935
|
+
for (t || e.push("hardbreak", "br", 0), n++; n < r && (i = e.src.charCodeAt(n), N(i));) n++;
|
|
1928
1936
|
return e.pos = n, !0;
|
|
1929
1937
|
}
|
|
1930
1938
|
if (i === 32) {
|
|
@@ -1942,13 +1950,13 @@ function Jt(e, t) {
|
|
|
1942
1950
|
let o = "\\" + a;
|
|
1943
1951
|
if (!t) {
|
|
1944
1952
|
let t = e.push("text_special", "", 0);
|
|
1945
|
-
t.content = i < 256 &&
|
|
1953
|
+
t.content = i < 256 && q[i] !== 0 ? a : o, t.markup = o, t.info = "escape";
|
|
1946
1954
|
}
|
|
1947
1955
|
return e.pos = n + 1, !0;
|
|
1948
1956
|
}
|
|
1949
1957
|
//#endregion
|
|
1950
1958
|
//#region src/rules_inline/backticks.ts
|
|
1951
|
-
function
|
|
1959
|
+
function Xt(e) {
|
|
1952
1960
|
let t = {}, n = 0;
|
|
1953
1961
|
for (; (n = e.indexOf("`", n)) !== -1;) {
|
|
1954
1962
|
let r = n;
|
|
@@ -1957,14 +1965,14 @@ function Yt(e) {
|
|
|
1957
1965
|
}
|
|
1958
1966
|
return t;
|
|
1959
1967
|
}
|
|
1960
|
-
function
|
|
1968
|
+
function Zt(e, t) {
|
|
1961
1969
|
var n;
|
|
1962
1970
|
let r = e.pos;
|
|
1963
1971
|
if (e.src.charCodeAt(r) !== 96) return !1;
|
|
1964
1972
|
let i = e.posMax, a = r + 1;
|
|
1965
1973
|
for (; a < i && e.src.charCodeAt(a) === 96;) a++;
|
|
1966
1974
|
let o = e.src.slice(r, a), s = o.length;
|
|
1967
|
-
if (e.backticksScanned || (e.backticks =
|
|
1975
|
+
if (e.backticksScanned || (e.backticks = Xt(e.src), e.backticksScanned = !0), ((n = e.backticks[s]) == null ? -1 : n) >= a) {
|
|
1968
1976
|
let n = a, r;
|
|
1969
1977
|
for (; (r = e.src.indexOf("`", n)) !== -1 && r < i;) {
|
|
1970
1978
|
for (n = r + 1; e.src.charCodeAt(n) === 96;) n++;
|
|
@@ -1984,7 +1992,7 @@ function Xt(e, t) {
|
|
|
1984
1992
|
}
|
|
1985
1993
|
//#endregion
|
|
1986
1994
|
//#region src/rules_inline/strikethrough.ts
|
|
1987
|
-
function
|
|
1995
|
+
function Qt(e, t) {
|
|
1988
1996
|
let n = e.pos, r = e.src.charCodeAt(n);
|
|
1989
1997
|
if (t || r !== 126) return !1;
|
|
1990
1998
|
let i = e.scanDelims(e.pos, !0), a = i.length, o = String.fromCharCode(r);
|
|
@@ -2001,7 +2009,7 @@ function Zt(e, t) {
|
|
|
2001
2009
|
});
|
|
2002
2010
|
return e.pos += i.length, !0;
|
|
2003
2011
|
}
|
|
2004
|
-
function
|
|
2012
|
+
function $t(e, t) {
|
|
2005
2013
|
let n, r = [], i = t.length;
|
|
2006
2014
|
for (let a = 0; a < i; a++) {
|
|
2007
2015
|
let i = t[a];
|
|
@@ -2015,22 +2023,22 @@ function Qt(e, t) {
|
|
|
2015
2023
|
i--, t !== i && (n = e.tokens[i], e.tokens[i] = e.tokens[t], e.tokens[t] = n);
|
|
2016
2024
|
}
|
|
2017
2025
|
}
|
|
2018
|
-
function
|
|
2026
|
+
function en(e) {
|
|
2019
2027
|
let t = e.tokens_meta, n = e.tokens_meta.length;
|
|
2020
|
-
|
|
2028
|
+
$t(e, e.delimiters);
|
|
2021
2029
|
for (let i = 0; i < n; i++) {
|
|
2022
2030
|
var r;
|
|
2023
2031
|
let n = (r = t[i]) == null ? void 0 : r.delimiters;
|
|
2024
|
-
n &&
|
|
2032
|
+
n && $t(e, n);
|
|
2025
2033
|
}
|
|
2026
2034
|
}
|
|
2027
|
-
var
|
|
2028
|
-
tokenize:
|
|
2029
|
-
postProcess:
|
|
2035
|
+
var tn = {
|
|
2036
|
+
tokenize: Qt,
|
|
2037
|
+
postProcess: en
|
|
2030
2038
|
};
|
|
2031
2039
|
//#endregion
|
|
2032
2040
|
//#region src/rules_inline/emphasis.ts
|
|
2033
|
-
function
|
|
2041
|
+
function nn(e, t) {
|
|
2034
2042
|
let n = e.pos, r = e.src.charCodeAt(n);
|
|
2035
2043
|
if (t || r !== 95 && r !== 42) return !1;
|
|
2036
2044
|
let i = e.scanDelims(e.pos, r === 42);
|
|
@@ -2047,7 +2055,7 @@ function tn(e, t) {
|
|
|
2047
2055
|
}
|
|
2048
2056
|
return e.pos += i.length, !0;
|
|
2049
2057
|
}
|
|
2050
|
-
function
|
|
2058
|
+
function rn(e, t) {
|
|
2051
2059
|
let n = t.length;
|
|
2052
2060
|
for (let r = n - 1; r >= 0; r--) {
|
|
2053
2061
|
let n = t[r];
|
|
@@ -2058,39 +2066,39 @@ function nn(e, t) {
|
|
|
2058
2066
|
c.type = a ? "strong_close" : "em_close", c.tag = a ? "strong" : "em", c.nesting = -1, c.markup = a ? o + o : o, c.content = "", a && (e.tokens[t[r - 1].token].content = "", e.tokens[t[n.end + 1].token].content = "", r--);
|
|
2059
2067
|
}
|
|
2060
2068
|
}
|
|
2061
|
-
function
|
|
2069
|
+
function an(e) {
|
|
2062
2070
|
let t = e.tokens_meta, n = e.tokens_meta.length;
|
|
2063
|
-
|
|
2071
|
+
rn(e, e.delimiters);
|
|
2064
2072
|
for (let i = 0; i < n; i++) {
|
|
2065
2073
|
var r;
|
|
2066
2074
|
let n = (r = t[i]) == null ? void 0 : r.delimiters;
|
|
2067
|
-
n &&
|
|
2075
|
+
n && rn(e, n);
|
|
2068
2076
|
}
|
|
2069
2077
|
}
|
|
2070
|
-
var
|
|
2071
|
-
tokenize:
|
|
2072
|
-
postProcess:
|
|
2078
|
+
var on = {
|
|
2079
|
+
tokenize: nn,
|
|
2080
|
+
postProcess: an
|
|
2073
2081
|
};
|
|
2074
2082
|
//#endregion
|
|
2075
2083
|
//#region src/rules_inline/link.ts
|
|
2076
|
-
function
|
|
2084
|
+
function sn(e, t) {
|
|
2077
2085
|
let n, r, i, a, o = "", s = "", c = e.pos, l = !0;
|
|
2078
2086
|
if (e.src.charCodeAt(e.pos) !== 91) return !1;
|
|
2079
2087
|
let u = e.pos, d = e.posMax, f = e.pos + 1, p = e.md.helpers.parseLinkLabel(e, e.pos, !0);
|
|
2080
2088
|
if (p < 0) return !1;
|
|
2081
2089
|
let m = p + 1;
|
|
2082
2090
|
if (m < d && e.src.charCodeAt(m) === 40) {
|
|
2083
|
-
for (l = !1, m++; m < d && (n = e.src.charCodeAt(m), !(!
|
|
2091
|
+
for (l = !1, m++; m < d && (n = e.src.charCodeAt(m), !(!N(n) && n !== 10)); m++);
|
|
2084
2092
|
if (m >= d) return !1;
|
|
2085
2093
|
if (c = m, i = e.md.helpers.parseLinkDestination(e.src, m, e.posMax), i.ok) {
|
|
2086
|
-
for (o = e.md.normalizeLink(i.str), e.md.validateLink(o) ? m = i.pos : o = "", c = m; m < d && (n = e.src.charCodeAt(m), !(!
|
|
2087
|
-
if (i = e.md.helpers.parseLinkTitle(e.src, m, e.posMax), m < d && c !== m && i.ok) for (s = i.str, m = i.pos; m < d && (n = e.src.charCodeAt(m), !(!
|
|
2094
|
+
for (o = e.md.normalizeLink(i.str), e.md.validateLink(o) ? m = i.pos : o = "", c = m; m < d && (n = e.src.charCodeAt(m), !(!N(n) && n !== 10)); m++);
|
|
2095
|
+
if (i = e.md.helpers.parseLinkTitle(e.src, m, e.posMax), m < d && c !== m && i.ok) for (s = i.str, m = i.pos; m < d && (n = e.src.charCodeAt(m), !(!N(n) && n !== 10)); m++);
|
|
2088
2096
|
}
|
|
2089
2097
|
(m >= d || e.src.charCodeAt(m) !== 41) && (l = !0), m++;
|
|
2090
2098
|
}
|
|
2091
2099
|
if (l) {
|
|
2092
2100
|
if (e.env.references === void 0) return !1;
|
|
2093
|
-
if (m < d && e.src.charCodeAt(m) === 91 ? (c = m + 1, m = e.md.helpers.parseLinkLabel(e, m), m >= 0 ? r = e.src.slice(c, m++) : m = p + 1) : m = p + 1, r || (r = e.src.slice(f, p)), r =
|
|
2101
|
+
if (m < d && e.src.charCodeAt(m) === 91 ? (c = m + 1, m = e.md.helpers.parseLinkLabel(e, m), m >= 0 ? r = e.src.slice(c, m++) : m = p + 1) : m = p + 1, r || (r = e.src.slice(f, p)), r = L(r), a = e.env.references[r], !a) return e.pos = u, !1;
|
|
2094
2102
|
o = a.href, s = a.title;
|
|
2095
2103
|
}
|
|
2096
2104
|
if (!t) {
|
|
@@ -2106,22 +2114,22 @@ function on(e, t) {
|
|
|
2106
2114
|
}
|
|
2107
2115
|
//#endregion
|
|
2108
2116
|
//#region src/rules_inline/image.ts
|
|
2109
|
-
function
|
|
2117
|
+
function cn(e, t) {
|
|
2110
2118
|
let n, r, i, a, o, s, c, l, u = "", d = e.pos, f = e.posMax;
|
|
2111
2119
|
if (e.src.charCodeAt(e.pos) !== 33 || e.src.charCodeAt(e.pos + 1) !== 91) return !1;
|
|
2112
2120
|
let p = e.pos + 2, m = e.md.helpers.parseLinkLabel(e, e.pos + 1, !1);
|
|
2113
2121
|
if (m < 0) return !1;
|
|
2114
2122
|
if (a = m + 1, a < f && e.src.charCodeAt(a) === 40) {
|
|
2115
|
-
for (a++; a < f && (n = e.src.charCodeAt(a), !(!
|
|
2123
|
+
for (a++; a < f && (n = e.src.charCodeAt(a), !(!N(n) && n !== 10)); a++);
|
|
2116
2124
|
if (a >= f) return !1;
|
|
2117
|
-
for (l = a, s = e.md.helpers.parseLinkDestination(e.src, a, e.posMax), s.ok && (u = e.md.normalizeLink(s.str), e.md.validateLink(u) ? a = s.pos : u = ""), l = a; a < f && (n = e.src.charCodeAt(a), !(!
|
|
2118
|
-
if (s = e.md.helpers.parseLinkTitle(e.src, a, e.posMax), a < f && l !== a && s.ok) for (c = s.str, a = s.pos; a < f && (n = e.src.charCodeAt(a), !(!
|
|
2125
|
+
for (l = a, s = e.md.helpers.parseLinkDestination(e.src, a, e.posMax), s.ok && (u = e.md.normalizeLink(s.str), e.md.validateLink(u) ? a = s.pos : u = ""), l = a; a < f && (n = e.src.charCodeAt(a), !(!N(n) && n !== 10)); a++);
|
|
2126
|
+
if (s = e.md.helpers.parseLinkTitle(e.src, a, e.posMax), a < f && l !== a && s.ok) for (c = s.str, a = s.pos; a < f && (n = e.src.charCodeAt(a), !(!N(n) && n !== 10)); a++);
|
|
2119
2127
|
else c = "";
|
|
2120
2128
|
if (a >= f || e.src.charCodeAt(a) !== 41) return e.pos = d, !1;
|
|
2121
2129
|
a++;
|
|
2122
2130
|
} else {
|
|
2123
2131
|
if (e.env.references === void 0) return !1;
|
|
2124
|
-
if (a < f && e.src.charCodeAt(a) === 91 ? (l = a + 1, a = e.md.helpers.parseLinkLabel(e, a), a >= 0 ? i = e.src.slice(l, a++) : a = m + 1) : a = m + 1, i || (i = e.src.slice(p, m)), i =
|
|
2132
|
+
if (a < f && e.src.charCodeAt(a) === 91 ? (l = a + 1, a = e.md.helpers.parseLinkLabel(e, a), a >= 0 ? i = e.src.slice(l, a++) : a = m + 1) : a = m + 1, i || (i = e.src.slice(p, m)), i = L(i), o = e.env.references[i], !o) return e.pos = d, !1;
|
|
2125
2133
|
u = o.href, c = o.title;
|
|
2126
2134
|
}
|
|
2127
2135
|
if (!t) {
|
|
@@ -2138,8 +2146,8 @@ function sn(e, t) {
|
|
|
2138
2146
|
}
|
|
2139
2147
|
//#endregion
|
|
2140
2148
|
//#region src/rules_inline/autolink.ts
|
|
2141
|
-
var
|
|
2142
|
-
function
|
|
2149
|
+
var ln = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/, un = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
|
|
2150
|
+
function dn(e, t) {
|
|
2143
2151
|
let n = e.pos;
|
|
2144
2152
|
if (e.src.charCodeAt(n) !== 60) return !1;
|
|
2145
2153
|
let r = e.pos, i = e.posMax;
|
|
@@ -2150,7 +2158,7 @@ function un(e, t) {
|
|
|
2150
2158
|
if (t === 62) break;
|
|
2151
2159
|
}
|
|
2152
2160
|
let a = e.src.slice(r + 1, n);
|
|
2153
|
-
if (
|
|
2161
|
+
if (un.test(a)) {
|
|
2154
2162
|
let n = e.md.normalizeLink(a);
|
|
2155
2163
|
if (!e.md.validateLink(n)) return !1;
|
|
2156
2164
|
if (!t) {
|
|
@@ -2163,7 +2171,7 @@ function un(e, t) {
|
|
|
2163
2171
|
}
|
|
2164
2172
|
return e.pos += a.length + 2, !0;
|
|
2165
2173
|
}
|
|
2166
|
-
if (
|
|
2174
|
+
if (ln.test(a)) {
|
|
2167
2175
|
let n = e.md.normalizeLink(`mailto:${a}`);
|
|
2168
2176
|
if (!e.md.validateLink(n)) return !1;
|
|
2169
2177
|
if (!t) {
|
|
@@ -2180,49 +2188,49 @@ function un(e, t) {
|
|
|
2180
2188
|
}
|
|
2181
2189
|
//#endregion
|
|
2182
2190
|
//#region src/rules_inline/html_inline.ts
|
|
2183
|
-
function
|
|
2191
|
+
function fn(e) {
|
|
2184
2192
|
return /^<a[>\s]/i.test(e);
|
|
2185
2193
|
}
|
|
2186
|
-
function
|
|
2194
|
+
function pn(e) {
|
|
2187
2195
|
return /^<\/a\s*>/i.test(e);
|
|
2188
2196
|
}
|
|
2189
|
-
function
|
|
2197
|
+
function mn(e) {
|
|
2190
2198
|
let t = e | 32;
|
|
2191
2199
|
return t >= 97 && t <= 122;
|
|
2192
2200
|
}
|
|
2193
|
-
function
|
|
2201
|
+
function hn(e, t) {
|
|
2194
2202
|
if (!e.md.options.html) return !1;
|
|
2195
2203
|
let n = e.posMax, r = e.pos;
|
|
2196
2204
|
if (e.src.charCodeAt(r) !== 60 || r + 2 >= n) return !1;
|
|
2197
2205
|
let i = e.src.charCodeAt(r + 1);
|
|
2198
|
-
if (i !== 33 && i !== 63 && i !== 47 && !
|
|
2199
|
-
let a = e.src.slice(r).match(
|
|
2206
|
+
if (i !== 33 && i !== 63 && i !== 47 && !mn(i)) return !1;
|
|
2207
|
+
let a = e.src.slice(r).match(Ft);
|
|
2200
2208
|
if (!a) return !1;
|
|
2201
2209
|
if (!t) {
|
|
2202
2210
|
let t = e.push("html_inline", "", 0);
|
|
2203
|
-
t.content = a[0],
|
|
2211
|
+
t.content = a[0], fn(t.content) && e.linkLevel++, pn(t.content) && e.linkLevel--;
|
|
2204
2212
|
}
|
|
2205
2213
|
return e.pos += a[0].length, !0;
|
|
2206
2214
|
}
|
|
2207
2215
|
//#endregion
|
|
2208
2216
|
//#region src/rules_inline/entity.ts
|
|
2209
|
-
var
|
|
2210
|
-
function
|
|
2217
|
+
var gn = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i, _n = /^&([a-z][a-z0-9]{1,31});/i;
|
|
2218
|
+
function vn(e, t) {
|
|
2211
2219
|
let n = e.pos, r = e.posMax;
|
|
2212
2220
|
if (e.src.charCodeAt(n) !== 38 || n + 1 >= r) return !1;
|
|
2213
2221
|
if (e.src.charCodeAt(n + 1) === 35) {
|
|
2214
|
-
let r = e.src.slice(n).match(
|
|
2222
|
+
let r = e.src.slice(n).match(gn);
|
|
2215
2223
|
if (r) {
|
|
2216
2224
|
if (!t) {
|
|
2217
2225
|
let t = r[1][0].toLowerCase() === "x" ? parseInt(r[1].slice(1), 16) : parseInt(r[1], 10), n = e.push("text_special", "", 0);
|
|
2218
|
-
n.content =
|
|
2226
|
+
n.content = we(t) ? A(t) : A(65533), n.markup = r[0], n.info = "entity";
|
|
2219
2227
|
}
|
|
2220
2228
|
return e.pos += r[0].length, !0;
|
|
2221
2229
|
}
|
|
2222
2230
|
} else {
|
|
2223
|
-
let r = e.src.slice(n).match(
|
|
2231
|
+
let r = e.src.slice(n).match(_n);
|
|
2224
2232
|
if (r) {
|
|
2225
|
-
let n =
|
|
2233
|
+
let n = be(r[0]);
|
|
2226
2234
|
if (n !== r[0]) {
|
|
2227
2235
|
if (!t) {
|
|
2228
2236
|
let t = e.push("text_special", "", 0);
|
|
@@ -2236,7 +2244,7 @@ function _n(e, t) {
|
|
|
2236
2244
|
}
|
|
2237
2245
|
//#endregion
|
|
2238
2246
|
//#region src/rules_inline/balance_pairs.ts
|
|
2239
|
-
function
|
|
2247
|
+
function yn(e) {
|
|
2240
2248
|
let t = {}, n = e.length;
|
|
2241
2249
|
if (!n) return;
|
|
2242
2250
|
let r = 0, i = -2, a = [];
|
|
@@ -2266,47 +2274,47 @@ function vn(e) {
|
|
|
2266
2274
|
l !== -1 && (t[n.marker][(n.open ? 3 : 0) + (n.length || 0) % 3] = l);
|
|
2267
2275
|
}
|
|
2268
2276
|
}
|
|
2269
|
-
function
|
|
2277
|
+
function bn(e) {
|
|
2270
2278
|
let t = e.tokens_meta, n = e.tokens_meta.length;
|
|
2271
|
-
|
|
2279
|
+
yn(e.delimiters);
|
|
2272
2280
|
for (let e = 0; e < n; e++) {
|
|
2273
2281
|
var r;
|
|
2274
2282
|
let n = (r = t[e]) == null ? void 0 : r.delimiters;
|
|
2275
|
-
n &&
|
|
2283
|
+
n && yn(n);
|
|
2276
2284
|
}
|
|
2277
2285
|
}
|
|
2278
2286
|
//#endregion
|
|
2279
2287
|
//#region src/rules_inline/fragments_join.ts
|
|
2280
|
-
function
|
|
2288
|
+
function xn(e) {
|
|
2281
2289
|
let t, n, r = 0, i = e.tokens, a = e.tokens.length;
|
|
2282
2290
|
for (t = n = 0; t < a; t++) i[t].nesting < 0 && r--, i[t].level = r, i[t].nesting > 0 && r++, i[t].type === "text" && t + 1 < a && i[t + 1].type === "text" ? i[t + 1].content = i[t].content + i[t + 1].content : (t !== n && (i[n] = i[t]), n++);
|
|
2283
2291
|
t !== n && (i.length = n);
|
|
2284
2292
|
}
|
|
2285
2293
|
//#endregion
|
|
2286
2294
|
//#region src/parser_inline.ts
|
|
2287
|
-
var
|
|
2288
|
-
["text",
|
|
2289
|
-
["linkify",
|
|
2290
|
-
["newline",
|
|
2291
|
-
["escape",
|
|
2292
|
-
["backticks",
|
|
2293
|
-
["strikethrough",
|
|
2294
|
-
["emphasis",
|
|
2295
|
-
["link",
|
|
2296
|
-
["image",
|
|
2297
|
-
["autolink",
|
|
2298
|
-
["html_inline",
|
|
2299
|
-
["entity",
|
|
2300
|
-
],
|
|
2301
|
-
["balance_pairs",
|
|
2302
|
-
["strikethrough",
|
|
2303
|
-
["emphasis",
|
|
2304
|
-
["fragments_join",
|
|
2305
|
-
],
|
|
2295
|
+
var Sn = [
|
|
2296
|
+
["text", Wt],
|
|
2297
|
+
["linkify", qt],
|
|
2298
|
+
["newline", Jt],
|
|
2299
|
+
["escape", Yt],
|
|
2300
|
+
["backticks", Zt],
|
|
2301
|
+
["strikethrough", tn.tokenize],
|
|
2302
|
+
["emphasis", on.tokenize],
|
|
2303
|
+
["link", sn],
|
|
2304
|
+
["image", cn],
|
|
2305
|
+
["autolink", dn],
|
|
2306
|
+
["html_inline", hn],
|
|
2307
|
+
["entity", vn]
|
|
2308
|
+
], Cn = [
|
|
2309
|
+
["balance_pairs", bn],
|
|
2310
|
+
["strikethrough", tn.postProcess],
|
|
2311
|
+
["emphasis", on.postProcess],
|
|
2312
|
+
["fragments_join", xn]
|
|
2313
|
+
], wn = class {
|
|
2306
2314
|
constructor() {
|
|
2307
|
-
T(this, "ruler", new
|
|
2308
|
-
for (let e = 0; e <
|
|
2309
|
-
for (let e = 0; e <
|
|
2315
|
+
T(this, "ruler", new B()), T(this, "ruler2", new B()), T(this, "State", Ht);
|
|
2316
|
+
for (let e = 0; e < Sn.length; e++) this.ruler.push(Sn[e][0], Sn[e][1]);
|
|
2317
|
+
for (let e = 0; e < Cn.length; e++) this.ruler2.push(Cn[e][0], Cn[e][1]);
|
|
2310
2318
|
}
|
|
2311
2319
|
skipToken(e) {
|
|
2312
2320
|
let t = e.pos, n = this.ruler.getRules(""), r = n.length, i = e.md.options.maxNesting, a = e.cache;
|
|
@@ -2347,7 +2355,7 @@ var q = [
|
|
|
2347
2355
|
let a = this.ruler2.getRules(""), o = a.length;
|
|
2348
2356
|
for (let e = 0; e < o; e++) a[e](i);
|
|
2349
2357
|
}
|
|
2350
|
-
},
|
|
2358
|
+
}, Tn = class {
|
|
2351
2359
|
constructor(e = {}) {
|
|
2352
2360
|
T(this, "src_Any", x.source), T(this, "src_Cc", ne.source), T(this, "src_Z", ae.source), T(this, "src_P", S.source), T(this, "src_ZPCc", [
|
|
2353
2361
|
this.src_Z,
|
|
@@ -2498,7 +2506,7 @@ var q = [
|
|
|
2498
2506
|
var e, t;
|
|
2499
2507
|
return (t = (e = this.cache).schema_at_start) == null ? e.schema_at_start = RegExp(`^${this.get_schema_search().source}`, "i") : t;
|
|
2500
2508
|
}
|
|
2501
|
-
},
|
|
2509
|
+
}, En = {
|
|
2502
2510
|
validate: (e, t, n) => {
|
|
2503
2511
|
let r = n.re.get_http_validator();
|
|
2504
2512
|
r.lastIndex = t;
|
|
@@ -2506,10 +2514,10 @@ var q = [
|
|
|
2506
2514
|
return i ? i[0].length : 0;
|
|
2507
2515
|
},
|
|
2508
2516
|
normalize: (e, t) => t.normalize(e)
|
|
2509
|
-
},
|
|
2510
|
-
"http:":
|
|
2511
|
-
"https:":
|
|
2512
|
-
"ftp:":
|
|
2517
|
+
}, Dn = {
|
|
2518
|
+
"http:": En,
|
|
2519
|
+
"https:": En,
|
|
2520
|
+
"ftp:": En,
|
|
2513
2521
|
"//": {
|
|
2514
2522
|
validate: function(e, t, n) {
|
|
2515
2523
|
let r = n.re.get_relative_proto_validator();
|
|
@@ -2528,36 +2536,36 @@ var q = [
|
|
|
2528
2536
|
},
|
|
2529
2537
|
normalize: (e, t) => t.normalize(e)
|
|
2530
2538
|
}
|
|
2531
|
-
},
|
|
2532
|
-
function
|
|
2533
|
-
let e =
|
|
2534
|
-
return
|
|
2539
|
+
}, On = "a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw", kn = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";
|
|
2540
|
+
function An() {
|
|
2541
|
+
let e = kn.split("|");
|
|
2542
|
+
return On.split("|").forEach((t) => {
|
|
2535
2543
|
let n = t.indexOf(":"), r = t.slice(0, n);
|
|
2536
2544
|
for (let i of t.slice(n + 1)) e.push(r + i);
|
|
2537
2545
|
}), e;
|
|
2538
2546
|
}
|
|
2539
|
-
var
|
|
2547
|
+
var jn = {
|
|
2540
2548
|
fuzzyLink: !1,
|
|
2541
2549
|
fuzzyEmail: !0,
|
|
2542
2550
|
fuzzyIP: !1,
|
|
2543
2551
|
"---": !1,
|
|
2544
|
-
tlds:
|
|
2552
|
+
tlds: An(),
|
|
2545
2553
|
urlAuth: !1,
|
|
2546
2554
|
maxLength: 1e4
|
|
2547
|
-
},
|
|
2555
|
+
}, Mn = class {
|
|
2548
2556
|
constructor(e, t, n, r) {
|
|
2549
2557
|
T(this, "schema", void 0), T(this, "index", void 0), T(this, "lastIndex", void 0), T(this, "raw", void 0), T(this, "text", void 0), T(this, "url", void 0);
|
|
2550
2558
|
let i = e.slice(n, r);
|
|
2551
2559
|
this.schema = t.toLowerCase(), this.index = n, this.lastIndex = r, this.raw = i, this.text = i, this.url = i;
|
|
2552
2560
|
}
|
|
2553
|
-
},
|
|
2561
|
+
}, Nn = class {
|
|
2554
2562
|
constructor(e = {}) {
|
|
2555
2563
|
T(this, "__opts__", void 0), T(this, "__schemas__", void 0), T(this, "re", void 0);
|
|
2556
2564
|
let { rebuilder: t, ...n } = e;
|
|
2557
2565
|
this.__opts__ = {
|
|
2558
|
-
...
|
|
2566
|
+
...jn,
|
|
2559
2567
|
...n
|
|
2560
|
-
}, this.__schemas__ = { ...
|
|
2568
|
+
}, this.__schemas__ = { ...Dn }, this.re = t || new Tn(), this.re.set({
|
|
2561
2569
|
...this.__opts__,
|
|
2562
2570
|
schema_names: Object.keys(this.__schemas__)
|
|
2563
2571
|
});
|
|
@@ -2673,7 +2681,7 @@ var kn = {
|
|
|
2673
2681
|
let g = h;
|
|
2674
2682
|
if ((!g || s && (s.index < g.index || s.index === g.index && s.lastIndex > g.lastIndex)) && (g = s), (!g || o && (o.index < g.index || o.index === g.index && o.lastIndex > g.lastIndex)) && (g = o), !g) break;
|
|
2675
2683
|
g === s ? s = void 0 : g === o && (o = void 0);
|
|
2676
|
-
let _ = new
|
|
2684
|
+
let _ = new Mn(e, g.schema, g.index, g.lastIndex);
|
|
2677
2685
|
_.schema ? this.__schemas__[_.schema].normalize(_, this) : this.normalize(_), t.push(_), f = g.lastIndex;
|
|
2678
2686
|
}
|
|
2679
2687
|
return t.length ? t : null;
|
|
@@ -2684,7 +2692,7 @@ var kn = {
|
|
|
2684
2692
|
if (!t) return null;
|
|
2685
2693
|
let n = this.testSchemaAt(e, t[2], t[0].length);
|
|
2686
2694
|
if (!n) return null;
|
|
2687
|
-
let r = new
|
|
2695
|
+
let r = new Mn(e, t[2], t.index + t[1].length, t.index + t[0].length + n);
|
|
2688
2696
|
return this.__schemas__[r.schema].normalize(r, this), r;
|
|
2689
2697
|
}
|
|
2690
2698
|
tlds(e, t = !1) {
|
|
@@ -2696,26 +2704,26 @@ var kn = {
|
|
|
2696
2704
|
normalize(e) {
|
|
2697
2705
|
e.schema || (e.url = `http://${e.url}`), e.schema === "mailto:" && !/^mailto:/i.test(e.url) && (e.url = `mailto:${e.url}`);
|
|
2698
2706
|
}
|
|
2699
|
-
}, J = 2147483647, Y = 36,
|
|
2707
|
+
}, J = 2147483647, Y = 36, Pn = 1, X = 26, Fn = 38, In = 700, Ln = 72, Rn = 128, zn = "-", Bn = /^xn--/, Vn = /[^\0-\x7F]/, Hn = /[\x2E\u3002\uFF0E\uFF61]/g, Un = {
|
|
2700
2708
|
overflow: "Overflow: input needs wider integers to process",
|
|
2701
2709
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
2702
2710
|
"invalid-input": "Invalid input"
|
|
2703
|
-
},
|
|
2711
|
+
}, Wn = 35, Z = Math.floor, Gn = String.fromCharCode;
|
|
2704
2712
|
function Q(e) {
|
|
2705
|
-
throw RangeError(
|
|
2713
|
+
throw RangeError(Un[e]);
|
|
2706
2714
|
}
|
|
2707
|
-
function
|
|
2715
|
+
function Kn(e, t) {
|
|
2708
2716
|
let n = [], r = e.length;
|
|
2709
2717
|
for (; r--;) n[r] = t(e[r]);
|
|
2710
2718
|
return n;
|
|
2711
2719
|
}
|
|
2712
|
-
function
|
|
2720
|
+
function qn(e, t) {
|
|
2713
2721
|
let n = e.split("@"), r = "";
|
|
2714
|
-
n.length > 1 && (r = n[0] + "@", e = n[1]), e = e.replace(
|
|
2715
|
-
let i =
|
|
2722
|
+
n.length > 1 && (r = n[0] + "@", e = n[1]), e = e.replace(Hn, ".");
|
|
2723
|
+
let i = Kn(e.split("."), t).join(".");
|
|
2716
2724
|
return r + i;
|
|
2717
2725
|
}
|
|
2718
|
-
function
|
|
2726
|
+
function Jn(e) {
|
|
2719
2727
|
let t = [], n = 0, r = e.length;
|
|
2720
2728
|
for (; n < r;) {
|
|
2721
2729
|
let i = e.charCodeAt(n++);
|
|
@@ -2726,40 +2734,40 @@ function Kn(e) {
|
|
|
2726
2734
|
}
|
|
2727
2735
|
return t;
|
|
2728
2736
|
}
|
|
2729
|
-
var
|
|
2737
|
+
var Yn = (e) => String.fromCodePoint(...e), Xn = function(e) {
|
|
2730
2738
|
return e >= 48 && e < 58 ? 26 + (e - 48) : e >= 65 && e < 91 ? e - 65 : e >= 97 && e < 123 ? e - 97 : Y;
|
|
2731
|
-
},
|
|
2739
|
+
}, Zn = function(e, t) {
|
|
2732
2740
|
return e + 22 + 75 * (e < 26) - ((t != 0) << 5);
|
|
2733
|
-
},
|
|
2741
|
+
}, Qn = function(e, t, n) {
|
|
2734
2742
|
let r = 0;
|
|
2735
|
-
for (e = n ? Z(e /
|
|
2736
|
-
return Z(r + 36 * e / (e +
|
|
2737
|
-
},
|
|
2738
|
-
let t = [], n = e.length, r = 0, i =
|
|
2743
|
+
for (e = n ? Z(e / In) : e >> 1, e += Z(e / t); e > 455; r += Y) e = Z(e / Wn);
|
|
2744
|
+
return Z(r + 36 * e / (e + Fn));
|
|
2745
|
+
}, $n = function(e) {
|
|
2746
|
+
let t = [], n = e.length, r = 0, i = Rn, a = Ln, o = e.lastIndexOf(zn);
|
|
2739
2747
|
o < 0 && (o = 0);
|
|
2740
2748
|
for (let n = 0; n < o; ++n) e.charCodeAt(n) >= 128 && Q("not-basic"), t.push(e.charCodeAt(n));
|
|
2741
2749
|
for (let s = o > 0 ? o + 1 : 0; s < n;) {
|
|
2742
2750
|
let o = r;
|
|
2743
2751
|
for (let t = 1, i = Y;; i += Y) {
|
|
2744
2752
|
s >= n && Q("invalid-input");
|
|
2745
|
-
let o =
|
|
2753
|
+
let o = Xn(e.charCodeAt(s++));
|
|
2746
2754
|
o >= Y && Q("invalid-input"), o > Z((J - r) / t) && Q("overflow"), r += o * t;
|
|
2747
|
-
let c = i <= a ?
|
|
2755
|
+
let c = i <= a ? Pn : i >= a + X ? X : i - a;
|
|
2748
2756
|
if (o < c) break;
|
|
2749
2757
|
let l = Y - c;
|
|
2750
2758
|
t > Z(J / l) && Q("overflow"), t *= l;
|
|
2751
2759
|
}
|
|
2752
2760
|
let c = t.length + 1;
|
|
2753
|
-
a =
|
|
2761
|
+
a = Qn(r - o, c, o == 0), Z(r / c) > J - i && Q("overflow"), i += Z(r / c), r %= c, t.splice(r++, 0, i);
|
|
2754
2762
|
}
|
|
2755
2763
|
return String.fromCodePoint(...t);
|
|
2756
|
-
},
|
|
2764
|
+
}, er = function(e) {
|
|
2757
2765
|
let t = [];
|
|
2758
|
-
e =
|
|
2759
|
-
let n = e.length, r =
|
|
2760
|
-
for (let n of e) n < 128 && t.push(
|
|
2766
|
+
e = Jn(e);
|
|
2767
|
+
let n = e.length, r = Rn, i = 0, a = Ln;
|
|
2768
|
+
for (let n of e) n < 128 && t.push(Gn(n));
|
|
2761
2769
|
let o = t.length, s = o;
|
|
2762
|
-
for (o && t.push(
|
|
2770
|
+
for (o && t.push(zn); s < n;) {
|
|
2763
2771
|
let n = J;
|
|
2764
2772
|
for (let t of e) t >= r && t < n && (n = t);
|
|
2765
2773
|
let c = s + 1;
|
|
@@ -2767,35 +2775,35 @@ var qn = (e) => String.fromCodePoint(...e), Jn = function(e) {
|
|
|
2767
2775
|
for (let n of e) if (n < r && ++i > J && Q("overflow"), n === r) {
|
|
2768
2776
|
let e = i;
|
|
2769
2777
|
for (let n = Y;; n += Y) {
|
|
2770
|
-
let r = n <= a ?
|
|
2778
|
+
let r = n <= a ? Pn : n >= a + X ? X : n - a;
|
|
2771
2779
|
if (e < r) break;
|
|
2772
2780
|
let i = e - r, o = Y - r;
|
|
2773
|
-
t.push(
|
|
2781
|
+
t.push(Gn(Zn(r + i % o, 0))), e = Z(i / o);
|
|
2774
2782
|
}
|
|
2775
|
-
t.push(
|
|
2783
|
+
t.push(Gn(Zn(e, 0))), a = Qn(i, c, s === o), i = 0, ++s;
|
|
2776
2784
|
}
|
|
2777
2785
|
++i, ++r;
|
|
2778
2786
|
}
|
|
2779
2787
|
return t.join("");
|
|
2780
|
-
},
|
|
2788
|
+
}, tr = {
|
|
2781
2789
|
version: "2.3.1",
|
|
2782
2790
|
ucs2: {
|
|
2783
|
-
decode:
|
|
2784
|
-
encode:
|
|
2791
|
+
decode: Jn,
|
|
2792
|
+
encode: Yn
|
|
2785
2793
|
},
|
|
2786
|
-
decode:
|
|
2787
|
-
encode:
|
|
2794
|
+
decode: $n,
|
|
2795
|
+
encode: er,
|
|
2788
2796
|
toASCII: function(e) {
|
|
2789
|
-
return
|
|
2790
|
-
return
|
|
2797
|
+
return qn(e, function(e) {
|
|
2798
|
+
return Vn.test(e) ? "xn--" + er(e) : e;
|
|
2791
2799
|
});
|
|
2792
2800
|
},
|
|
2793
2801
|
toUnicode: function(e) {
|
|
2794
|
-
return
|
|
2795
|
-
return
|
|
2802
|
+
return qn(e, function(e) {
|
|
2803
|
+
return Bn.test(e) ? $n(e.slice(4).toLowerCase()) : e;
|
|
2796
2804
|
});
|
|
2797
2805
|
}
|
|
2798
|
-
},
|
|
2806
|
+
}, nr = {
|
|
2799
2807
|
default: {
|
|
2800
2808
|
options: {
|
|
2801
2809
|
html: !1,
|
|
@@ -2894,31 +2902,31 @@ var qn = (e) => String.fromCodePoint(...e), Jn = function(e) {
|
|
|
2894
2902
|
}
|
|
2895
2903
|
}
|
|
2896
2904
|
}
|
|
2897
|
-
},
|
|
2905
|
+
}, rr = /^(vbscript|javascript|file|data):/, ir = /^data:image\/(gif|png|jpeg|webp);/, ar = [
|
|
2898
2906
|
"http:",
|
|
2899
2907
|
"https:",
|
|
2900
2908
|
"mailto:"
|
|
2901
2909
|
], $ = class {
|
|
2902
2910
|
validateLink(e) {
|
|
2903
2911
|
let t = e.trim().toLowerCase();
|
|
2904
|
-
return !
|
|
2912
|
+
return !rr.test(t) || ir.test(t);
|
|
2905
2913
|
}
|
|
2906
2914
|
normalizeLink(e) {
|
|
2907
2915
|
let t = b(e, !0);
|
|
2908
|
-
if (t.hostname && (!t.protocol ||
|
|
2909
|
-
t.hostname =
|
|
2916
|
+
if (t.hostname && (!t.protocol || ar.indexOf(t.protocol) >= 0)) try {
|
|
2917
|
+
t.hostname = tr.toASCII(t.hostname);
|
|
2910
2918
|
} catch (e) {}
|
|
2911
2919
|
return t.auth && (t.auth = s(t.auth)), t.hostname && (t.hostname = s(t.hostname)), t.pathname && (t.pathname = s(t.pathname)), t.search && (t.search = s(t.search)), t.hash && (t.hash = s(t.hash)), c(t);
|
|
2912
2920
|
}
|
|
2913
2921
|
normalizeLinkText(e) {
|
|
2914
2922
|
let t = b(e, !0);
|
|
2915
|
-
if (t.hostname && (!t.protocol ||
|
|
2916
|
-
t.hostname =
|
|
2923
|
+
if (t.hostname && (!t.protocol || ar.indexOf(t.protocol) >= 0)) try {
|
|
2924
|
+
t.hostname = tr.toUnicode(t.hostname);
|
|
2917
2925
|
} catch (e) {}
|
|
2918
2926
|
return i(c(t), i.defaultChars + "%");
|
|
2919
2927
|
}
|
|
2920
2928
|
constructor(...e) {
|
|
2921
|
-
T(this, "inline", new
|
|
2929
|
+
T(this, "inline", new wn()), T(this, "block", new Vt()), T(this, "core", new vt()), T(this, "renderer", new Ue()), T(this, "linkify", new Nn()), T(this, "utils", xe), T(this, "helpers", Object.assign({}, He));
|
|
2922
2930
|
let [t, n] = e;
|
|
2923
2931
|
typeof t == "string" ? (this.configure(t), n && this.set(n)) : (this.configure("default"), this.set(t || {}));
|
|
2924
2932
|
}
|
|
@@ -2929,7 +2937,7 @@ var qn = (e) => String.fromCodePoint(...e), Jn = function(e) {
|
|
|
2929
2937
|
let t;
|
|
2930
2938
|
if (typeof e == "string") {
|
|
2931
2939
|
let n = e;
|
|
2932
|
-
if (t =
|
|
2940
|
+
if (t = nr[n], !t) throw Error(`Wrong 'markdown-it' preset "${n}", check name`);
|
|
2933
2941
|
} else t = e;
|
|
2934
2942
|
if (!t) throw Error("Wrong `markdown-it` preset, can't be empty");
|
|
2935
2943
|
t.options && (this.options = { ...t.options });
|
|
@@ -2995,11 +3003,11 @@ var qn = (e) => String.fromCodePoint(...e), Jn = function(e) {
|
|
|
2995
3003
|
return this.renderer.render(this.parseInline(e, t), this.options, t);
|
|
2996
3004
|
}
|
|
2997
3005
|
};
|
|
2998
|
-
T($, "Token",
|
|
3006
|
+
T($, "Token", z), T($, "Ruler", B), T($, "Renderer", Ue), T($, "ParserCore", vt), T($, "StateCore", We), T($, "ParserBlock", Vt), T($, "StateBlock", yt), T($, "ParserInline", wn), T($, "StateInline", Ht);
|
|
2999
3007
|
//#endregion
|
|
3000
3008
|
//#region src/index.ts
|
|
3001
|
-
var
|
|
3009
|
+
var or = Se($);
|
|
3002
3010
|
//#endregion
|
|
3003
|
-
export {
|
|
3011
|
+
export { or as default };
|
|
3004
3012
|
|
|
3005
3013
|
//# sourceMappingURL=markdown-it.esm.min.mjs.map
|