superdoc 0.31.0-next.7 → 0.31.0-next.9
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/chunks/{PdfViewer-HhmcCtfd.es.js → PdfViewer-ChLbIG8u.es.js} +2 -2
- package/dist/chunks/{PdfViewer-C_gVEaJa.cjs → PdfViewer-DGBrTPth.cjs} +2 -2
- package/dist/chunks/{eventemitter3-hYlnBzSA.es.js → eventemitter3-BZXKb7j7.es.js} +1 -1
- package/dist/chunks/{eventemitter3-DmHNHvFX.cjs → eventemitter3-CFCpOk3d.cjs} +1 -1
- package/dist/chunks/{index-Cz10rZ5n.es.js → index-AnYOPAqD.es.js} +6 -6
- package/dist/chunks/{index-wLtubQ87.cjs → index-Cypk5knN.cjs} +6 -6
- package/dist/chunks/{index-BJ6cOegF-C-oX4LAe.es.js → index-mvOjU9rn-CQ6Y6D-C.es.js} +1 -1
- package/dist/chunks/{index-BJ6cOegF-BuvRSNoV.cjs → index-mvOjU9rn-HqKSYwVo.cjs} +1 -1
- package/dist/chunks/{jszip-BP2FTbpi.cjs → jszip-B99MTu59.cjs} +1 -1
- package/dist/chunks/{jszip-jKrsZoMS.es.js → jszip-Duxs2YMV.es.js} +1 -1
- package/dist/chunks/{super-editor.es-Bz-s1Pw4.cjs → super-editor.es-D55QKmsp.cjs} +779 -641
- package/dist/chunks/{super-editor.es-C20nShDu.es.js → super-editor.es-_tc99cB9.es.js} +732 -594
- package/dist/chunks/{vue-Cwv-wUpm.cjs → vue-ARQSyfaw.cjs} +2401 -2360
- package/dist/chunks/{vue-CKmzTNVs.es.js → vue-B5QAf5pA.es.js} +2401 -2360
- package/dist/chunks/xml-js-CVyfrKaV.es.js +2 -0
- package/dist/chunks/xml-js-DQa4Ye5C.cjs +3 -0
- package/dist/images/altText_add.svg +3 -0
- package/dist/images/altText_disclaimer.svg +3 -0
- package/dist/images/altText_done.svg +3 -0
- package/dist/images/altText_spinner.svg +30 -0
- package/dist/images/altText_warning.svg +3 -0
- package/dist/images/annotation-check.svg +11 -0
- package/dist/images/annotation-comment.svg +16 -0
- package/dist/images/annotation-help.svg +26 -0
- package/dist/images/annotation-insert.svg +10 -0
- package/dist/images/annotation-key.svg +11 -0
- package/dist/images/annotation-newparagraph.svg +11 -0
- package/dist/images/annotation-noicon.svg +7 -0
- package/dist/images/annotation-note.svg +42 -0
- package/dist/images/annotation-paperclip.svg +6 -0
- package/dist/images/annotation-paragraph.svg +16 -0
- package/dist/images/annotation-pushpin.svg +7 -0
- package/dist/images/cursor-editorFreeHighlight.svg +6 -0
- package/dist/images/cursor-editorFreeText.svg +3 -0
- package/dist/images/cursor-editorInk.svg +4 -0
- package/dist/images/cursor-editorTextHighlight.svg +8 -0
- package/dist/images/editor-toolbar-delete.svg +5 -0
- package/dist/images/loading-icon.gif +0 -0
- package/dist/images/messageBar_closingButton.svg +3 -0
- package/dist/images/messageBar_warning.svg +3 -0
- package/dist/images/toolbarButton-editorHighlight.svg +6 -0
- package/dist/images/toolbarButton-menuArrow.svg +3 -0
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts +8 -0
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
- package/dist/packages/superdoc/src/core/types/index.d.ts +8 -0
- package/dist/packages/superdoc/src/core/types/index.d.ts.map +1 -1
- package/dist/style.css +2 -0
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-DVDL6NWz.js → converter-DkFlFcso.js} +313 -294
- package/dist/super-editor/chunks/{docx-zipper-4ipmBNSH.js → docx-zipper-BSQJw-fX.js} +1 -1
- package/dist/super-editor/chunks/{editor-B8v33PJq.js → editor-bUoNJi-W.js} +155 -36
- package/dist/super-editor/chunks/{index-BJ6cOegF.js → index-mvOjU9rn.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-CfUofx7k.js → toolbar-CkPV7I8i.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +2 -0
- package/dist/super-editor/super-editor/src/core/Editor.d.ts +9 -0
- package/dist/super-editor/super-editor/src/core/Editor.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/Node.d.ts +1 -1
- package/dist/super-editor/super-editor/src/core/Node.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/Schema.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/schema-summary.d.ts +4 -0
- package/dist/super-editor/super-editor/src/core/schema-summary.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/core/types/EditorSchema.d.ts +35 -0
- package/dist/super-editor/super-editor/src/core/types/EditorSchema.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/extensions/ai/ai-marks.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/extensions/ai/ai-nodes.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/extensions/collaboration/collaboration-helpers.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/extensions/mention/mention.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/extensions/paragraph/paragraph.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/extensions/structured-content/document-part-object.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/extensions/track-changes/permission-helpers.d.ts +8 -0
- package/dist/super-editor/super-editor/src/extensions/track-changes/permission-helpers.d.ts.map +1 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +2 -2
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +1120 -942
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/xml-js-BSDu25I7.cjs +0 -3
- package/dist/chunks/xml-js-CBrRls0f.es.js +0 -2
|
@@ -413,17 +413,17 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
413
413
|
);
|
|
414
414
|
}
|
|
415
415
|
if (a === b2) return 0;
|
|
416
|
-
let
|
|
416
|
+
let x2 = a.length;
|
|
417
417
|
let y2 = b2.length;
|
|
418
|
-
for (let i = 0, len = Math.min(
|
|
418
|
+
for (let i = 0, len = Math.min(x2, y2); i < len; ++i) {
|
|
419
419
|
if (a[i] !== b2[i]) {
|
|
420
|
-
|
|
420
|
+
x2 = a[i];
|
|
421
421
|
y2 = b2[i];
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
if (
|
|
426
|
-
if (y2 <
|
|
425
|
+
if (x2 < y2) return -1;
|
|
426
|
+
if (y2 < x2) return 1;
|
|
427
427
|
return 0;
|
|
428
428
|
};
|
|
429
429
|
Buffer3.isEncoding = function isEncoding(encoding) {
|
|
@@ -672,20 +672,20 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
672
672
|
thisStart >>>= 0;
|
|
673
673
|
thisEnd >>>= 0;
|
|
674
674
|
if (this === target) return 0;
|
|
675
|
-
let
|
|
675
|
+
let x2 = thisEnd - thisStart;
|
|
676
676
|
let y2 = end - start;
|
|
677
|
-
const len = Math.min(
|
|
677
|
+
const len = Math.min(x2, y2);
|
|
678
678
|
const thisCopy = this.slice(thisStart, thisEnd);
|
|
679
679
|
const targetCopy = target.slice(start, end);
|
|
680
680
|
for (let i = 0; i < len; ++i) {
|
|
681
681
|
if (thisCopy[i] !== targetCopy[i]) {
|
|
682
|
-
|
|
682
|
+
x2 = thisCopy[i];
|
|
683
683
|
y2 = targetCopy[i];
|
|
684
684
|
break;
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
if (
|
|
688
|
-
if (y2 <
|
|
687
|
+
if (x2 < y2) return -1;
|
|
688
|
+
if (y2 < x2) return 1;
|
|
689
689
|
return 0;
|
|
690
690
|
};
|
|
691
691
|
function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir) {
|
|
@@ -1775,8 +1775,8 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
1775
1775
|
})(buffer);
|
|
1776
1776
|
const Buffer2 = buffer.Buffer;
|
|
1777
1777
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1778
|
-
function getDefaultExportFromCjs$2(
|
|
1779
|
-
return
|
|
1778
|
+
function getDefaultExportFromCjs$2(x2) {
|
|
1779
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
1780
1780
|
}
|
|
1781
1781
|
var sax = {};
|
|
1782
1782
|
var events = { exports: {} };
|
|
@@ -1784,13 +1784,13 @@ var hasRequiredEvents;
|
|
|
1784
1784
|
function requireEvents() {
|
|
1785
1785
|
if (hasRequiredEvents) return events.exports;
|
|
1786
1786
|
hasRequiredEvents = 1;
|
|
1787
|
-
var
|
|
1788
|
-
var ReflectApply =
|
|
1787
|
+
var R = typeof Reflect === "object" ? Reflect : null;
|
|
1788
|
+
var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
|
|
1789
1789
|
return Function.prototype.apply.call(target, receiver, args);
|
|
1790
1790
|
};
|
|
1791
1791
|
var ReflectOwnKeys;
|
|
1792
|
-
if (
|
|
1793
|
-
ReflectOwnKeys =
|
|
1792
|
+
if (R && typeof R.ownKeys === "function") {
|
|
1793
|
+
ReflectOwnKeys = R.ownKeys;
|
|
1794
1794
|
} else if (Object.getOwnPropertySymbols) {
|
|
1795
1795
|
ReflectOwnKeys = function ReflectOwnKeys2(target) {
|
|
1796
1796
|
return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
|
|
@@ -2180,8 +2180,8 @@ function requireInherits_browser() {
|
|
|
2180
2180
|
}
|
|
2181
2181
|
return inherits_browser.exports;
|
|
2182
2182
|
}
|
|
2183
|
-
function getDefaultExportFromCjs$1(
|
|
2184
|
-
return
|
|
2183
|
+
function getDefaultExportFromCjs$1(x2) {
|
|
2184
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
2185
2185
|
}
|
|
2186
2186
|
var browser$1 = { exports: {} };
|
|
2187
2187
|
var process = browser$1.exports = {};
|
|
@@ -2762,17 +2762,17 @@ function requireDist() {
|
|
|
2762
2762
|
);
|
|
2763
2763
|
}
|
|
2764
2764
|
if (a === b2) return 0;
|
|
2765
|
-
let
|
|
2765
|
+
let x2 = a.length;
|
|
2766
2766
|
let y2 = b2.length;
|
|
2767
|
-
for (let i2 = 0, len2 = Math.min(
|
|
2767
|
+
for (let i2 = 0, len2 = Math.min(x2, y2); i2 < len2; ++i2) {
|
|
2768
2768
|
if (a[i2] !== b2[i2]) {
|
|
2769
|
-
|
|
2769
|
+
x2 = a[i2];
|
|
2770
2770
|
y2 = b2[i2];
|
|
2771
2771
|
break;
|
|
2772
2772
|
}
|
|
2773
2773
|
}
|
|
2774
|
-
if (
|
|
2775
|
-
if (y2 <
|
|
2774
|
+
if (x2 < y2) return -1;
|
|
2775
|
+
if (y2 < x2) return 1;
|
|
2776
2776
|
return 0;
|
|
2777
2777
|
};
|
|
2778
2778
|
Buffer4.isEncoding = function isEncoding(encoding) {
|
|
@@ -3021,20 +3021,20 @@ function requireDist() {
|
|
|
3021
3021
|
thisStart >>>= 0;
|
|
3022
3022
|
thisEnd >>>= 0;
|
|
3023
3023
|
if (this === target) return 0;
|
|
3024
|
-
let
|
|
3024
|
+
let x2 = thisEnd - thisStart;
|
|
3025
3025
|
let y2 = end - start;
|
|
3026
|
-
const len2 = Math.min(
|
|
3026
|
+
const len2 = Math.min(x2, y2);
|
|
3027
3027
|
const thisCopy = this.slice(thisStart, thisEnd);
|
|
3028
3028
|
const targetCopy = target.slice(start, end);
|
|
3029
3029
|
for (let i2 = 0; i2 < len2; ++i2) {
|
|
3030
3030
|
if (thisCopy[i2] !== targetCopy[i2]) {
|
|
3031
|
-
|
|
3031
|
+
x2 = thisCopy[i2];
|
|
3032
3032
|
y2 = targetCopy[i2];
|
|
3033
3033
|
break;
|
|
3034
3034
|
}
|
|
3035
3035
|
}
|
|
3036
|
-
if (
|
|
3037
|
-
if (y2 <
|
|
3036
|
+
if (x2 < y2) return -1;
|
|
3037
|
+
if (y2 < x2) return 1;
|
|
3038
3038
|
return 0;
|
|
3039
3039
|
};
|
|
3040
3040
|
function bidirectionalIndexOf(buffer3, val, byteOffset, encoding, dir) {
|
|
@@ -4606,15 +4606,15 @@ function requireGetProto() {
|
|
|
4606
4606
|
var reflectGetProto = requireReflect_getPrototypeOf();
|
|
4607
4607
|
var originalGetProto = requireObject_getPrototypeOf();
|
|
4608
4608
|
var getDunderProto = /* @__PURE__ */ requireGet();
|
|
4609
|
-
getProto = reflectGetProto ? function getProto2(
|
|
4610
|
-
return reflectGetProto(
|
|
4611
|
-
} : originalGetProto ? function getProto2(
|
|
4612
|
-
if (!
|
|
4609
|
+
getProto = reflectGetProto ? function getProto2(O) {
|
|
4610
|
+
return reflectGetProto(O);
|
|
4611
|
+
} : originalGetProto ? function getProto2(O) {
|
|
4612
|
+
if (!O || typeof O !== "object" && typeof O !== "function") {
|
|
4613
4613
|
throw new TypeError("getProto: not an object");
|
|
4614
4614
|
}
|
|
4615
|
-
return originalGetProto(
|
|
4616
|
-
} : getDunderProto ? function getProto2(
|
|
4617
|
-
return getDunderProto(
|
|
4615
|
+
return originalGetProto(O);
|
|
4616
|
+
} : getDunderProto ? function getProto2(O) {
|
|
4617
|
+
return getDunderProto(O);
|
|
4618
4618
|
} : null;
|
|
4619
4619
|
return getProto;
|
|
4620
4620
|
}
|
|
@@ -5282,18 +5282,18 @@ function requireForEach() {
|
|
|
5282
5282
|
}
|
|
5283
5283
|
};
|
|
5284
5284
|
var forEachObject = function forEachObject2(object, iterator, receiver) {
|
|
5285
|
-
for (var
|
|
5286
|
-
if (hasOwnProperty.call(object,
|
|
5285
|
+
for (var k2 in object) {
|
|
5286
|
+
if (hasOwnProperty.call(object, k2)) {
|
|
5287
5287
|
if (receiver == null) {
|
|
5288
|
-
iterator(object[
|
|
5288
|
+
iterator(object[k2], k2, object);
|
|
5289
5289
|
} else {
|
|
5290
|
-
iterator.call(receiver, object[
|
|
5290
|
+
iterator.call(receiver, object[k2], k2, object);
|
|
5291
5291
|
}
|
|
5292
5292
|
}
|
|
5293
5293
|
}
|
|
5294
5294
|
};
|
|
5295
|
-
function isArray(
|
|
5296
|
-
return toStr.call(
|
|
5295
|
+
function isArray(x2) {
|
|
5296
|
+
return toStr.call(x2) === "[object Array]";
|
|
5297
5297
|
}
|
|
5298
5298
|
forEach = function forEach2(list, iterator, thisArg) {
|
|
5299
5299
|
if (!isCallable2(iterator)) {
|
|
@@ -5902,10 +5902,10 @@ function requireUtil() {
|
|
|
5902
5902
|
var i = 1;
|
|
5903
5903
|
var args = arguments;
|
|
5904
5904
|
var len = args.length;
|
|
5905
|
-
var str = String(f).replace(formatRegExp, function(
|
|
5906
|
-
if (
|
|
5907
|
-
if (i >= len) return
|
|
5908
|
-
switch (
|
|
5905
|
+
var str = String(f).replace(formatRegExp, function(x3) {
|
|
5906
|
+
if (x3 === "%%") return "%";
|
|
5907
|
+
if (i >= len) return x3;
|
|
5908
|
+
switch (x3) {
|
|
5909
5909
|
case "%s":
|
|
5910
5910
|
return String(args[i++]);
|
|
5911
5911
|
case "%d":
|
|
@@ -5917,14 +5917,14 @@ function requireUtil() {
|
|
|
5917
5917
|
return "[Circular]";
|
|
5918
5918
|
}
|
|
5919
5919
|
default:
|
|
5920
|
-
return
|
|
5920
|
+
return x3;
|
|
5921
5921
|
}
|
|
5922
5922
|
});
|
|
5923
|
-
for (var
|
|
5924
|
-
if (isNull(
|
|
5925
|
-
str += " " +
|
|
5923
|
+
for (var x2 = args[i]; i < len; x2 = args[++i]) {
|
|
5924
|
+
if (isNull(x2) || !isObject(x2)) {
|
|
5925
|
+
str += " " + x2;
|
|
5926
5926
|
} else {
|
|
5927
|
-
str += " " + inspect(
|
|
5927
|
+
str += " " + inspect(x2);
|
|
5928
5928
|
}
|
|
5929
5929
|
}
|
|
5930
5930
|
return str;
|
|
@@ -7489,6 +7489,7 @@ function require_stream_duplex() {
|
|
|
7489
7489
|
}
|
|
7490
7490
|
var string_decoder = {};
|
|
7491
7491
|
var safeBuffer = { exports: {} };
|
|
7492
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
7492
7493
|
var hasRequiredSafeBuffer;
|
|
7493
7494
|
function requireSafeBuffer() {
|
|
7494
7495
|
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
@@ -7510,6 +7511,7 @@ function requireSafeBuffer() {
|
|
|
7510
7511
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
7511
7512
|
return Buffer3(arg, encodingOrOffset, length);
|
|
7512
7513
|
}
|
|
7514
|
+
SafeBuffer.prototype = Object.create(Buffer3.prototype);
|
|
7513
7515
|
copyProps(Buffer3, SafeBuffer);
|
|
7514
7516
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
7515
7517
|
if (typeof arg === "number") {
|
|
@@ -8787,9 +8789,9 @@ function require_stream_readable() {
|
|
|
8787
8789
|
return from(Readable, iterable, opts);
|
|
8788
8790
|
};
|
|
8789
8791
|
}
|
|
8790
|
-
function indexOf(xs,
|
|
8792
|
+
function indexOf(xs, x2) {
|
|
8791
8793
|
for (var i = 0, l3 = xs.length; i < l3; i++) {
|
|
8792
|
-
if (xs[i] ===
|
|
8794
|
+
if (xs[i] === x2) return i;
|
|
8793
8795
|
}
|
|
8794
8796
|
return -1;
|
|
8795
8797
|
}
|
|
@@ -9247,27 +9249,27 @@ function requireSax() {
|
|
|
9247
9249
|
this._parser = new SAXParser(strict, opt);
|
|
9248
9250
|
this.writable = true;
|
|
9249
9251
|
this.readable = true;
|
|
9250
|
-
var
|
|
9252
|
+
var me2 = this;
|
|
9251
9253
|
this._parser.onend = function() {
|
|
9252
|
-
|
|
9254
|
+
me2.emit("end");
|
|
9253
9255
|
};
|
|
9254
9256
|
this._parser.onerror = function(er) {
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
+
me2.emit("error", er);
|
|
9258
|
+
me2._parser.error = null;
|
|
9257
9259
|
};
|
|
9258
9260
|
this._decoder = null;
|
|
9259
9261
|
streamWraps.forEach(function(ev) {
|
|
9260
|
-
Object.defineProperty(
|
|
9262
|
+
Object.defineProperty(me2, "on" + ev, {
|
|
9261
9263
|
get: function() {
|
|
9262
|
-
return
|
|
9264
|
+
return me2._parser["on" + ev];
|
|
9263
9265
|
},
|
|
9264
|
-
set: function(
|
|
9265
|
-
if (!
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
return
|
|
9266
|
+
set: function(h) {
|
|
9267
|
+
if (!h) {
|
|
9268
|
+
me2.removeAllListeners(ev);
|
|
9269
|
+
me2._parser["on" + ev] = h;
|
|
9270
|
+
return h;
|
|
9269
9271
|
}
|
|
9270
|
-
|
|
9272
|
+
me2.on(ev, h);
|
|
9271
9273
|
},
|
|
9272
9274
|
enumerable: true,
|
|
9273
9275
|
configurable: false
|
|
@@ -9299,15 +9301,15 @@ function requireSax() {
|
|
|
9299
9301
|
return true;
|
|
9300
9302
|
};
|
|
9301
9303
|
SAXStream.prototype.on = function(ev, handler2) {
|
|
9302
|
-
var
|
|
9303
|
-
if (!
|
|
9304
|
-
|
|
9304
|
+
var me2 = this;
|
|
9305
|
+
if (!me2._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
|
|
9306
|
+
me2._parser["on" + ev] = function() {
|
|
9305
9307
|
var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
|
|
9306
9308
|
args.splice(0, 0, ev);
|
|
9307
|
-
|
|
9309
|
+
me2.emit.apply(me2, args);
|
|
9308
9310
|
};
|
|
9309
9311
|
}
|
|
9310
|
-
return Stream.prototype.on.call(
|
|
9312
|
+
return Stream.prototype.on.call(me2, ev, handler2);
|
|
9311
9313
|
};
|
|
9312
9314
|
var CDATA = "[CDATA[";
|
|
9313
9315
|
var DOCTYPE = "DOCTYPE";
|
|
@@ -9899,9 +9901,9 @@ function requireSax() {
|
|
|
9899
9901
|
var tag = parser.tag = parser.tags.pop();
|
|
9900
9902
|
parser.tagName = parser.tag.name;
|
|
9901
9903
|
emitNode(parser, "onclosetag", parser.tagName);
|
|
9902
|
-
var
|
|
9904
|
+
var x2 = {};
|
|
9903
9905
|
for (var i in tag.ns) {
|
|
9904
|
-
|
|
9906
|
+
x2[i] = tag.ns[i];
|
|
9905
9907
|
}
|
|
9906
9908
|
var parent = parser.tags[parser.tags.length - 1] || parser;
|
|
9907
9909
|
if (parser.opt.xmlns && tag.ns !== parent.ns) {
|
|
@@ -10958,8 +10960,8 @@ function requireXml2json() {
|
|
|
10958
10960
|
js = xml2js2(xml, options);
|
|
10959
10961
|
parentKey = "compact" in options && options.compact ? "_parent" : "parent";
|
|
10960
10962
|
if ("addParent" in options && options.addParent) {
|
|
10961
|
-
json = JSON.stringify(js, function(
|
|
10962
|
-
return
|
|
10963
|
+
json = JSON.stringify(js, function(k2, v2) {
|
|
10964
|
+
return k2 === parentKey ? "_" : v2;
|
|
10963
10965
|
}, options.spaces);
|
|
10964
10966
|
} else {
|
|
10965
10967
|
json = JSON.stringify(js, null, options.spaces);
|
|
@@ -11381,8 +11383,8 @@ function v4(options, buf, offset) {
|
|
|
11381
11383
|
rnds[8] = rnds[8] & 63 | 128;
|
|
11382
11384
|
return unsafeStringify(rnds);
|
|
11383
11385
|
}
|
|
11384
|
-
function getDefaultExportFromCjs(
|
|
11385
|
-
return
|
|
11386
|
+
function getDefaultExportFromCjs(x2) {
|
|
11387
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
11386
11388
|
}
|
|
11387
11389
|
const CRC_TABLE = new Int32Array([
|
|
11388
11390
|
0,
|
|
@@ -15208,8 +15210,8 @@ function polygonToObj(polygonNode) {
|
|
|
15208
15210
|
const points = [];
|
|
15209
15211
|
polygonNode.elements.forEach((element) => {
|
|
15210
15212
|
if (["wp:start", "wp:lineTo"].includes(element.name)) {
|
|
15211
|
-
const { x, y: y2 } = element.attributes;
|
|
15212
|
-
points.push([polygonUnitsToPixels(
|
|
15213
|
+
const { x: x2, y: y2 } = element.attributes;
|
|
15214
|
+
points.push([polygonUnitsToPixels(x2), polygonUnitsToPixels(y2)]);
|
|
15213
15215
|
}
|
|
15214
15216
|
});
|
|
15215
15217
|
if (points.length > 1) {
|
|
@@ -15232,13 +15234,13 @@ function objToPolygon(points) {
|
|
|
15232
15234
|
elements: []
|
|
15233
15235
|
};
|
|
15234
15236
|
points.forEach((point, index2) => {
|
|
15235
|
-
const [
|
|
15237
|
+
const [x2, y2] = point;
|
|
15236
15238
|
const tagName = index2 === 0 ? "wp:start" : "wp:lineTo";
|
|
15237
15239
|
const pointNode = {
|
|
15238
15240
|
name: tagName,
|
|
15239
15241
|
type: tagName,
|
|
15240
15242
|
attributes: {
|
|
15241
|
-
x: pixelsToPolygonUnits(
|
|
15243
|
+
x: pixelsToPolygonUnits(x2),
|
|
15242
15244
|
y: pixelsToPolygonUnits(y2)
|
|
15243
15245
|
}
|
|
15244
15246
|
};
|
|
@@ -19159,9 +19161,9 @@ const translator$12 = NodeTranslator.from(
|
|
|
19159
19161
|
);
|
|
19160
19162
|
function getUnderlineCssString({ type: type2 = "single", color = null, thickness = null, approximate = true } = {}) {
|
|
19161
19163
|
const parts = [];
|
|
19162
|
-
const add = (
|
|
19164
|
+
const add = (k2, v2) => {
|
|
19163
19165
|
if (!v2) return;
|
|
19164
|
-
parts.push(`${
|
|
19166
|
+
parts.push(`${k2}: ${v2}`);
|
|
19165
19167
|
};
|
|
19166
19168
|
const lower = String(type2 || "single").toLowerCase();
|
|
19167
19169
|
if (lower === "none" || lower === "0") {
|
|
@@ -25019,18 +25021,18 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
25019
25021
|
const rawY = shapeOff?.attributes?.["y"] ? parseFloat(shapeOff.attributes["y"]) : 0;
|
|
25020
25022
|
const rawWidth = shapeExt?.attributes?.["cx"] ? parseFloat(shapeExt.attributes["cx"]) : 914400;
|
|
25021
25023
|
const rawHeight = shapeExt?.attributes?.["cy"] ? parseFloat(shapeExt.attributes["cy"]) : 914400;
|
|
25022
|
-
let
|
|
25024
|
+
let x2, y2, width, height;
|
|
25023
25025
|
if (groupTransform.childWidth && groupTransform.childHeight) {
|
|
25024
25026
|
const scaleX = groupTransform.width / groupTransform.childWidth;
|
|
25025
25027
|
const scaleY = groupTransform.height / groupTransform.childHeight;
|
|
25026
25028
|
const childOriginX = groupTransform.childOriginXEmu || 0;
|
|
25027
25029
|
const childOriginY = groupTransform.childOriginYEmu || 0;
|
|
25028
|
-
|
|
25030
|
+
x2 = groupTransform.x + emuToPixels((rawX - childOriginX) * scaleX);
|
|
25029
25031
|
y2 = groupTransform.y + emuToPixels((rawY - childOriginY) * scaleY);
|
|
25030
25032
|
width = emuToPixels(rawWidth * scaleX);
|
|
25031
25033
|
height = emuToPixels(rawHeight * scaleY);
|
|
25032
25034
|
} else {
|
|
25033
|
-
|
|
25035
|
+
x2 = emuToPixels(rawX);
|
|
25034
25036
|
y2 = emuToPixels(rawY);
|
|
25035
25037
|
width = emuToPixels(rawWidth);
|
|
25036
25038
|
height = emuToPixels(rawHeight);
|
|
@@ -25049,7 +25051,7 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
25049
25051
|
shapeType: "vectorShape",
|
|
25050
25052
|
attrs: {
|
|
25051
25053
|
kind: shapeKind,
|
|
25052
|
-
x,
|
|
25054
|
+
x: x2,
|
|
25053
25055
|
y: y2,
|
|
25054
25056
|
width,
|
|
25055
25057
|
height,
|
|
@@ -25672,7 +25674,7 @@ function posToDOMRect(view, from, to) {
|
|
|
25672
25674
|
const right = Math.max(start.right, end.right);
|
|
25673
25675
|
const width = right - left;
|
|
25674
25676
|
const height = bottom - top;
|
|
25675
|
-
const
|
|
25677
|
+
const x2 = left;
|
|
25676
25678
|
const y2 = top;
|
|
25677
25679
|
const data = {
|
|
25678
25680
|
top,
|
|
@@ -25681,7 +25683,7 @@ function posToDOMRect(view, from, to) {
|
|
|
25681
25683
|
right,
|
|
25682
25684
|
width,
|
|
25683
25685
|
height,
|
|
25684
|
-
x,
|
|
25686
|
+
x: x2,
|
|
25685
25687
|
y: y2
|
|
25686
25688
|
};
|
|
25687
25689
|
return {
|
|
@@ -27521,7 +27523,7 @@ const getBasicNumIdTag = (numId, abstractId) => {
|
|
|
27521
27523
|
};
|
|
27522
27524
|
const getNewListId = (editor, grouping = "definitions") => {
|
|
27523
27525
|
const defs = editor.converter?.numbering?.[grouping] || {};
|
|
27524
|
-
const intKeys = Object.keys(defs).map((
|
|
27526
|
+
const intKeys = Object.keys(defs).map((k2) => Number(k2)).filter((n) => Number.isInteger(n));
|
|
27525
27527
|
const max2 = intKeys.length ? Math.max(...intKeys) : 0;
|
|
27526
27528
|
return max2 + 1;
|
|
27527
27529
|
};
|
|
@@ -28821,25 +28823,31 @@ function createDocFromHTML(content, editor, options = {}) {
|
|
|
28821
28823
|
function L() {
|
|
28822
28824
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
28823
28825
|
}
|
|
28824
|
-
var
|
|
28826
|
+
var T = L();
|
|
28825
28827
|
function G(l3) {
|
|
28826
|
-
|
|
28828
|
+
T = l3;
|
|
28827
28829
|
}
|
|
28828
28830
|
var E = { exec: () => null };
|
|
28829
|
-
function
|
|
28831
|
+
function d(l3, e = "") {
|
|
28830
28832
|
let t = typeof l3 == "string" ? l3 : l3.source, n = { replace: (r, i) => {
|
|
28831
28833
|
let s = typeof i == "string" ? i : i.source;
|
|
28832
28834
|
return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
|
|
28833
28835
|
}, getRegex: () => new RegExp(t, e) };
|
|
28834
28836
|
return n;
|
|
28835
28837
|
}
|
|
28836
|
-
var
|
|
28837
|
-
|
|
28838
|
-
|
|
28838
|
+
var be = (() => {
|
|
28839
|
+
try {
|
|
28840
|
+
return !!new RegExp("(?<=1)(?<!1)");
|
|
28841
|
+
} catch {
|
|
28842
|
+
return false;
|
|
28843
|
+
}
|
|
28844
|
+
})(), m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l3) => new RegExp(`^( {0,3}${l3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}#`), htmlBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}<(?:[a-z].*>|!--)`, "i") }, Re = /^(?:[ \t]*(?:\n|$))+/, Te = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Oe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, we = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, F = /(?:[*+-]|\d{1,9}[.)])/, ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, oe = d(ie).replace(/bull/g, F).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ye = d(ie).replace(/bull/g, F).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Pe = /^[^\n]+/, Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Se = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), $e = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex(), v = "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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _e = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = d(j).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), Le = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(), K = { blockquote: Le, code: Te, def: Se, fences: Oe, heading: we, hr: I, html: _e, lheading: oe, list: $e, newline: Re, paragraph: ae, table: E, text: Pe }, re = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), Me = { ...K, lheading: ye, table: re, paragraph: d(j).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() }, ze = { ...K, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: E, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(j).replace("hr", I).replace("heading", ` *#{1,6} *[^
|
|
28845
|
+
]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ee = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, le = /^( {2,}|\\)\n(?!\s*$)/, Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, W = /[\s\p{P}\p{S}]/u, ue = /[^\s\p{P}\p{S}]/u, Ce = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, Be = /(?!~)[\s\p{P}\p{S}]/u, qe = /(?:[^\s\p{P}\p{S}]|~)/u, ve = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", be ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, De = d(ce, "u").replace(/punct/g, D).getRegex(), He = d(ce, "u").replace(/punct/g, pe).getRegex(), he$3 = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ze = d(he$3, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Ge = d(he$3, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, Be).replace(/punct/g, pe).getRegex(), Ne = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Fe = d(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), je = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[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])?)+(?![-_])/).getRegex(), Qe = d(U).replace("(?:-->|$)", "-->").getRegex(), Ue = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ke = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), de = d(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex(), ke = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(), We = d("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex(), se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, X = { _backpedal: E, anyPunctuation: Fe, autolink: je, blockSkip: ve, br: le, code: Ee, del: E, emStrongLDelim: De, emStrongRDelimAst: Ze, emStrongRDelimUnd: Ne, escape: Ae, link: Ke, nolink: ke, punctuation: Ce, reflink: de, reflinkSearch: We, tag: Ue, text: Ie, url: E }, Xe = { ...X, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() }, N = { ...X, emStrongRDelimAst: Ge, emStrongLDelim: He, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() }, Je = { ...N, br: d(le).replace("{2,}", "*").getRegex(), text: d(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, C = { normal: K, gfm: Me, pedantic: ze }, M = { normal: X, gfm: N, breaks: Je, pedantic: Xe };
|
|
28846
|
+
var Ve = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ge = (l3) => Ve[l3];
|
|
28839
28847
|
function w(l3, e) {
|
|
28840
28848
|
if (e) {
|
|
28841
|
-
if (m.escapeTest.test(l3)) return l3.replace(m.escapeReplace,
|
|
28842
|
-
} else if (m.escapeTestNoEncode.test(l3)) return l3.replace(m.escapeReplaceNoEncode,
|
|
28849
|
+
if (m.escapeTest.test(l3)) return l3.replace(m.escapeReplace, ge);
|
|
28850
|
+
} else if (m.escapeTestNoEncode.test(l3)) return l3.replace(m.escapeReplaceNoEncode, ge);
|
|
28843
28851
|
return l3;
|
|
28844
28852
|
}
|
|
28845
28853
|
function J(l3) {
|
|
@@ -28851,10 +28859,10 @@ function J(l3) {
|
|
|
28851
28859
|
return l3;
|
|
28852
28860
|
}
|
|
28853
28861
|
function V(l3, e) {
|
|
28854
|
-
let t = l3.replace(m.findPipe, (i, s,
|
|
28855
|
-
let
|
|
28856
|
-
for (; --
|
|
28857
|
-
return
|
|
28862
|
+
let t = l3.replace(m.findPipe, (i, s, a) => {
|
|
28863
|
+
let o = false, p = s;
|
|
28864
|
+
for (; --p >= 0 && a[p] === "\\"; ) o = !o;
|
|
28865
|
+
return o ? "|" : " |";
|
|
28858
28866
|
}), n = t.split(m.splitPipe), r = 0;
|
|
28859
28867
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
|
|
28860
28868
|
else for (; n.length < e; ) n.push("");
|
|
@@ -28872,7 +28880,7 @@ function z(l3, e, t) {
|
|
|
28872
28880
|
}
|
|
28873
28881
|
return l3.slice(0, n - r);
|
|
28874
28882
|
}
|
|
28875
|
-
function
|
|
28883
|
+
function fe(l3, e) {
|
|
28876
28884
|
if (l3.indexOf(e[1]) === -1) return -1;
|
|
28877
28885
|
let t = 0;
|
|
28878
28886
|
for (let n = 0; n < l3.length; n++) if (l3[n] === "\\") n++;
|
|
@@ -28880,13 +28888,13 @@ function ge(l3, e) {
|
|
|
28880
28888
|
else if (l3[n] === e[1] && (t--, t < 0)) return n;
|
|
28881
28889
|
return t > 0 ? -2 : -1;
|
|
28882
28890
|
}
|
|
28883
|
-
function
|
|
28884
|
-
let i = e.href, s = e.title || null,
|
|
28891
|
+
function me(l3, e, t, n, r) {
|
|
28892
|
+
let i = e.href, s = e.title || null, a = l3[1].replace(r.other.outputLinkReplace, "$1");
|
|
28885
28893
|
n.state.inLink = true;
|
|
28886
|
-
let
|
|
28887
|
-
return n.state.inLink = false,
|
|
28894
|
+
let o = { type: l3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
|
|
28895
|
+
return n.state.inLink = false, o;
|
|
28888
28896
|
}
|
|
28889
|
-
function
|
|
28897
|
+
function Ye(l3, e, t) {
|
|
28890
28898
|
let n = l3.match(t.other.indentCodeCompensation);
|
|
28891
28899
|
if (n === null) return e;
|
|
28892
28900
|
let r = n[1];
|
|
@@ -28894,8 +28902,8 @@ function Je(l3, e, t) {
|
|
|
28894
28902
|
`).map((i) => {
|
|
28895
28903
|
let s = i.match(t.other.beginningSpace);
|
|
28896
28904
|
if (s === null) return i;
|
|
28897
|
-
let [
|
|
28898
|
-
return
|
|
28905
|
+
let [a] = s;
|
|
28906
|
+
return a.length >= r.length ? i.slice(r.length) : i;
|
|
28899
28907
|
}).join(`
|
|
28900
28908
|
`);
|
|
28901
28909
|
}
|
|
@@ -28904,7 +28912,7 @@ var y = class {
|
|
|
28904
28912
|
__publicField(this, "options");
|
|
28905
28913
|
__publicField(this, "rules");
|
|
28906
28914
|
__publicField(this, "lexer");
|
|
28907
|
-
this.options = e ||
|
|
28915
|
+
this.options = e || T;
|
|
28908
28916
|
}
|
|
28909
28917
|
space(e) {
|
|
28910
28918
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -28921,7 +28929,7 @@ var y = class {
|
|
|
28921
28929
|
fences(e) {
|
|
28922
28930
|
let t = this.rules.block.fences.exec(e);
|
|
28923
28931
|
if (t) {
|
|
28924
|
-
let n = t[0], r =
|
|
28932
|
+
let n = t[0], r = Ye(n, t[3] || "", this.rules);
|
|
28925
28933
|
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
|
|
28926
28934
|
}
|
|
28927
28935
|
}
|
|
@@ -28948,32 +28956,32 @@ var y = class {
|
|
|
28948
28956
|
`).split(`
|
|
28949
28957
|
`), r = "", i = "", s = [];
|
|
28950
28958
|
for (; n.length > 0; ) {
|
|
28951
|
-
let
|
|
28952
|
-
for (
|
|
28953
|
-
else if (!
|
|
28959
|
+
let a = false, o = [], p;
|
|
28960
|
+
for (p = 0; p < n.length; p++) if (this.rules.other.blockquoteStart.test(n[p])) o.push(n[p]), a = true;
|
|
28961
|
+
else if (!a) o.push(n[p]);
|
|
28954
28962
|
else break;
|
|
28955
|
-
n = n.slice(
|
|
28956
|
-
let
|
|
28957
|
-
`), c =
|
|
28963
|
+
n = n.slice(p);
|
|
28964
|
+
let u = o.join(`
|
|
28965
|
+
`), c = u.replace(this.rules.other.blockquoteSetextReplace, `
|
|
28958
28966
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
28959
28967
|
r = r ? `${r}
|
|
28960
|
-
${
|
|
28968
|
+
${u}` : u, i = i ? `${i}
|
|
28961
28969
|
${c}` : c;
|
|
28962
|
-
let
|
|
28963
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top =
|
|
28964
|
-
let
|
|
28965
|
-
if (
|
|
28966
|
-
if (
|
|
28967
|
-
let
|
|
28970
|
+
let g = this.lexer.state.top;
|
|
28971
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0) break;
|
|
28972
|
+
let h = s.at(-1);
|
|
28973
|
+
if (h?.type === "code") break;
|
|
28974
|
+
if (h?.type === "blockquote") {
|
|
28975
|
+
let R = h, f = R.raw + `
|
|
28968
28976
|
` + n.join(`
|
|
28969
|
-
`),
|
|
28970
|
-
s[s.length - 1] =
|
|
28977
|
+
`), O = this.blockquote(f);
|
|
28978
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
|
|
28971
28979
|
break;
|
|
28972
|
-
} else if (
|
|
28973
|
-
let
|
|
28980
|
+
} else if (h?.type === "list") {
|
|
28981
|
+
let R = h, f = R.raw + `
|
|
28974
28982
|
` + n.join(`
|
|
28975
|
-
`),
|
|
28976
|
-
s[s.length - 1] =
|
|
28983
|
+
`), O = this.list(f);
|
|
28984
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - h.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
28977
28985
|
`);
|
|
28978
28986
|
continue;
|
|
28979
28987
|
}
|
|
@@ -28986,45 +28994,45 @@ ${c}` : c;
|
|
|
28986
28994
|
if (t) {
|
|
28987
28995
|
let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
|
|
28988
28996
|
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
28989
|
-
let s = this.rules.other.listItemRegex(n),
|
|
28997
|
+
let s = this.rules.other.listItemRegex(n), a = false;
|
|
28990
28998
|
for (; e; ) {
|
|
28991
|
-
let
|
|
28999
|
+
let p = false, u = "", c = "";
|
|
28992
29000
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
28993
|
-
|
|
28994
|
-
let
|
|
28995
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)),
|
|
28996
|
-
`, 1)[0],
|
|
28997
|
-
if (this.options.pedantic ? (
|
|
28998
|
-
`, e = e.substring(
|
|
28999
|
-
let H = this.rules.other.nextBulletRegex(
|
|
29001
|
+
u = t[0], e = e.substring(u.length);
|
|
29002
|
+
let g = t[2].split(`
|
|
29003
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), h = e.split(`
|
|
29004
|
+
`, 1)[0], R = !g.trim(), f = 0;
|
|
29005
|
+
if (this.options.pedantic ? (f = 2, c = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (u += h + `
|
|
29006
|
+
`, e = e.substring(h.length + 1), p = true), !p) {
|
|
29007
|
+
let H = this.rules.other.nextBulletRegex(f), ee = this.rules.other.hrRegex(f), te = this.rules.other.fencesBeginRegex(f), ne = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f);
|
|
29000
29008
|
for (; e; ) {
|
|
29001
29009
|
let Z = e.split(`
|
|
29002
29010
|
`, 1)[0], A;
|
|
29003
|
-
if (
|
|
29004
|
-
if (A.search(this.rules.other.nonSpaceChar) >=
|
|
29005
|
-
` + A.slice(
|
|
29011
|
+
if (h = Z, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), te.test(h) || ne.test(h) || xe.test(h) || H.test(h) || ee.test(h)) break;
|
|
29012
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
|
|
29013
|
+
` + A.slice(f);
|
|
29006
29014
|
else {
|
|
29007
|
-
if (
|
|
29015
|
+
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(g) || ne.test(g) || ee.test(g)) break;
|
|
29008
29016
|
c += `
|
|
29009
|
-
` +
|
|
29017
|
+
` + h;
|
|
29010
29018
|
}
|
|
29011
|
-
!
|
|
29012
|
-
`, e = e.substring(Z.length + 1),
|
|
29019
|
+
!R && !h.trim() && (R = true), u += Z + `
|
|
29020
|
+
`, e = e.substring(Z.length + 1), g = A.slice(f);
|
|
29013
29021
|
}
|
|
29014
29022
|
}
|
|
29015
|
-
i.loose || (
|
|
29016
|
-
let
|
|
29017
|
-
this.options.gfm && (
|
|
29023
|
+
i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(u) && (a = true));
|
|
29024
|
+
let O = null, Y;
|
|
29025
|
+
this.options.gfm && (O = this.rules.other.listIsTask.exec(c), O && (Y = O[0] !== "[ ] ", c = c.replace(this.rules.other.listReplaceTask, ""))), i.items.push({ type: "list_item", raw: u, task: !!O, checked: Y, loose: false, text: c, tokens: [] }), i.raw += u;
|
|
29018
29026
|
}
|
|
29019
|
-
let
|
|
29020
|
-
if (
|
|
29027
|
+
let o = i.items.at(-1);
|
|
29028
|
+
if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
|
|
29021
29029
|
else return;
|
|
29022
29030
|
i.raw = i.raw.trimEnd();
|
|
29023
|
-
for (let
|
|
29024
|
-
let
|
|
29031
|
+
for (let p = 0; p < i.items.length; p++) if (this.lexer.state.top = false, i.items[p].tokens = this.lexer.blockTokens(i.items[p].text, []), !i.loose) {
|
|
29032
|
+
let u = i.items[p].tokens.filter((g) => g.type === "space"), c = u.length > 0 && u.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
29025
29033
|
i.loose = c;
|
|
29026
29034
|
}
|
|
29027
|
-
if (i.loose) for (let
|
|
29035
|
+
if (i.loose) for (let p = 0; p < i.items.length; p++) i.items[p].loose = true;
|
|
29028
29036
|
return i;
|
|
29029
29037
|
}
|
|
29030
29038
|
}
|
|
@@ -29045,9 +29053,9 @@ ${c}` : c;
|
|
|
29045
29053
|
let n = V(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
29046
29054
|
`) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
|
|
29047
29055
|
if (n.length === r.length) {
|
|
29048
|
-
for (let
|
|
29049
|
-
for (let
|
|
29050
|
-
for (let
|
|
29056
|
+
for (let a of r) this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
|
|
29057
|
+
for (let a = 0; a < n.length; a++) s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
|
|
29058
|
+
for (let a of i) s.rows.push(V(a, s.header.length).map((o, p) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[p] })));
|
|
29051
29059
|
return s;
|
|
29052
29060
|
}
|
|
29053
29061
|
}
|
|
@@ -29084,11 +29092,11 @@ ${c}` : c;
|
|
|
29084
29092
|
let s = z(n.slice(0, -1), "\\");
|
|
29085
29093
|
if ((n.length - s.length) % 2 === 0) return;
|
|
29086
29094
|
} else {
|
|
29087
|
-
let s =
|
|
29095
|
+
let s = fe(t[2], "()");
|
|
29088
29096
|
if (s === -2) return;
|
|
29089
29097
|
if (s > -1) {
|
|
29090
|
-
let
|
|
29091
|
-
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0,
|
|
29098
|
+
let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
29099
|
+
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
|
|
29092
29100
|
}
|
|
29093
29101
|
}
|
|
29094
29102
|
let r = t[2], i = "";
|
|
@@ -29096,7 +29104,7 @@ ${c}` : c;
|
|
|
29096
29104
|
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
29097
29105
|
s && (r = s[1], i = s[3]);
|
|
29098
29106
|
} else i = t[3] ? t[3].slice(1, -1) : "";
|
|
29099
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
29107
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), me(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
29100
29108
|
}
|
|
29101
29109
|
}
|
|
29102
29110
|
reflink(e, t) {
|
|
@@ -29107,32 +29115,32 @@ ${c}` : c;
|
|
|
29107
29115
|
let s = n[0].charAt(0);
|
|
29108
29116
|
return { type: "text", raw: s, text: s };
|
|
29109
29117
|
}
|
|
29110
|
-
return
|
|
29118
|
+
return me(n, i, n[0], this.lexer, this.rules);
|
|
29111
29119
|
}
|
|
29112
29120
|
}
|
|
29113
29121
|
emStrong(e, t, n = "") {
|
|
29114
29122
|
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
29115
29123
|
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
|
|
29116
29124
|
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
29117
|
-
let s = [...r[0]].length - 1,
|
|
29125
|
+
let s = [...r[0]].length - 1, a, o, p = s, u = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
29118
29126
|
for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null; ) {
|
|
29119
|
-
if (
|
|
29120
|
-
if (
|
|
29121
|
-
|
|
29127
|
+
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
|
|
29128
|
+
if (o = [...a].length, r[3] || r[4]) {
|
|
29129
|
+
p += o;
|
|
29122
29130
|
continue;
|
|
29123
|
-
} else if ((r[5] || r[6]) && s % 3 && !((s +
|
|
29124
|
-
|
|
29131
|
+
} else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
|
|
29132
|
+
u += o;
|
|
29125
29133
|
continue;
|
|
29126
29134
|
}
|
|
29127
|
-
if (
|
|
29128
|
-
|
|
29129
|
-
let
|
|
29130
|
-
if (Math.min(s,
|
|
29131
|
-
let
|
|
29132
|
-
return { type: "em", raw:
|
|
29135
|
+
if (p -= o, p > 0) continue;
|
|
29136
|
+
o = Math.min(o, o + p + u);
|
|
29137
|
+
let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
|
|
29138
|
+
if (Math.min(s, o) % 2) {
|
|
29139
|
+
let f = h.slice(1, -1);
|
|
29140
|
+
return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
29133
29141
|
}
|
|
29134
|
-
let
|
|
29135
|
-
return { type: "strong", raw:
|
|
29142
|
+
let R = h.slice(2, -2);
|
|
29143
|
+
return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
29136
29144
|
}
|
|
29137
29145
|
}
|
|
29138
29146
|
}
|
|
@@ -29181,19 +29189,19 @@ ${c}` : c;
|
|
|
29181
29189
|
}
|
|
29182
29190
|
}
|
|
29183
29191
|
};
|
|
29184
|
-
var
|
|
29192
|
+
var x = class l {
|
|
29185
29193
|
constructor(e) {
|
|
29186
29194
|
__publicField(this, "tokens");
|
|
29187
29195
|
__publicField(this, "options");
|
|
29188
29196
|
__publicField(this, "state");
|
|
29189
29197
|
__publicField(this, "tokenizer");
|
|
29190
29198
|
__publicField(this, "inlineQueue");
|
|
29191
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e ||
|
|
29192
|
-
let t = { other: m, block:
|
|
29193
|
-
this.options.pedantic ? (t.block =
|
|
29199
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
|
|
29200
|
+
let t = { other: m, block: C.normal, inline: M.normal };
|
|
29201
|
+
this.options.pedantic ? (t.block = C.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = C.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
|
|
29194
29202
|
}
|
|
29195
29203
|
static get rules() {
|
|
29196
|
-
return { block:
|
|
29204
|
+
return { block: C, inline: M };
|
|
29197
29205
|
}
|
|
29198
29206
|
static lex(e, t) {
|
|
29199
29207
|
return new l(t).lex(e);
|
|
@@ -29273,9 +29281,9 @@ var b = class l {
|
|
|
29273
29281
|
}
|
|
29274
29282
|
let i = e;
|
|
29275
29283
|
if (this.options.extensions?.startBlock) {
|
|
29276
|
-
let s = 1 / 0,
|
|
29277
|
-
this.options.extensions.startBlock.forEach((
|
|
29278
|
-
|
|
29284
|
+
let s = 1 / 0, a = e.slice(1), o;
|
|
29285
|
+
this.options.extensions.startBlock.forEach((p) => {
|
|
29286
|
+
o = p.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
|
|
29279
29287
|
}), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
|
|
29280
29288
|
}
|
|
29281
29289
|
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
@@ -29315,11 +29323,12 @@ var b = class l {
|
|
|
29315
29323
|
if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; ) o.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
29316
29324
|
}
|
|
29317
29325
|
for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
29318
|
-
|
|
29326
|
+
let i;
|
|
29327
|
+
for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
29319
29328
|
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
29320
|
-
let
|
|
29329
|
+
let s = false, a = "";
|
|
29321
29330
|
for (; e; ) {
|
|
29322
|
-
|
|
29331
|
+
s || (a = ""), s = false;
|
|
29323
29332
|
let o;
|
|
29324
29333
|
if (this.options.extensions?.inline?.some((u) => (o = u.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
|
|
29325
29334
|
if (o = this.tokenizer.escape(e)) {
|
|
@@ -29340,7 +29349,7 @@ var b = class l {
|
|
|
29340
29349
|
o.type === "text" && u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
|
|
29341
29350
|
continue;
|
|
29342
29351
|
}
|
|
29343
|
-
if (o = this.tokenizer.emStrong(e, n,
|
|
29352
|
+
if (o = this.tokenizer.emStrong(e, n, a)) {
|
|
29344
29353
|
e = e.substring(o.raw.length), t.push(o);
|
|
29345
29354
|
continue;
|
|
29346
29355
|
}
|
|
@@ -29364,15 +29373,15 @@ var b = class l {
|
|
|
29364
29373
|
e = e.substring(o.raw.length), t.push(o);
|
|
29365
29374
|
continue;
|
|
29366
29375
|
}
|
|
29367
|
-
let
|
|
29376
|
+
let p = e;
|
|
29368
29377
|
if (this.options.extensions?.startInline) {
|
|
29369
|
-
let u = 1 / 0,
|
|
29370
|
-
this.options.extensions.startInline.forEach((
|
|
29371
|
-
|
|
29372
|
-
}), u < 1 / 0 && u >= 0 && (
|
|
29378
|
+
let u = 1 / 0, c = e.slice(1), g;
|
|
29379
|
+
this.options.extensions.startInline.forEach((h) => {
|
|
29380
|
+
g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (u = Math.min(u, g));
|
|
29381
|
+
}), u < 1 / 0 && u >= 0 && (p = e.substring(0, u + 1));
|
|
29373
29382
|
}
|
|
29374
|
-
if (o = this.tokenizer.inlineText(
|
|
29375
|
-
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (
|
|
29383
|
+
if (o = this.tokenizer.inlineText(p)) {
|
|
29384
|
+
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = true;
|
|
29376
29385
|
let u = t.at(-1);
|
|
29377
29386
|
u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
|
|
29378
29387
|
continue;
|
|
@@ -29392,7 +29401,7 @@ var P = class {
|
|
|
29392
29401
|
constructor(e) {
|
|
29393
29402
|
__publicField(this, "options");
|
|
29394
29403
|
__publicField(this, "parser");
|
|
29395
|
-
this.options = e ||
|
|
29404
|
+
this.options = e || T;
|
|
29396
29405
|
}
|
|
29397
29406
|
space(e) {
|
|
29398
29407
|
return "";
|
|
@@ -29425,9 +29434,9 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
29425
29434
|
}
|
|
29426
29435
|
list(e) {
|
|
29427
29436
|
let t = e.ordered, n = e.start, r = "";
|
|
29428
|
-
for (let
|
|
29429
|
-
let
|
|
29430
|
-
r += this.listitem(
|
|
29437
|
+
for (let a = 0; a < e.items.length; a++) {
|
|
29438
|
+
let o = e.items[a];
|
|
29439
|
+
r += this.listitem(o);
|
|
29431
29440
|
}
|
|
29432
29441
|
let i = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
|
|
29433
29442
|
return "<" + i + s + `>
|
|
@@ -29458,7 +29467,7 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
29458
29467
|
for (let i = 0; i < e.rows.length; i++) {
|
|
29459
29468
|
let s = e.rows[i];
|
|
29460
29469
|
n = "";
|
|
29461
|
-
for (let
|
|
29470
|
+
for (let a = 0; a < s.length; a++) n += this.tablecell(s[a]);
|
|
29462
29471
|
r += this.tablerow({ text: n });
|
|
29463
29472
|
}
|
|
29464
29473
|
return r && (r = `<tbody>${r}</tbody>`), `<table>
|
|
@@ -29540,12 +29549,12 @@ var $ = class {
|
|
|
29540
29549
|
return "";
|
|
29541
29550
|
}
|
|
29542
29551
|
};
|
|
29543
|
-
var
|
|
29552
|
+
var b = class l2 {
|
|
29544
29553
|
constructor(e) {
|
|
29545
29554
|
__publicField(this, "options");
|
|
29546
29555
|
__publicField(this, "renderer");
|
|
29547
29556
|
__publicField(this, "textRenderer");
|
|
29548
|
-
this.options = e ||
|
|
29557
|
+
this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
|
|
29549
29558
|
}
|
|
29550
29559
|
static parse(e, t) {
|
|
29551
29560
|
return new l2(t).parse(e);
|
|
@@ -29558,9 +29567,9 @@ var R = class l2 {
|
|
|
29558
29567
|
for (let r = 0; r < e.length; r++) {
|
|
29559
29568
|
let i = e[r];
|
|
29560
29569
|
if (this.options.extensions?.renderers?.[i.type]) {
|
|
29561
|
-
let
|
|
29562
|
-
if (
|
|
29563
|
-
n +=
|
|
29570
|
+
let a = i, o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
|
|
29571
|
+
if (o !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(a.type)) {
|
|
29572
|
+
n += o || "";
|
|
29564
29573
|
continue;
|
|
29565
29574
|
}
|
|
29566
29575
|
}
|
|
@@ -29607,16 +29616,16 @@ var R = class l2 {
|
|
|
29607
29616
|
continue;
|
|
29608
29617
|
}
|
|
29609
29618
|
case "text": {
|
|
29610
|
-
let
|
|
29611
|
-
for (; r + 1 < e.length && e[r + 1].type === "text"; )
|
|
29612
|
-
` + this.renderer.text(
|
|
29613
|
-
t ? n += this.renderer.paragraph({ type: "paragraph", raw:
|
|
29619
|
+
let a = s, o = this.renderer.text(a);
|
|
29620
|
+
for (; r + 1 < e.length && e[r + 1].type === "text"; ) a = e[++r], o += `
|
|
29621
|
+
` + this.renderer.text(a);
|
|
29622
|
+
t ? n += this.renderer.paragraph({ type: "paragraph", raw: o, text: o, tokens: [{ type: "text", raw: o, text: o, escaped: true }] }) : n += o;
|
|
29614
29623
|
continue;
|
|
29615
29624
|
}
|
|
29616
29625
|
default: {
|
|
29617
|
-
let
|
|
29618
|
-
if (this.options.silent) return console.error(
|
|
29619
|
-
throw new Error(
|
|
29626
|
+
let a = 'Token with "' + s.type + '" type was not found.';
|
|
29627
|
+
if (this.options.silent) return console.error(a), "";
|
|
29628
|
+
throw new Error(a);
|
|
29620
29629
|
}
|
|
29621
29630
|
}
|
|
29622
29631
|
}
|
|
@@ -29627,9 +29636,9 @@ var R = class l2 {
|
|
|
29627
29636
|
for (let r = 0; r < e.length; r++) {
|
|
29628
29637
|
let i = e[r];
|
|
29629
29638
|
if (this.options.extensions?.renderers?.[i.type]) {
|
|
29630
|
-
let
|
|
29631
|
-
if (
|
|
29632
|
-
n +=
|
|
29639
|
+
let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
29640
|
+
if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
|
|
29641
|
+
n += a || "";
|
|
29633
29642
|
continue;
|
|
29634
29643
|
}
|
|
29635
29644
|
}
|
|
@@ -29676,9 +29685,9 @@ var R = class l2 {
|
|
|
29676
29685
|
break;
|
|
29677
29686
|
}
|
|
29678
29687
|
default: {
|
|
29679
|
-
let
|
|
29680
|
-
if (this.options.silent) return console.error(
|
|
29681
|
-
throw new Error(
|
|
29688
|
+
let a = 'Token with "' + s.type + '" type was not found.';
|
|
29689
|
+
if (this.options.silent) return console.error(a), "";
|
|
29690
|
+
throw new Error(a);
|
|
29682
29691
|
}
|
|
29683
29692
|
}
|
|
29684
29693
|
}
|
|
@@ -29689,7 +29698,7 @@ var S = (_a = class {
|
|
|
29689
29698
|
constructor(e) {
|
|
29690
29699
|
__publicField(this, "options");
|
|
29691
29700
|
__publicField(this, "block");
|
|
29692
|
-
this.options = e ||
|
|
29701
|
+
this.options = e || T;
|
|
29693
29702
|
}
|
|
29694
29703
|
preprocess(e) {
|
|
29695
29704
|
return e;
|
|
@@ -29704,10 +29713,10 @@ var S = (_a = class {
|
|
|
29704
29713
|
return e;
|
|
29705
29714
|
}
|
|
29706
29715
|
provideLexer() {
|
|
29707
|
-
return this.block ?
|
|
29716
|
+
return this.block ? x.lex : x.lexInline;
|
|
29708
29717
|
}
|
|
29709
29718
|
provideParser() {
|
|
29710
|
-
return this.block ?
|
|
29719
|
+
return this.block ? b.parse : b.parseInline;
|
|
29711
29720
|
}
|
|
29712
29721
|
}, __publicField(_a, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), __publicField(_a, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), _a);
|
|
29713
29722
|
var B = class {
|
|
@@ -29716,10 +29725,10 @@ var B = class {
|
|
|
29716
29725
|
__publicField(this, "options", this.setOptions);
|
|
29717
29726
|
__publicField(this, "parse", this.parseMarkdown(true));
|
|
29718
29727
|
__publicField(this, "parseInline", this.parseMarkdown(false));
|
|
29719
|
-
__publicField(this, "Parser",
|
|
29728
|
+
__publicField(this, "Parser", b);
|
|
29720
29729
|
__publicField(this, "Renderer", P);
|
|
29721
29730
|
__publicField(this, "TextRenderer", $);
|
|
29722
|
-
__publicField(this, "Lexer",
|
|
29731
|
+
__publicField(this, "Lexer", x);
|
|
29723
29732
|
__publicField(this, "Tokenizer", y);
|
|
29724
29733
|
__publicField(this, "Hooks", S);
|
|
29725
29734
|
this.use(...e);
|
|
@@ -29730,7 +29739,7 @@ var B = class {
|
|
|
29730
29739
|
case "table": {
|
|
29731
29740
|
let i = r;
|
|
29732
29741
|
for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
|
|
29733
|
-
for (let s of i.rows) for (let
|
|
29742
|
+
for (let s of i.rows) for (let a of s) n = n.concat(this.walkTokens(a.tokens, t));
|
|
29734
29743
|
break;
|
|
29735
29744
|
}
|
|
29736
29745
|
case "list": {
|
|
@@ -29741,8 +29750,8 @@ var B = class {
|
|
|
29741
29750
|
default: {
|
|
29742
29751
|
let i = r;
|
|
29743
29752
|
this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
|
|
29744
|
-
let
|
|
29745
|
-
n = n.concat(this.walkTokens(
|
|
29753
|
+
let a = i[s].flat(1 / 0);
|
|
29754
|
+
n = n.concat(this.walkTokens(a, t));
|
|
29746
29755
|
}) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
|
|
29747
29756
|
}
|
|
29748
29757
|
}
|
|
@@ -29756,9 +29765,9 @@ var B = class {
|
|
|
29756
29765
|
if (!i.name) throw new Error("extension name required");
|
|
29757
29766
|
if ("renderer" in i) {
|
|
29758
29767
|
let s = t.renderers[i.name];
|
|
29759
|
-
s ? t.renderers[i.name] = function(...
|
|
29760
|
-
let
|
|
29761
|
-
return
|
|
29768
|
+
s ? t.renderers[i.name] = function(...a) {
|
|
29769
|
+
let o = i.renderer.apply(this, a);
|
|
29770
|
+
return o === false && (o = s.apply(this, a)), o;
|
|
29762
29771
|
} : t.renderers[i.name] = i.renderer;
|
|
29763
29772
|
}
|
|
29764
29773
|
if ("tokenizer" in i) {
|
|
@@ -29772,10 +29781,10 @@ var B = class {
|
|
|
29772
29781
|
for (let s in n.renderer) {
|
|
29773
29782
|
if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
|
|
29774
29783
|
if (["options", "parser"].includes(s)) continue;
|
|
29775
|
-
let
|
|
29776
|
-
i[
|
|
29777
|
-
let c =
|
|
29778
|
-
return c === false && (c =
|
|
29784
|
+
let a = s, o = n.renderer[a], p = i[a];
|
|
29785
|
+
i[a] = (...u) => {
|
|
29786
|
+
let c = o.apply(i, u);
|
|
29787
|
+
return c === false && (c = p.apply(i, u)), c || "";
|
|
29779
29788
|
};
|
|
29780
29789
|
}
|
|
29781
29790
|
r.renderer = i;
|
|
@@ -29785,10 +29794,10 @@ var B = class {
|
|
|
29785
29794
|
for (let s in n.tokenizer) {
|
|
29786
29795
|
if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
|
|
29787
29796
|
if (["options", "rules", "lexer"].includes(s)) continue;
|
|
29788
|
-
let
|
|
29789
|
-
i[
|
|
29790
|
-
let c =
|
|
29791
|
-
return c === false && (c =
|
|
29797
|
+
let a = s, o = n.tokenizer[a], p = i[a];
|
|
29798
|
+
i[a] = (...u) => {
|
|
29799
|
+
let c = o.apply(i, u);
|
|
29800
|
+
return c === false && (c = p.apply(i, u)), c;
|
|
29792
29801
|
};
|
|
29793
29802
|
}
|
|
29794
29803
|
r.tokenizer = i;
|
|
@@ -29798,23 +29807,30 @@ var B = class {
|
|
|
29798
29807
|
for (let s in n.hooks) {
|
|
29799
29808
|
if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
|
|
29800
29809
|
if (["options", "block"].includes(s)) continue;
|
|
29801
|
-
let
|
|
29802
|
-
S.passThroughHooks.has(s) ? i[
|
|
29803
|
-
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return
|
|
29804
|
-
|
|
29805
|
-
|
|
29806
|
-
|
|
29807
|
-
let c =
|
|
29808
|
-
return
|
|
29810
|
+
let a = s, o = n.hooks[a], p = i[a];
|
|
29811
|
+
S.passThroughHooks.has(s) ? i[a] = (u) => {
|
|
29812
|
+
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
|
|
29813
|
+
let g = await o.call(i, u);
|
|
29814
|
+
return p.call(i, g);
|
|
29815
|
+
})();
|
|
29816
|
+
let c = o.call(i, u);
|
|
29817
|
+
return p.call(i, c);
|
|
29818
|
+
} : i[a] = (...u) => {
|
|
29819
|
+
if (this.defaults.async) return (async () => {
|
|
29820
|
+
let g = await o.apply(i, u);
|
|
29821
|
+
return g === false && (g = await p.apply(i, u)), g;
|
|
29822
|
+
})();
|
|
29823
|
+
let c = o.apply(i, u);
|
|
29824
|
+
return c === false && (c = p.apply(i, u)), c;
|
|
29809
29825
|
};
|
|
29810
29826
|
}
|
|
29811
29827
|
r.hooks = i;
|
|
29812
29828
|
}
|
|
29813
29829
|
if (n.walkTokens) {
|
|
29814
29830
|
let i = this.defaults.walkTokens, s = n.walkTokens;
|
|
29815
|
-
r.walkTokens = function(
|
|
29816
|
-
let
|
|
29817
|
-
return
|
|
29831
|
+
r.walkTokens = function(a) {
|
|
29832
|
+
let o = [];
|
|
29833
|
+
return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
|
|
29818
29834
|
};
|
|
29819
29835
|
}
|
|
29820
29836
|
this.defaults = { ...this.defaults, ...r };
|
|
@@ -29824,28 +29840,31 @@ var B = class {
|
|
|
29824
29840
|
return this.defaults = { ...this.defaults, ...e }, this;
|
|
29825
29841
|
}
|
|
29826
29842
|
lexer(e, t) {
|
|
29827
|
-
return
|
|
29843
|
+
return x.lex(e, t ?? this.defaults);
|
|
29828
29844
|
}
|
|
29829
29845
|
parser(e, t) {
|
|
29830
|
-
return
|
|
29846
|
+
return b.parse(e, t ?? this.defaults);
|
|
29831
29847
|
}
|
|
29832
29848
|
parseMarkdown(e) {
|
|
29833
29849
|
return (n, r) => {
|
|
29834
|
-
let i = { ...r }, s = { ...this.defaults, ...i },
|
|
29835
|
-
if (this.defaults.async === true && i.async === false) return
|
|
29836
|
-
if (typeof n > "u" || n === null) return
|
|
29837
|
-
if (typeof n != "string") return
|
|
29838
|
-
s.hooks && (s.hooks.options = s, s.hooks.block = e)
|
|
29839
|
-
|
|
29840
|
-
|
|
29850
|
+
let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
|
|
29851
|
+
if (this.defaults.async === true && i.async === false) return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
29852
|
+
if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
|
|
29853
|
+
if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
29854
|
+
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
|
|
29855
|
+
let o = s.hooks ? await s.hooks.preprocess(n) : n, u = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(u) : u;
|
|
29856
|
+
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
29857
|
+
let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
|
|
29858
|
+
return s.hooks ? await s.hooks.postprocess(h) : h;
|
|
29859
|
+
})().catch(a);
|
|
29841
29860
|
try {
|
|
29842
29861
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
29843
|
-
let p =
|
|
29862
|
+
let p = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
29844
29863
|
s.hooks && (p = s.hooks.processAllTokens(p)), s.walkTokens && this.walkTokens(p, s.walkTokens);
|
|
29845
|
-
let c =
|
|
29864
|
+
let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
|
|
29846
29865
|
return s.hooks && (c = s.hooks.postprocess(c)), c;
|
|
29847
|
-
} catch (
|
|
29848
|
-
return o
|
|
29866
|
+
} catch (o) {
|
|
29867
|
+
return a(o);
|
|
29849
29868
|
}
|
|
29850
29869
|
};
|
|
29851
29870
|
}
|
|
@@ -29862,38 +29881,38 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
29862
29881
|
}
|
|
29863
29882
|
};
|
|
29864
29883
|
var _ = new B();
|
|
29865
|
-
function
|
|
29884
|
+
function k(l3, e) {
|
|
29866
29885
|
return _.parse(l3, e);
|
|
29867
29886
|
}
|
|
29868
|
-
|
|
29869
|
-
return _.setOptions(l3),
|
|
29887
|
+
k.options = k.setOptions = function(l3) {
|
|
29888
|
+
return _.setOptions(l3), k.defaults = _.defaults, G(k.defaults), k;
|
|
29870
29889
|
};
|
|
29871
|
-
|
|
29872
|
-
|
|
29873
|
-
|
|
29874
|
-
return _.use(...l3),
|
|
29890
|
+
k.getDefaults = L;
|
|
29891
|
+
k.defaults = T;
|
|
29892
|
+
k.use = function(...l3) {
|
|
29893
|
+
return _.use(...l3), k.defaults = _.defaults, G(k.defaults), k;
|
|
29875
29894
|
};
|
|
29876
|
-
|
|
29895
|
+
k.walkTokens = function(l3, e) {
|
|
29877
29896
|
return _.walkTokens(l3, e);
|
|
29878
29897
|
};
|
|
29879
|
-
|
|
29880
|
-
|
|
29881
|
-
|
|
29882
|
-
|
|
29883
|
-
|
|
29884
|
-
|
|
29885
|
-
|
|
29886
|
-
|
|
29887
|
-
|
|
29888
|
-
|
|
29889
|
-
|
|
29890
|
-
|
|
29891
|
-
|
|
29892
|
-
|
|
29893
|
-
|
|
29894
|
-
|
|
29895
|
-
|
|
29896
|
-
|
|
29898
|
+
k.parseInline = _.parseInline;
|
|
29899
|
+
k.Parser = b;
|
|
29900
|
+
k.parser = b.parse;
|
|
29901
|
+
k.Renderer = P;
|
|
29902
|
+
k.TextRenderer = $;
|
|
29903
|
+
k.Lexer = x;
|
|
29904
|
+
k.lexer = x.lex;
|
|
29905
|
+
k.Tokenizer = y;
|
|
29906
|
+
k.Hooks = S;
|
|
29907
|
+
k.parse = k;
|
|
29908
|
+
k.options;
|
|
29909
|
+
k.setOptions;
|
|
29910
|
+
k.use;
|
|
29911
|
+
k.walkTokens;
|
|
29912
|
+
k.parseInline;
|
|
29913
|
+
b.parse;
|
|
29914
|
+
x.lex;
|
|
29915
|
+
k.use({
|
|
29897
29916
|
breaks: false,
|
|
29898
29917
|
// Use proper paragraphs, not <br> tags
|
|
29899
29918
|
gfm: true
|
|
@@ -29904,7 +29923,7 @@ function createDocFromMarkdown(markdown, editor, options = {}) {
|
|
|
29904
29923
|
return createDocFromHTML(html, editor, options);
|
|
29905
29924
|
}
|
|
29906
29925
|
function convertMarkdownToHTML(markdown) {
|
|
29907
|
-
let html =
|
|
29926
|
+
let html = k.parse(markdown, { async: false });
|
|
29908
29927
|
return html.replace(/<\/p>\n<ul>/g, "</p>\n<p> </p>\n<ul>").replace(/<\/p>\n<ol>/g, "</p>\n<p> </p>\n<ol>").replace(/<\/ul>\n<h/g, "</ul>\n<p> </p>\n<h").replace(/<\/ol>\n<h/g, "</ol>\n<p> </p>\n<h");
|
|
29909
29928
|
}
|
|
29910
29929
|
function processContent({ content, type: type2, editor }) {
|
|
@@ -30023,8 +30042,8 @@ const translateImageNode = (params) => {
|
|
|
30023
30042
|
const leftMargin = tableCell.attrs.cellMargins?.left || 8;
|
|
30024
30043
|
const rightMargin = tableCell.attrs.cellMargins?.right || 8;
|
|
30025
30044
|
const maxWidthEmu = pixelsToEmu(colwidthSum - (leftMargin + rightMargin));
|
|
30026
|
-
const { width: w2, height:
|
|
30027
|
-
if (w2 &&
|
|
30045
|
+
const { width: w2, height: h } = resizeKeepAspectRatio(size.w, size.h, maxWidthEmu);
|
|
30046
|
+
if (w2 && h) size = { w: w2, h };
|
|
30028
30047
|
}
|
|
30029
30048
|
if (imageId) {
|
|
30030
30049
|
const docx = params.converter?.convertedXml || {};
|
|
@@ -35613,7 +35632,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
35613
35632
|
static getStoredSuperdocVersion(docx) {
|
|
35614
35633
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
35615
35634
|
}
|
|
35616
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.31.0-next.
|
|
35635
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.31.0-next.9") {
|
|
35617
35636
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
35618
35637
|
}
|
|
35619
35638
|
/**
|
|
@@ -36010,7 +36029,7 @@ prepareCommentsXmlFilesForExport_fn = function({ defs, exportType, commentsWithP
|
|
|
36010
36029
|
};
|
|
36011
36030
|
exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
36012
36031
|
const relsData = this.convertedXml["word/_rels/document.xml.rels"];
|
|
36013
|
-
const relationships = relsData.elements.find((
|
|
36032
|
+
const relationships = relsData.elements.find((x2) => x2.name === "Relationships");
|
|
36014
36033
|
const newDocRels = [];
|
|
36015
36034
|
Object.entries(this.headers).forEach(([id, header], index2) => {
|
|
36016
36035
|
const fileName = relationships.elements.find((el) => el.attributes.Id === id)?.attributes.Target || `header${index2 + 1}.xml`;
|
|
@@ -36051,7 +36070,7 @@ exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
|
36051
36070
|
}
|
|
36052
36071
|
this.convertedXml[`word/${fileName}`].elements[0].elements = bodyContent;
|
|
36053
36072
|
if (params.relationships.length) {
|
|
36054
|
-
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((
|
|
36073
|
+
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((x2) => x2.name === "Relationships")?.elements || [];
|
|
36055
36074
|
this.convertedXml[`word/_rels/${fileName}.rels`] = {
|
|
36056
36075
|
declaration: this.initialJSON?.declaration,
|
|
36057
36076
|
elements: [
|
|
@@ -36105,7 +36124,7 @@ exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
|
36105
36124
|
}
|
|
36106
36125
|
this.convertedXml[`word/${fileName}`].elements[0].elements = bodyContent;
|
|
36107
36126
|
if (params.relationships.length) {
|
|
36108
|
-
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((
|
|
36127
|
+
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((x2) => x2.name === "Relationships")?.elements || [];
|
|
36109
36128
|
this.convertedXml[`word/_rels/${fileName}.rels`] = {
|
|
36110
36129
|
declaration: this.initialJSON?.declaration,
|
|
36111
36130
|
elements: [
|
|
@@ -36124,7 +36143,7 @@ exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
|
36124
36143
|
};
|
|
36125
36144
|
exportProcessNewRelationships_fn = function(rels = []) {
|
|
36126
36145
|
const relsData = this.convertedXml["word/_rels/document.xml.rels"];
|
|
36127
|
-
const relationships = relsData.elements.find((
|
|
36146
|
+
const relationships = relsData.elements.find((x2) => x2.name === "Relationships");
|
|
36128
36147
|
relationships.elements = mergeRelationshipElements(relationships.elements, rels);
|
|
36129
36148
|
};
|
|
36130
36149
|
exportProcessMediaFiles_fn = async function(media = {}) {
|