@bytechain.cn/colamd 2.7.12 → 2.7.13-rc.1
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 +1 -0
- package/README_CN.md +1 -0
- package/dist/lib/colamd-renderer.js +18407 -18302
- package/dist/lib/colamd.css +1 -1
- package/dist/main/chunks/docx-export.js +5 -2
- package/dist/renderer/assets/{2DXBBFLN-BJduq_n1.js → 2DXBBFLN-zwCk4Mxf.js} +4 -4
- package/dist/renderer/assets/{46IJ22JX-Dl5oABYC.js → 46IJ22JX-CcgX9r7n.js} +5 -5
- package/dist/renderer/assets/{4TTDE5I4-D0OZH30N.js → 4TTDE5I4-DseEAfc2.js} +3 -3
- package/dist/renderer/assets/{4UF3HTLV-B9lH7CBB.js → 4UF3HTLV-B4wB5AKU.js} +4 -4
- package/dist/renderer/assets/{AAXQQPKT-eq8R1-i0.js → AAXQQPKT-DWob5xGg.js} +8 -8
- package/dist/renderer/assets/{AKE5O7KZ-BPFFZy5e.js → AKE5O7KZ-vOSPM9bT.js} +5 -5
- package/dist/renderer/assets/{BNMLP6AG-DvupnLHN.js → BNMLP6AG-Cm5E3l75.js} +7 -7
- package/dist/renderer/assets/{DR6PKOQU-DXqY3tAL.js → DR6PKOQU-BY27B6Tm.js} +3 -3
- package/dist/renderer/assets/{E4RJ7UJB-B3-v1GGn.js → E4RJ7UJB-B9Qt1DBg.js} +6 -6
- package/dist/renderer/assets/{ELSXBIJH-W0-fIyGs.js → ELSXBIJH-Dd46ncmF.js} +1 -1
- package/dist/renderer/assets/{ERTIBQVS-Cjo8zCEV.js → ERTIBQVS-Ctuly7ru.js} +4 -4
- package/dist/renderer/assets/{F653G4FO-t4kGthl5.js → F653G4FO-BAG78YUI.js} +8 -8
- package/dist/renderer/assets/{FKCDD66M-CqwX5T9T.js → FKCDD66M-BYnIt2s5.js} +1 -1
- package/dist/renderer/assets/{FP7KDXVC-SqJKRKSf.js → FP7KDXVC-1kxF0Go3.js} +6 -6
- package/dist/renderer/assets/{FT5I3RHX-B1_XlJMF.js → FT5I3RHX-DBz5zOl-.js} +7 -7
- package/dist/renderer/assets/{GY35JXOZ-D_hAOI09.js → GY35JXOZ-FFtwzQYZ.js} +4 -4
- package/dist/renderer/assets/{H5EEJPP2-Dh0ee_t_.js → H5EEJPP2-CzwQt4p_.js} +9 -9
- package/dist/renderer/assets/{HWDLEDTA-BfmnLbys.js → HWDLEDTA-BoEElC3j.js} +1 -1
- package/dist/renderer/assets/{JZWSX6AR-DibCj0_r.js → JZWSX6AR-BJkYh7st.js} +2 -2
- package/dist/renderer/assets/{KQOEJWJY-CYbDpxpS.js → KQOEJWJY-B_gT6pV7.js} +1 -1
- package/dist/renderer/assets/{KS3BB3KE-BKXN5GEp.js → KS3BB3KE-Bp4Ml3CE.js} +5 -5
- package/dist/renderer/assets/{KXJRRZHI-Dd9nToeE.js → KXJRRZHI-Cpc8aBTp.js} +3 -3
- package/dist/renderer/assets/{MFVI5XKI-yEhNzg_a.js → MFVI5XKI-tGMP0W95.js} +1 -1
- package/dist/renderer/assets/{MWY2J62P-PD0ivp8r.js → MWY2J62P-Dp5JIcym.js} +5 -5
- package/dist/renderer/assets/{MXGNCBL2-CrYuCAhj.js → MXGNCBL2-_tOBtwJ3.js} +5 -5
- package/dist/renderer/assets/{N6DAJLIZ-CsI-0Pob.js → N6DAJLIZ-B0Ni9aJP.js} +2 -2
- package/dist/renderer/assets/{NU5M23IW-BRouDTU6.js → NU5M23IW-Dq9-m-cn.js} +5 -5
- package/dist/renderer/assets/{NV4XNBIS-BDKWqPgJ.js → NV4XNBIS-DrbQOkvO.js} +7 -7
- package/dist/renderer/assets/{OGLU4SIR-e03S5CRP.js → OGLU4SIR-Dk2ltttF.js} +5 -5
- package/dist/renderer/assets/{OUNS5N76-DXs9fuRM.js → OUNS5N76-xZZw3I4z.js} +6 -6
- package/dist/renderer/assets/{PU4ISKXV-DHAw3ojo.js → PU4ISKXV-C2MIDpGs.js} +5 -5
- package/dist/renderer/assets/{PUZGS23X-BJvqqbjA.js → PUZGS23X-DFCoUCN_.js} +1 -1
- package/dist/renderer/assets/{Q3IYVLG5-BBP8APVJ.js → Q3IYVLG5-D3j0WKcV.js} +5 -5
- package/dist/renderer/assets/{QYHQDLKZ-Dk9FA6iI.js → QYHQDLKZ-B0CE5fTR.js} +9 -9
- package/dist/renderer/assets/{RZSVICHU-DQMvf7FW.js → RZSVICHU-BSj4YQaY.js} +1 -1
- package/dist/renderer/assets/{UEXXS2NB-pjQFygyK.js → UEXXS2NB-CsxAjwQ4.js} +1 -1
- package/dist/renderer/assets/{UHTQJXKL-BCjkwDC-.js → UHTQJXKL-g4xFs4o0.js} +5 -5
- package/dist/renderer/assets/{URA2L2QI-DOqGA-7p.js → URA2L2QI-CaQCavyx.js} +1 -1
- package/dist/renderer/assets/{UXCHDUKG-P-ssqnp6.js → UXCHDUKG-SdHIAded.js} +5 -5
- package/dist/renderer/assets/{VKNV3BUX-S-I5Vkej.js → VKNV3BUX-CAufMpR3.js} +6 -6
- package/dist/renderer/assets/{VMV7XPHP-CBEFwbRj.js → VMV7XPHP-BTz-DDJE.js} +1 -1
- package/dist/renderer/assets/{WEVWDWVA-NETs7zG0.js → WEVWDWVA-BTzIOcFk.js} +1 -1
- package/dist/renderer/assets/{XRRJ35LF-ChlUj7II.js → XRRJ35LF-CqWXQoQc.js} +4 -4
- package/dist/renderer/assets/{YFKBLVVN-a23ZlMUZ.js → YFKBLVVN-CobClKiQ.js} +4 -4
- package/dist/renderer/assets/{YHRE5QGZ-B4WFiwFa.js → YHRE5QGZ-DJVf9-VA.js} +7 -7
- package/dist/renderer/assets/{ZF3OVT4B-D99LRppp.js → ZF3OVT4B-4h2uC2Nf.js} +3 -3
- package/dist/renderer/assets/{index-DNKeYHeb.js → index-1hwQGecd.js} +1 -1
- package/dist/renderer/assets/{index-BUMCX36l.js → index-3SmJ-5Dc.js} +1 -1
- package/dist/renderer/assets/{index-CX3eLmnK.js → index-B0zpPg3h.js} +1 -1
- package/dist/renderer/assets/{index-DurJ4oOc.js → index-B6uVUc9e.js} +3 -3
- package/dist/renderer/assets/{index-j9IOhwim.js → index-BHqRO3CW.js} +1 -1
- package/dist/renderer/assets/{index-B-sTajw0.js → index-BZK9uVRR.js} +1 -1
- package/dist/renderer/assets/{index-9wJDFDHb.js → index-BqpGj9MR.js} +1 -1
- package/dist/renderer/assets/{index-Xe00ZDVa.css → index-BwFsNvvN.css} +136 -21
- package/dist/renderer/assets/{index-CmCG8RWM.js → index-CBD7Wlx8.js} +1 -1
- package/dist/renderer/assets/{index-CBsqa7KF.js → index-CpAWIQHT.js} +1 -1
- package/dist/renderer/assets/{index-WU2bjQIt.js → index-D6i0AdBR.js} +1 -1
- package/dist/renderer/assets/{index-CizbQ4B2.js → index-D9fcCIeQ.js} +1 -1
- package/dist/renderer/assets/{index-DShnMzLx.js → index-DAwDMFVz.js} +702 -969
- package/dist/renderer/assets/{index-BXMm6of_.js → index-De7RE4Mo.js} +1 -1
- package/dist/renderer/assets/{index-BQRkI4XZ.js → index-DgC9JAzE.js} +3 -3
- package/dist/renderer/assets/{index-Cl38Mcu3.js → index-DkTSflhI.js} +1 -1
- package/dist/renderer/assets/{index-C5S7E_iS.js → index-DsYLJ8It.js} +3 -3
- package/dist/renderer/assets/{index-B3xEpmeL.js → index-Gr-12Gzq.js} +1 -1
- package/dist/renderer/assets/{index-Cr5af8vL.js → index-OOnbRmFx.js} +1 -1
- package/dist/renderer/assets/{index-CFd49PzX.js → index-_-G3H01P.js} +1 -1
- package/dist/renderer/assets/{index-B7a6ecSB.js → index-lPCBuTEj.js} +1 -1
- package/dist/renderer/assets/{index-BgaTyTt4.js → index-qlWwPzMe.js} +1 -1
- package/dist/renderer/assets/{lazy-C5_LqPMG.js → lazy-DReExUTA.js} +3 -3
- package/dist/renderer/assets/{web-C4L7HQnE.js → web-DErzcmb7.js} +2 -2
- package/dist/renderer/assets/{web-ClAYTlQS.js → web-DocK2vhG.js} +1 -1
- package/dist/renderer/assets/{web-DJNzGtPV.js → web-h4mYLq72.js} +1 -1
- package/dist/renderer/index.html +2 -2
- package/package.json +9 -3
- package/themes/contract.json +1 -1
|
@@ -4861,9 +4861,9 @@ class ScrollTarget {
|
|
|
4861
4861
|
const scrollIntoView = /* @__PURE__ */ StateEffect.define({ map: (t2, ch) => t2.map(ch) });
|
|
4862
4862
|
const setEditContextFormatting = /* @__PURE__ */ StateEffect.define();
|
|
4863
4863
|
function logException(state, exception, context) {
|
|
4864
|
-
let
|
|
4865
|
-
if (
|
|
4866
|
-
|
|
4864
|
+
let handler2 = state.facet(exceptionSink);
|
|
4865
|
+
if (handler2.length)
|
|
4866
|
+
handler2[0](exception);
|
|
4867
4867
|
else if (window.onerror && window.onerror(String(exception), context, void 0, void 0, exception)) ;
|
|
4868
4868
|
else if (context)
|
|
4869
4869
|
console.error(context + ":", exception);
|
|
@@ -6867,9 +6867,9 @@ class DocView {
|
|
|
6867
6867
|
this.view.scrollDOM.scrollLeft = target.xMargin;
|
|
6868
6868
|
return;
|
|
6869
6869
|
}
|
|
6870
|
-
for (let
|
|
6870
|
+
for (let handler2 of this.view.state.facet(scrollHandler)) {
|
|
6871
6871
|
try {
|
|
6872
|
-
if (
|
|
6872
|
+
if (handler2(this.view, target.range, target))
|
|
6873
6873
|
return true;
|
|
6874
6874
|
} catch (e) {
|
|
6875
6875
|
logException(this.view.state, e, "scroll handler");
|
|
@@ -7872,10 +7872,10 @@ class InputState {
|
|
|
7872
7872
|
if (handlers2) {
|
|
7873
7873
|
for (let observer of handlers2.observers)
|
|
7874
7874
|
observer(this.view, event);
|
|
7875
|
-
for (let
|
|
7875
|
+
for (let handler2 of handlers2.handlers) {
|
|
7876
7876
|
if (event.defaultPrevented)
|
|
7877
7877
|
break;
|
|
7878
|
-
if (
|
|
7878
|
+
if (handler2(this.view, event)) {
|
|
7879
7879
|
event.preventDefault();
|
|
7880
7880
|
break;
|
|
7881
7881
|
}
|
|
@@ -7970,10 +7970,10 @@ function iosVirtualKeyboardOpen(win) {
|
|
|
7970
7970
|
return false;
|
|
7971
7971
|
return win.visualViewport.height * win.visualViewport.scale / win.document.documentElement.clientHeight < 0.85;
|
|
7972
7972
|
}
|
|
7973
|
-
function bindHandler(plugin,
|
|
7973
|
+
function bindHandler(plugin, handler2) {
|
|
7974
7974
|
return (view, event) => {
|
|
7975
7975
|
try {
|
|
7976
|
-
return
|
|
7976
|
+
return handler2.call(plugin, event, view);
|
|
7977
7977
|
} catch (e) {
|
|
7978
7978
|
logException(view.state, e);
|
|
7979
7979
|
}
|
|
@@ -18664,15 +18664,16 @@ function getImplicitDefault(type) {
|
|
|
18664
18664
|
}
|
|
18665
18665
|
}
|
|
18666
18666
|
function getDefaultValue(schema) {
|
|
18667
|
-
if (schema.default !== void 0) {
|
|
18667
|
+
if (Object.prototype.hasOwnProperty.call(schema, "default") && schema.default !== void 0) {
|
|
18668
18668
|
return schema.default;
|
|
18669
18669
|
}
|
|
18670
18670
|
var type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
|
|
18671
18671
|
return getImplicitDefault(type);
|
|
18672
18672
|
}
|
|
18673
18673
|
function applySetting(target, prop, options2, schema) {
|
|
18674
|
-
var optionValue = options2[prop];
|
|
18675
|
-
|
|
18674
|
+
var optionValue = Object.prototype.hasOwnProperty.call(options2, prop) ? options2[prop] : void 0;
|
|
18675
|
+
var processor = Object.prototype.hasOwnProperty.call(schema, "processor") ? schema.processor : void 0;
|
|
18676
|
+
target[prop] = optionValue !== void 0 ? processor ? processor(optionValue) : optionValue : getDefaultValue(schema);
|
|
18676
18677
|
}
|
|
18677
18678
|
class Settings {
|
|
18678
18679
|
constructor(options2) {
|
|
@@ -18701,54 +18702,6 @@ class Settings {
|
|
|
18701
18702
|
}
|
|
18702
18703
|
}
|
|
18703
18704
|
}
|
|
18704
|
-
/**
|
|
18705
|
-
* Report nonstrict (non-LaTeX-compatible) input.
|
|
18706
|
-
* Can safely not be called if `this.strict` is false in JavaScript.
|
|
18707
|
-
*/
|
|
18708
|
-
reportNonstrict(errorCode, errorMsg, token) {
|
|
18709
|
-
var strict = this.strict;
|
|
18710
|
-
if (typeof strict === "function") {
|
|
18711
|
-
strict = strict(errorCode, errorMsg, token);
|
|
18712
|
-
}
|
|
18713
|
-
if (!strict || strict === "ignore") {
|
|
18714
|
-
return;
|
|
18715
|
-
} else if (strict === true || strict === "error") {
|
|
18716
|
-
throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token);
|
|
18717
|
-
} else if (strict === "warn") {
|
|
18718
|
-
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
|
|
18719
|
-
} else {
|
|
18720
|
-
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
|
|
18721
|
-
}
|
|
18722
|
-
}
|
|
18723
|
-
/**
|
|
18724
|
-
* Check whether to apply strict (LaTeX-adhering) behavior for unusual
|
|
18725
|
-
* input (like `\\`). Unlike `nonstrict`, will not throw an error;
|
|
18726
|
-
* instead, "error" translates to a return value of `true`, while "ignore"
|
|
18727
|
-
* translates to a return value of `false`. May still print a warning:
|
|
18728
|
-
* "warn" prints a warning and returns `false`.
|
|
18729
|
-
* This is for the second category of `errorCode`s listed in the README.
|
|
18730
|
-
*/
|
|
18731
|
-
useStrictBehavior(errorCode, errorMsg, token) {
|
|
18732
|
-
var strict = this.strict;
|
|
18733
|
-
if (typeof strict === "function") {
|
|
18734
|
-
try {
|
|
18735
|
-
strict = strict(errorCode, errorMsg, token);
|
|
18736
|
-
} catch (error) {
|
|
18737
|
-
strict = "error";
|
|
18738
|
-
}
|
|
18739
|
-
}
|
|
18740
|
-
if (!strict || strict === "ignore") {
|
|
18741
|
-
return false;
|
|
18742
|
-
} else if (strict === true || strict === "error") {
|
|
18743
|
-
return true;
|
|
18744
|
-
} else if (strict === "warn") {
|
|
18745
|
-
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
|
|
18746
|
-
return false;
|
|
18747
|
-
} else {
|
|
18748
|
-
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
|
|
18749
|
-
return false;
|
|
18750
|
-
}
|
|
18751
|
-
}
|
|
18752
18705
|
/**
|
|
18753
18706
|
* Check whether to test potentially dangerous input, and return
|
|
18754
18707
|
* `true` (trusted) or `false` (untrusted). The sole argument `context`
|
|
@@ -21851,10 +21804,8 @@ function getGlobalMetrics(size) {
|
|
|
21851
21804
|
var metrics = fontMetricsBySizeIndex[sizeIndex] = {
|
|
21852
21805
|
cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18
|
|
21853
21806
|
};
|
|
21854
|
-
for (var key
|
|
21855
|
-
|
|
21856
|
-
metrics[key] = sigmasAndXis[key][sizeIndex];
|
|
21857
|
-
}
|
|
21807
|
+
for (var key of Object.keys(sigmasAndXis)) {
|
|
21808
|
+
metrics[key] = sigmasAndXis[key][sizeIndex];
|
|
21858
21809
|
}
|
|
21859
21810
|
}
|
|
21860
21811
|
return fontMetricsBySizeIndex[sizeIndex];
|
|
@@ -22717,6 +22668,43 @@ var wideCharacterFont = (wideChar2) => {
|
|
|
22717
22668
|
throw new ParseError("Unsupported character: " + wideChar2);
|
|
22718
22669
|
}
|
|
22719
22670
|
};
|
|
22671
|
+
function handleStrict(params) {
|
|
22672
|
+
var strict = params.strict, errorCode = params.errorCode, errorMsg = params.errorMsg, token = params.token, report = params.report;
|
|
22673
|
+
var behavior = strict;
|
|
22674
|
+
if (typeof strict === "function") {
|
|
22675
|
+
if (report) {
|
|
22676
|
+
behavior = strict(errorCode, errorMsg, token);
|
|
22677
|
+
} else {
|
|
22678
|
+
try {
|
|
22679
|
+
behavior = strict(errorCode, errorMsg, token);
|
|
22680
|
+
} catch (error) {
|
|
22681
|
+
behavior = "error";
|
|
22682
|
+
}
|
|
22683
|
+
}
|
|
22684
|
+
}
|
|
22685
|
+
switch (behavior) {
|
|
22686
|
+
case true:
|
|
22687
|
+
case "error":
|
|
22688
|
+
if (report) {
|
|
22689
|
+
throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token);
|
|
22690
|
+
} else {
|
|
22691
|
+
return true;
|
|
22692
|
+
}
|
|
22693
|
+
case false:
|
|
22694
|
+
case "ignore":
|
|
22695
|
+
if (!report) {
|
|
22696
|
+
return false;
|
|
22697
|
+
}
|
|
22698
|
+
break;
|
|
22699
|
+
case "warn":
|
|
22700
|
+
default:
|
|
22701
|
+
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
|
|
22702
|
+
if (!report) {
|
|
22703
|
+
return false;
|
|
22704
|
+
}
|
|
22705
|
+
break;
|
|
22706
|
+
}
|
|
22707
|
+
}
|
|
22720
22708
|
var lookupSymbol = function lookupSymbol2(value, fontName, mode) {
|
|
22721
22709
|
if (symbols[mode][value]) {
|
|
22722
22710
|
var replacement = symbols[mode][value].replace;
|
|
@@ -22741,18 +22729,21 @@ var makeSymbol = function makeSymbol2(value, fontName, mode, options2, classes)
|
|
|
22741
22729
|
}
|
|
22742
22730
|
symbolNode = new SymbolNode(value, metrics.height, metrics.depth, italic2, metrics.skew, metrics.width, classes);
|
|
22743
22731
|
} else {
|
|
22744
|
-
|
|
22732
|
+
handleStrict({
|
|
22733
|
+
strict: options2.strict,
|
|
22734
|
+
errorCode: "symbolNotInFont",
|
|
22735
|
+
errorMsg: "No character metrics for '" + value + "' in style '" + fontName + "' and mode '" + mode + "'",
|
|
22736
|
+
report: true
|
|
22737
|
+
});
|
|
22745
22738
|
symbolNode = new SymbolNode(value, 0, 0, 0, 0, 0, classes);
|
|
22746
22739
|
}
|
|
22747
|
-
|
|
22748
|
-
|
|
22749
|
-
|
|
22750
|
-
|
|
22751
|
-
|
|
22752
|
-
|
|
22753
|
-
|
|
22754
|
-
symbolNode.style.color = color2;
|
|
22755
|
-
}
|
|
22740
|
+
symbolNode.maxFontSize = options2.sizeMultiplier;
|
|
22741
|
+
if (options2.style.isTight()) {
|
|
22742
|
+
symbolNode.classes.push("mtight");
|
|
22743
|
+
}
|
|
22744
|
+
var color2 = options2.getColor();
|
|
22745
|
+
if (color2) {
|
|
22746
|
+
symbolNode.style.color = color2;
|
|
22756
22747
|
}
|
|
22757
22748
|
return symbolNode;
|
|
22758
22749
|
};
|
|
@@ -22781,16 +22772,12 @@ var boldSymbol = function boldSymbol2(value, mode, type) {
|
|
|
22781
22772
|
};
|
|
22782
22773
|
}
|
|
22783
22774
|
};
|
|
22784
|
-
var makeOrd = function makeOrd2(group, options2
|
|
22775
|
+
var makeOrd = function makeOrd2(group, options2) {
|
|
22776
|
+
var type = group.type === "mathord" ? "mathord" : "textord";
|
|
22785
22777
|
var mode = group.mode;
|
|
22786
22778
|
var text2 = group.text;
|
|
22787
22779
|
var classes = ["mord"];
|
|
22788
|
-
var
|
|
22789
|
-
font,
|
|
22790
|
-
fontFamily,
|
|
22791
|
-
fontWeight,
|
|
22792
|
-
fontShape
|
|
22793
|
-
} = options2;
|
|
22780
|
+
var font = options2.font, fontFamily = options2.fontFamily, fontWeight = options2.fontWeight, fontShape = options2.fontShape;
|
|
22794
22781
|
var useFont = mode === "math" || mode === "text" && !!font;
|
|
22795
22782
|
var fontOrFamily = useFont ? font : fontFamily;
|
|
22796
22783
|
var wideFontName = "";
|
|
@@ -22818,7 +22805,7 @@ var makeOrd = function makeOrd2(group, options2, type) {
|
|
|
22818
22805
|
}
|
|
22819
22806
|
if (lookupSymbol(text2, fontName, mode).metrics) {
|
|
22820
22807
|
return makeSymbol(text2, fontName, mode, options2, classes.concat(fontClasses));
|
|
22821
|
-
} else if (
|
|
22808
|
+
} else if (Object.prototype.hasOwnProperty.call(ligatures, text2) && fontName.slice(0, 10) === "Typewriter") {
|
|
22822
22809
|
var parts = [];
|
|
22823
22810
|
for (var i = 0; i < text2.length; i++) {
|
|
22824
22811
|
parts.push(makeSymbol(text2[i], fontName, mode, options2, classes.concat(fontClasses)));
|
|
@@ -22980,10 +22967,7 @@ var getVListChildrenAndDepth = function getVListChildrenAndDepth2(params) {
|
|
|
22980
22967
|
};
|
|
22981
22968
|
};
|
|
22982
22969
|
var makeVList = function makeVList2(params, options2) {
|
|
22983
|
-
var
|
|
22984
|
-
children,
|
|
22985
|
-
depth
|
|
22986
|
-
} = getVListChildrenAndDepth(params);
|
|
22970
|
+
var _getVListChildrenAndD = getVListChildrenAndDepth(params), children = _getVListChildrenAndD.children, depth = _getVListChildrenAndD.depth;
|
|
22987
22971
|
var pstrutSize = 0;
|
|
22988
22972
|
for (var i = 0; i < children.length; i++) {
|
|
22989
22973
|
var child = children[i];
|
|
@@ -23143,7 +23127,7 @@ var svgData = {
|
|
|
23143
23127
|
oiiintSize2: ["oiiintSize2", 1.98, 0.659]
|
|
23144
23128
|
};
|
|
23145
23129
|
var staticSvg = function staticSvg2(value, options2) {
|
|
23146
|
-
var [pathName, width, height
|
|
23130
|
+
var _svgData$value = svgData[value], pathName = _svgData$value[0], width = _svgData$value[1], height = _svgData$value[2];
|
|
23147
23131
|
var path2 = new PathNode(pathName);
|
|
23148
23132
|
var svgNode = new SvgNode([path2], {
|
|
23149
23133
|
"width": makeEm(width),
|
|
@@ -23153,7 +23137,7 @@ var staticSvg = function staticSvg2(value, options2) {
|
|
|
23153
23137
|
"viewBox": "0 0 " + 1e3 * width + " " + 1e3 * height,
|
|
23154
23138
|
"preserveAspectRatio": "xMinYMin"
|
|
23155
23139
|
});
|
|
23156
|
-
var span = makeSvgSpan(["overlay"], [svgNode], options2);
|
|
23140
|
+
var span = makeSvgSpan(["katex-overlay"], [svgNode], options2);
|
|
23157
23141
|
span.height = height;
|
|
23158
23142
|
span.style.height = makeEm(height);
|
|
23159
23143
|
span.style.width = makeEm(width);
|
|
@@ -23244,27 +23228,8 @@ var tightSpacings = {
|
|
|
23244
23228
|
var _functions = {};
|
|
23245
23229
|
var _htmlGroupBuilders = {};
|
|
23246
23230
|
var _mathmlGroupBuilders = {};
|
|
23247
|
-
function defineFunction(
|
|
23248
|
-
var
|
|
23249
|
-
type,
|
|
23250
|
-
names,
|
|
23251
|
-
props,
|
|
23252
|
-
handler,
|
|
23253
|
-
htmlBuilder: htmlBuilder3,
|
|
23254
|
-
mathmlBuilder: mathmlBuilder3
|
|
23255
|
-
} = _ref;
|
|
23256
|
-
var data2 = {
|
|
23257
|
-
type,
|
|
23258
|
-
numArgs: props.numArgs,
|
|
23259
|
-
argTypes: props.argTypes,
|
|
23260
|
-
allowedInArgument: !!props.allowedInArgument,
|
|
23261
|
-
allowedInText: !!props.allowedInText,
|
|
23262
|
-
allowedInMath: props.allowedInMath === void 0 ? true : props.allowedInMath,
|
|
23263
|
-
numOptionalArgs: props.numOptionalArgs || 0,
|
|
23264
|
-
infix: !!props.infix,
|
|
23265
|
-
primitive: !!props.primitive,
|
|
23266
|
-
handler
|
|
23267
|
-
};
|
|
23231
|
+
function defineFunction(data2) {
|
|
23232
|
+
var type = data2.type, names = data2.names, htmlBuilder3 = data2.htmlBuilder, mathmlBuilder3 = data2.mathmlBuilder;
|
|
23268
23233
|
for (var i = 0; i < names.length; ++i) {
|
|
23269
23234
|
_functions[names[i]] = data2;
|
|
23270
23235
|
}
|
|
@@ -23277,24 +23242,14 @@ function defineFunction(_ref) {
|
|
|
23277
23242
|
}
|
|
23278
23243
|
}
|
|
23279
23244
|
}
|
|
23280
|
-
function defineFunctionBuilders(
|
|
23281
|
-
var
|
|
23282
|
-
|
|
23283
|
-
|
|
23284
|
-
|
|
23285
|
-
|
|
23286
|
-
|
|
23287
|
-
|
|
23288
|
-
names: [],
|
|
23289
|
-
props: {
|
|
23290
|
-
numArgs: 0
|
|
23291
|
-
},
|
|
23292
|
-
handler() {
|
|
23293
|
-
throw new Error("Should never be called.");
|
|
23294
|
-
},
|
|
23295
|
-
htmlBuilder: htmlBuilder3,
|
|
23296
|
-
mathmlBuilder: mathmlBuilder3
|
|
23297
|
-
});
|
|
23245
|
+
function defineFunctionBuilders(_ref) {
|
|
23246
|
+
var type = _ref.type, htmlBuilder3 = _ref.htmlBuilder, mathmlBuilder3 = _ref.mathmlBuilder;
|
|
23247
|
+
if (htmlBuilder3) {
|
|
23248
|
+
_htmlGroupBuilders[type] = htmlBuilder3;
|
|
23249
|
+
}
|
|
23250
|
+
if (mathmlBuilder3) {
|
|
23251
|
+
_mathmlGroupBuilders[type] = mathmlBuilder3;
|
|
23252
|
+
}
|
|
23298
23253
|
}
|
|
23299
23254
|
var normalizeArgument = function normalizeArgument2(arg) {
|
|
23300
23255
|
return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg;
|
|
@@ -23400,7 +23355,7 @@ var _traverseNonSpaceNodes = function traverseNonSpaceNodes(nodes, callback, pre
|
|
|
23400
23355
|
}
|
|
23401
23356
|
if (nonspace) {
|
|
23402
23357
|
prev.node = node;
|
|
23403
|
-
} else if (isRoot && node.hasClass("newline")) {
|
|
23358
|
+
} else if (isRoot && node.hasClass("katex-newline")) {
|
|
23404
23359
|
prev.node = makeSpan(["leftmost"]);
|
|
23405
23360
|
}
|
|
23406
23361
|
prev.insertAfter = /* @__PURE__ */ ((index2) => (n) => {
|
|
@@ -23464,8 +23419,8 @@ var buildGroup$1 = function buildGroup(group, options2, baseOptions) {
|
|
|
23464
23419
|
}
|
|
23465
23420
|
};
|
|
23466
23421
|
function buildHTMLUnbreakable(children, options2) {
|
|
23467
|
-
var body = makeSpan(["base"], children, options2);
|
|
23468
|
-
var strut = makeSpan(["strut"]);
|
|
23422
|
+
var body = makeSpan(["katex-base"], children, options2);
|
|
23423
|
+
var strut = makeSpan(["katex-strut"]);
|
|
23469
23424
|
strut.style.height = makeEm(body.height + body.depth);
|
|
23470
23425
|
if (body.depth) {
|
|
23471
23426
|
strut.style.verticalAlign = makeEm(-body.depth);
|
|
@@ -23481,7 +23436,7 @@ function buildHTML(tree, options2) {
|
|
|
23481
23436
|
}
|
|
23482
23437
|
var expression = buildExpression$1(tree, options2, "root");
|
|
23483
23438
|
var eqnNum;
|
|
23484
|
-
if (expression.length === 2 && expression[1].hasClass("tag")) {
|
|
23439
|
+
if (expression.length === 2 && expression[1].hasClass("katex-tag")) {
|
|
23485
23440
|
eqnNum = expression.pop();
|
|
23486
23441
|
}
|
|
23487
23442
|
var children = [];
|
|
@@ -23490,7 +23445,7 @@ function buildHTML(tree, options2) {
|
|
|
23490
23445
|
parts.push(expression[i]);
|
|
23491
23446
|
if (expression[i].hasClass("mbin") || expression[i].hasClass("mrel") || expression[i].hasClass("allowbreak")) {
|
|
23492
23447
|
var nobreak = false;
|
|
23493
|
-
while (i < expression.length - 1 && expression[i + 1].hasClass("mspace") && !expression[i + 1].hasClass("newline")) {
|
|
23448
|
+
while (i < expression.length - 1 && expression[i + 1].hasClass("mspace") && !expression[i + 1].hasClass("katex-newline")) {
|
|
23494
23449
|
i++;
|
|
23495
23450
|
parts.push(expression[i]);
|
|
23496
23451
|
if (expression[i].hasClass("nobreak")) {
|
|
@@ -23501,7 +23456,7 @@ function buildHTML(tree, options2) {
|
|
|
23501
23456
|
children.push(buildHTMLUnbreakable(parts, options2));
|
|
23502
23457
|
parts = [];
|
|
23503
23458
|
}
|
|
23504
|
-
} else if (expression[i].hasClass("newline")) {
|
|
23459
|
+
} else if (expression[i].hasClass("katex-newline")) {
|
|
23505
23460
|
parts.pop();
|
|
23506
23461
|
if (parts.length > 0) {
|
|
23507
23462
|
children.push(buildHTMLUnbreakable(parts, options2));
|
|
@@ -23516,7 +23471,7 @@ function buildHTML(tree, options2) {
|
|
|
23516
23471
|
var tagChild;
|
|
23517
23472
|
if (tag) {
|
|
23518
23473
|
tagChild = buildHTMLUnbreakable(buildExpression$1(tag, options2, true), options2);
|
|
23519
|
-
tagChild.classes = ["tag"];
|
|
23474
|
+
tagChild.classes = ["katex-tag"];
|
|
23520
23475
|
children.push(tagChild);
|
|
23521
23476
|
} else if (eqnNum) {
|
|
23522
23477
|
children.push(eqnNum);
|
|
@@ -23564,10 +23519,10 @@ class MathNode {
|
|
|
23564
23519
|
*/
|
|
23565
23520
|
toNode() {
|
|
23566
23521
|
var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
|
|
23567
|
-
for (var
|
|
23568
|
-
|
|
23569
|
-
|
|
23570
|
-
|
|
23522
|
+
for (var _ref2 of Object.entries(this.attributes)) {
|
|
23523
|
+
var attr = _ref2[0];
|
|
23524
|
+
var value = _ref2[1];
|
|
23525
|
+
node.setAttribute(attr, value);
|
|
23571
23526
|
}
|
|
23572
23527
|
if (this.classes.length > 0) {
|
|
23573
23528
|
node.className = createClass(this.classes);
|
|
@@ -23590,12 +23545,12 @@ class MathNode {
|
|
|
23590
23545
|
*/
|
|
23591
23546
|
toMarkup() {
|
|
23592
23547
|
var markup = "<" + this.type;
|
|
23593
|
-
for (var
|
|
23594
|
-
|
|
23595
|
-
|
|
23596
|
-
|
|
23597
|
-
|
|
23598
|
-
|
|
23548
|
+
for (var _ref4 of Object.entries(this.attributes)) {
|
|
23549
|
+
var attr = _ref4[0];
|
|
23550
|
+
var value = _ref4[1];
|
|
23551
|
+
markup += " " + attr + '="';
|
|
23552
|
+
markup += escape$1(value);
|
|
23553
|
+
markup += '"';
|
|
23599
23554
|
}
|
|
23600
23555
|
if (this.classes.length > 0) {
|
|
23601
23556
|
markup += ' class ="' + escape$1(createClass(this.classes)) + '"';
|
|
@@ -23704,7 +23659,8 @@ class SpaceNode {
|
|
|
23704
23659
|
var noVariantSymbols = /* @__PURE__ */ new Set(["\\imath", "\\jmath"]);
|
|
23705
23660
|
var rowLikeTypes = /* @__PURE__ */ new Set(["mrow", "mtable"]);
|
|
23706
23661
|
var makeText = function makeText2(text2, mode, options2) {
|
|
23707
|
-
|
|
23662
|
+
var _options$fontFamily, _options$font;
|
|
23663
|
+
if (symbols[mode][text2] && symbols[mode][text2].replace && text2.charCodeAt(0) !== 55349 && !(Object.prototype.hasOwnProperty.call(ligatures, text2) && ((options2 == null || (_options$fontFamily = options2.fontFamily) == null ? void 0 : _options$fontFamily.slice(4, 6)) === "tt" || (options2 == null || (_options$font = options2.font) == null ? void 0 : _options$font.slice(4, 6)) === "tt"))) {
|
|
23708
23664
|
text2 = symbols[mode][text2].replace;
|
|
23709
23665
|
}
|
|
23710
23666
|
return new TextNode2(text2);
|
|
@@ -23928,6 +23884,7 @@ class Options {
|
|
|
23928
23884
|
this.maxSize = void 0;
|
|
23929
23885
|
this.minRuleThickness = void 0;
|
|
23930
23886
|
this._fontMetrics = void 0;
|
|
23887
|
+
this.strict = void 0;
|
|
23931
23888
|
this.style = data2.style;
|
|
23932
23889
|
this.color = data2.color;
|
|
23933
23890
|
this.size = data2.size || Options.BASESIZE;
|
|
@@ -23940,6 +23897,7 @@ class Options {
|
|
|
23940
23897
|
this.sizeMultiplier = sizeMultipliers[this.size - 1];
|
|
23941
23898
|
this.maxSize = data2.maxSize;
|
|
23942
23899
|
this.minRuleThickness = data2.minRuleThickness;
|
|
23900
|
+
this.strict = data2.strict;
|
|
23943
23901
|
this._fontMetrics = void 0;
|
|
23944
23902
|
}
|
|
23945
23903
|
/**
|
|
@@ -23958,7 +23916,8 @@ class Options {
|
|
|
23958
23916
|
fontWeight: this.fontWeight,
|
|
23959
23917
|
fontShape: this.fontShape,
|
|
23960
23918
|
maxSize: this.maxSize,
|
|
23961
|
-
minRuleThickness: this.minRuleThickness
|
|
23919
|
+
minRuleThickness: this.minRuleThickness,
|
|
23920
|
+
strict: this.strict
|
|
23962
23921
|
};
|
|
23963
23922
|
Object.assign(data2, extension);
|
|
23964
23923
|
return new Options(data2);
|
|
@@ -24097,7 +24056,7 @@ class Options {
|
|
|
24097
24056
|
*/
|
|
24098
24057
|
sizingClasses(oldOptions) {
|
|
24099
24058
|
if (oldOptions.size !== this.size) {
|
|
24100
|
-
return ["sizing", "reset-size" + oldOptions.size, "size" + this.size];
|
|
24059
|
+
return ["katex-sizing", "reset-size" + oldOptions.size, "size" + this.size];
|
|
24101
24060
|
} else {
|
|
24102
24061
|
return [];
|
|
24103
24062
|
}
|
|
@@ -24108,7 +24067,7 @@ class Options {
|
|
|
24108
24067
|
*/
|
|
24109
24068
|
baseSizingClasses() {
|
|
24110
24069
|
if (this.size !== Options.BASESIZE) {
|
|
24111
|
-
return ["sizing", "reset-size" + this.size, "size" + Options.BASESIZE];
|
|
24070
|
+
return ["katex-sizing", "reset-size" + this.size, "size" + Options.BASESIZE];
|
|
24112
24071
|
} else {
|
|
24113
24072
|
return [];
|
|
24114
24073
|
}
|
|
@@ -24134,13 +24093,12 @@ class Options {
|
|
|
24134
24093
|
}
|
|
24135
24094
|
}
|
|
24136
24095
|
Options.BASESIZE = 6;
|
|
24137
|
-
var optionsFromSettings =
|
|
24138
|
-
|
|
24139
|
-
|
|
24140
|
-
|
|
24141
|
-
|
|
24142
|
-
|
|
24143
|
-
};
|
|
24096
|
+
var optionsFromSettings = (settings) => new Options({
|
|
24097
|
+
style: settings.displayMode ? Style$1.DISPLAY : Style$1.TEXT,
|
|
24098
|
+
maxSize: settings.maxSize,
|
|
24099
|
+
minRuleThickness: settings.minRuleThickness,
|
|
24100
|
+
strict: settings.strict
|
|
24101
|
+
});
|
|
24144
24102
|
var displayWrap = function displayWrap2(node, settings) {
|
|
24145
24103
|
if (settings.displayMode) {
|
|
24146
24104
|
var classes = ["katex-display"];
|
|
@@ -24169,7 +24127,7 @@ var buildTree = function buildTree2(tree, expression, settings) {
|
|
|
24169
24127
|
}
|
|
24170
24128
|
return displayWrap(katexNode, settings);
|
|
24171
24129
|
};
|
|
24172
|
-
var buildHTMLTree = function buildHTMLTree2(tree,
|
|
24130
|
+
var buildHTMLTree = function buildHTMLTree2(tree, settings) {
|
|
24173
24131
|
var options2 = optionsFromSettings(settings);
|
|
24174
24132
|
var htmlNode = buildHTML(tree, options2);
|
|
24175
24133
|
var katexNode = makeSpan(["katex"], [htmlNode]);
|
|
@@ -24332,7 +24290,7 @@ var stretchySvg = function stretchySvg2(group, options2) {
|
|
|
24332
24290
|
if (!data2) {
|
|
24333
24291
|
throw new Error('No SVG data for "' + label + '".');
|
|
24334
24292
|
}
|
|
24335
|
-
var [
|
|
24293
|
+
var paths = data2[0], _minWidth = data2[1], _viewBoxHeight = data2[2];
|
|
24336
24294
|
var _height2 = _viewBoxHeight / 1e3;
|
|
24337
24295
|
var numSvgChildren = paths.length;
|
|
24338
24296
|
var widthClasses;
|
|
@@ -24373,17 +24331,13 @@ var stretchySvg = function stretchySvg2(group, options2) {
|
|
|
24373
24331
|
}
|
|
24374
24332
|
}
|
|
24375
24333
|
return {
|
|
24376
|
-
span: makeSpan(["stretchy"], spans, options2),
|
|
24334
|
+
span: makeSpan(["katex-stretchy"], spans, options2),
|
|
24377
24335
|
minWidth: _minWidth,
|
|
24378
24336
|
height: _height2
|
|
24379
24337
|
};
|
|
24380
24338
|
}
|
|
24381
24339
|
}
|
|
24382
|
-
var
|
|
24383
|
-
span,
|
|
24384
|
-
minWidth,
|
|
24385
|
-
height
|
|
24386
|
-
} = buildSvgSpan_();
|
|
24340
|
+
var _buildSvgSpan_ = buildSvgSpan_(), span = _buildSvgSpan_.span, minWidth = _buildSvgSpan_.minWidth, height = _buildSvgSpan_.height;
|
|
24387
24341
|
span.height = height;
|
|
24388
24342
|
span.style.height = makeEm(height);
|
|
24389
24343
|
if (minWidth > 0) {
|
|
@@ -24395,7 +24349,7 @@ var stretchyEnclose = function stretchyEnclose2(inner2, label, topPad, bottomPad
|
|
|
24395
24349
|
var img;
|
|
24396
24350
|
var totalHeight = inner2.height + inner2.depth + topPad + bottomPad;
|
|
24397
24351
|
if (/fbox|color|angl/.test(label)) {
|
|
24398
|
-
img = makeSpan(["stretchy", label], [], options2);
|
|
24352
|
+
img = makeSpan(["katex-stretchy", label], [], options2);
|
|
24399
24353
|
if (label === "fbox") {
|
|
24400
24354
|
var color2 = options2.color && options2.getColor();
|
|
24401
24355
|
if (color2) {
|
|
@@ -24432,23 +24386,12 @@ var stretchyEnclose = function stretchyEnclose2(inner2, label, topPad, bottomPad
|
|
|
24432
24386
|
img.style.height = makeEm(totalHeight);
|
|
24433
24387
|
return img;
|
|
24434
24388
|
};
|
|
24435
|
-
var
|
|
24436
|
-
|
|
24437
|
-
|
|
24438
|
-
|
|
24439
|
-
"open": 1,
|
|
24440
|
-
"punct": 1,
|
|
24441
|
-
"rel": 1
|
|
24442
|
-
};
|
|
24443
|
-
var NON_ATOMS = {
|
|
24444
|
-
"accent-token": 1,
|
|
24445
|
-
"mathord": 1,
|
|
24446
|
-
"op-token": 1,
|
|
24447
|
-
"spacing": 1,
|
|
24448
|
-
"textord": 1
|
|
24449
|
-
};
|
|
24389
|
+
var atomList = ["bin", "close", "inner", "open", "punct", "rel"];
|
|
24390
|
+
var nonAtomList = ["accent-token", "mathord", "op-token", "spacing", "textord"];
|
|
24391
|
+
var Atoms = new Set(atomList);
|
|
24392
|
+
var NonAtoms = new Set(nonAtomList);
|
|
24450
24393
|
function isAtom(value) {
|
|
24451
|
-
return value
|
|
24394
|
+
return Atoms.has(value);
|
|
24452
24395
|
}
|
|
24453
24396
|
function assertNodeType(node, type) {
|
|
24454
24397
|
if (!node || node.type !== type) {
|
|
@@ -24464,11 +24407,24 @@ function assertSymbolNodeType(node) {
|
|
|
24464
24407
|
return typedNode;
|
|
24465
24408
|
}
|
|
24466
24409
|
function checkSymbolNodeType(node) {
|
|
24467
|
-
if (node
|
|
24410
|
+
if (node.type === "atom" || NonAtoms.has(node.type)) {
|
|
24468
24411
|
return node;
|
|
24469
24412
|
}
|
|
24470
24413
|
return null;
|
|
24471
24414
|
}
|
|
24415
|
+
function assertCharacterGroup(group, errorMessage, allowSpaces) {
|
|
24416
|
+
var text2 = "";
|
|
24417
|
+
for (var node of group.body) {
|
|
24418
|
+
if (node.type === "textord") {
|
|
24419
|
+
text2 += node.text;
|
|
24420
|
+
} else if (allowSpaces && node.type === "spacing" && node.text === " ") {
|
|
24421
|
+
text2 += " ";
|
|
24422
|
+
} else {
|
|
24423
|
+
throw new ParseError(errorMessage, group);
|
|
24424
|
+
}
|
|
24425
|
+
}
|
|
24426
|
+
return text2;
|
|
24427
|
+
}
|
|
24472
24428
|
var getBaseSymbol = (group) => {
|
|
24473
24429
|
if (group instanceof SymbolNode) {
|
|
24474
24430
|
return group;
|
|
@@ -24509,9 +24465,10 @@ var htmlBuilder$a = (grp, options2) => {
|
|
|
24509
24465
|
width = svgData.vec[1];
|
|
24510
24466
|
} else {
|
|
24511
24467
|
accent2 = makeOrd({
|
|
24468
|
+
type: "textord",
|
|
24512
24469
|
mode: group.mode,
|
|
24513
24470
|
text: group.label
|
|
24514
|
-
}, options2
|
|
24471
|
+
}, options2);
|
|
24515
24472
|
accent2 = assertSymbolDomNode(accent2);
|
|
24516
24473
|
accent2.italic = 0;
|
|
24517
24474
|
width = accent2.width;
|
|
@@ -24564,7 +24521,7 @@ var htmlBuilder$a = (grp, options2) => {
|
|
|
24564
24521
|
}]
|
|
24565
24522
|
});
|
|
24566
24523
|
}
|
|
24567
|
-
var accentWrap = makeSpan(["mord", "accent"], [accentBody], options2);
|
|
24524
|
+
var accentWrap = makeSpan(["mord", "katex-accent"], [accentBody], options2);
|
|
24568
24525
|
if (supSubGroup) {
|
|
24569
24526
|
supSubGroup.children[0] = accentWrap;
|
|
24570
24527
|
supSubGroup.height = Math.max(accentWrap.height, supSubGroup.height);
|
|
@@ -24584,9 +24541,7 @@ var NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\t
|
|
|
24584
24541
|
defineFunction({
|
|
24585
24542
|
type: "accent",
|
|
24586
24543
|
names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"],
|
|
24587
|
-
|
|
24588
|
-
numArgs: 1
|
|
24589
|
-
},
|
|
24544
|
+
numArgs: 1,
|
|
24590
24545
|
handler: (context, args) => {
|
|
24591
24546
|
var base2 = normalizeArgument(args[0]);
|
|
24592
24547
|
var isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName);
|
|
@@ -24606,18 +24561,21 @@ defineFunction({
|
|
|
24606
24561
|
defineFunction({
|
|
24607
24562
|
type: "accent",
|
|
24608
24563
|
names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"],
|
|
24609
|
-
|
|
24610
|
-
|
|
24611
|
-
|
|
24612
|
-
|
|
24613
|
-
|
|
24614
|
-
argTypes: ["primitive"]
|
|
24615
|
-
},
|
|
24564
|
+
numArgs: 1,
|
|
24565
|
+
allowedInText: true,
|
|
24566
|
+
allowedInMath: true,
|
|
24567
|
+
// unless in strict mode
|
|
24568
|
+
argTypes: ["primitive"],
|
|
24616
24569
|
handler: (context, args) => {
|
|
24617
24570
|
var base2 = args[0];
|
|
24618
24571
|
var mode = context.parser.mode;
|
|
24619
24572
|
if (mode === "math") {
|
|
24620
|
-
|
|
24573
|
+
handleStrict({
|
|
24574
|
+
strict: context.parser.settings.strict,
|
|
24575
|
+
errorCode: "mathVsTextAccents",
|
|
24576
|
+
errorMsg: "LaTeX's accent " + context.funcName + " works only in text mode",
|
|
24577
|
+
report: true
|
|
24578
|
+
});
|
|
24621
24579
|
mode = "text";
|
|
24622
24580
|
}
|
|
24623
24581
|
return {
|
|
@@ -24628,21 +24586,14 @@ defineFunction({
|
|
|
24628
24586
|
isShifty: true,
|
|
24629
24587
|
base: base2
|
|
24630
24588
|
};
|
|
24631
|
-
}
|
|
24632
|
-
htmlBuilder: htmlBuilder$a,
|
|
24633
|
-
mathmlBuilder: mathmlBuilder$9
|
|
24589
|
+
}
|
|
24634
24590
|
});
|
|
24635
24591
|
defineFunction({
|
|
24636
24592
|
type: "accentUnder",
|
|
24637
24593
|
names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
|
|
24638
|
-
|
|
24639
|
-
numArgs: 1
|
|
24640
|
-
},
|
|
24594
|
+
numArgs: 1,
|
|
24641
24595
|
handler: (_ref, args) => {
|
|
24642
|
-
var
|
|
24643
|
-
parser: parser2,
|
|
24644
|
-
funcName
|
|
24645
|
-
} = _ref;
|
|
24596
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
24646
24597
|
var base2 = args[0];
|
|
24647
24598
|
return {
|
|
24648
24599
|
type: "accentUnder",
|
|
@@ -24717,15 +24668,10 @@ defineFunction({
|
|
|
24717
24668
|
"\\\\cdleftarrow",
|
|
24718
24669
|
"\\\\cdlongequal"
|
|
24719
24670
|
],
|
|
24720
|
-
|
|
24721
|
-
|
|
24722
|
-
numOptionalArgs: 1
|
|
24723
|
-
},
|
|
24671
|
+
numArgs: 1,
|
|
24672
|
+
numOptionalArgs: 1,
|
|
24724
24673
|
handler(_ref, args, optArgs) {
|
|
24725
|
-
var
|
|
24726
|
-
parser: parser2,
|
|
24727
|
-
funcName
|
|
24728
|
-
} = _ref;
|
|
24674
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
24729
24675
|
return {
|
|
24730
24676
|
type: "xArrow",
|
|
24731
24677
|
mode: parser2.mode,
|
|
@@ -24843,9 +24789,6 @@ function mathmlBuilder$8(group, options2) {
|
|
|
24843
24789
|
} else if (group.mclass === "mopen" || group.mclass === "mclose") {
|
|
24844
24790
|
node.attributes.lspace = "0em";
|
|
24845
24791
|
node.attributes.rspace = "0em";
|
|
24846
|
-
} else if (group.mclass === "minner") {
|
|
24847
|
-
node.attributes.lspace = "0.0556em";
|
|
24848
|
-
node.attributes.width = "+0.1111em";
|
|
24849
24792
|
}
|
|
24850
24793
|
}
|
|
24851
24794
|
return node;
|
|
@@ -24853,21 +24796,15 @@ function mathmlBuilder$8(group, options2) {
|
|
|
24853
24796
|
defineFunction({
|
|
24854
24797
|
type: "mclass",
|
|
24855
24798
|
names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
|
|
24856
|
-
|
|
24857
|
-
|
|
24858
|
-
primitive: true
|
|
24859
|
-
},
|
|
24799
|
+
numArgs: 1,
|
|
24800
|
+
primitive: true,
|
|
24860
24801
|
handler(_ref, args) {
|
|
24861
|
-
var
|
|
24862
|
-
parser: parser2,
|
|
24863
|
-
funcName
|
|
24864
|
-
} = _ref;
|
|
24802
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
24865
24803
|
var body = args[0];
|
|
24866
24804
|
return {
|
|
24867
24805
|
type: "mclass",
|
|
24868
24806
|
mode: parser2.mode,
|
|
24869
24807
|
mclass: "m" + funcName.slice(5),
|
|
24870
|
-
// TODO(kevinb): don't prefix with 'm'
|
|
24871
24808
|
body: ordargument(body),
|
|
24872
24809
|
isCharacterBox: isCharacterBox(body)
|
|
24873
24810
|
};
|
|
@@ -24886,13 +24823,9 @@ var binrelClass = (arg) => {
|
|
|
24886
24823
|
defineFunction({
|
|
24887
24824
|
type: "mclass",
|
|
24888
24825
|
names: ["\\@binrel"],
|
|
24889
|
-
|
|
24890
|
-
numArgs: 2
|
|
24891
|
-
},
|
|
24826
|
+
numArgs: 2,
|
|
24892
24827
|
handler(_ref2, args) {
|
|
24893
|
-
var
|
|
24894
|
-
parser: parser2
|
|
24895
|
-
} = _ref2;
|
|
24828
|
+
var parser2 = _ref2.parser;
|
|
24896
24829
|
return {
|
|
24897
24830
|
type: "mclass",
|
|
24898
24831
|
mode: parser2.mode,
|
|
@@ -24905,14 +24838,9 @@ defineFunction({
|
|
|
24905
24838
|
defineFunction({
|
|
24906
24839
|
type: "mclass",
|
|
24907
24840
|
names: ["\\stackrel", "\\overset", "\\underset"],
|
|
24908
|
-
|
|
24909
|
-
numArgs: 2
|
|
24910
|
-
},
|
|
24841
|
+
numArgs: 2,
|
|
24911
24842
|
handler(_ref3, args) {
|
|
24912
|
-
var
|
|
24913
|
-
parser: parser2,
|
|
24914
|
-
funcName
|
|
24915
|
-
} = _ref3;
|
|
24843
|
+
var parser2 = _ref3.parser, funcName = _ref3.funcName;
|
|
24916
24844
|
var baseArg = args[1];
|
|
24917
24845
|
var shiftedArg = args[0];
|
|
24918
24846
|
var mclass;
|
|
@@ -24931,12 +24859,16 @@ defineFunction({
|
|
|
24931
24859
|
suppressBaseShift: funcName !== "\\stackrel",
|
|
24932
24860
|
body: ordargument(baseArg)
|
|
24933
24861
|
};
|
|
24934
|
-
var supsub = {
|
|
24862
|
+
var supsub = funcName === "\\underset" ? {
|
|
24863
|
+
type: "supsub",
|
|
24864
|
+
mode: shiftedArg.mode,
|
|
24865
|
+
base: baseOp,
|
|
24866
|
+
sub: shiftedArg
|
|
24867
|
+
} : {
|
|
24935
24868
|
type: "supsub",
|
|
24936
24869
|
mode: shiftedArg.mode,
|
|
24937
24870
|
base: baseOp,
|
|
24938
|
-
sup:
|
|
24939
|
-
sub: funcName === "\\underset" ? shiftedArg : null
|
|
24871
|
+
sup: shiftedArg
|
|
24940
24872
|
};
|
|
24941
24873
|
return {
|
|
24942
24874
|
type: "mclass",
|
|
@@ -24945,21 +24877,15 @@ defineFunction({
|
|
|
24945
24877
|
body: [supsub],
|
|
24946
24878
|
isCharacterBox: isCharacterBox(supsub)
|
|
24947
24879
|
};
|
|
24948
|
-
}
|
|
24949
|
-
htmlBuilder: htmlBuilder$9,
|
|
24950
|
-
mathmlBuilder: mathmlBuilder$8
|
|
24880
|
+
}
|
|
24951
24881
|
});
|
|
24952
24882
|
defineFunction({
|
|
24953
24883
|
type: "pmb",
|
|
24954
24884
|
names: ["\\pmb"],
|
|
24955
|
-
|
|
24956
|
-
|
|
24957
|
-
allowedInText: true
|
|
24958
|
-
},
|
|
24885
|
+
numArgs: 1,
|
|
24886
|
+
allowedInText: true,
|
|
24959
24887
|
handler(_ref, args) {
|
|
24960
|
-
var
|
|
24961
|
-
parser: parser2
|
|
24962
|
-
} = _ref;
|
|
24888
|
+
var parser2 = _ref.parser;
|
|
24963
24889
|
return {
|
|
24964
24890
|
type: "pmb",
|
|
24965
24891
|
mode: parser2.mode,
|
|
@@ -25158,14 +25084,9 @@ function parseCD(parser2) {
|
|
|
25158
25084
|
defineFunction({
|
|
25159
25085
|
type: "cdlabel",
|
|
25160
25086
|
names: ["\\\\cdleft", "\\\\cdright"],
|
|
25161
|
-
|
|
25162
|
-
numArgs: 1
|
|
25163
|
-
},
|
|
25087
|
+
numArgs: 1,
|
|
25164
25088
|
handler(_ref, args) {
|
|
25165
|
-
var
|
|
25166
|
-
parser: parser2,
|
|
25167
|
-
funcName
|
|
25168
|
-
} = _ref;
|
|
25089
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
25169
25090
|
return {
|
|
25170
25091
|
type: "cdlabel",
|
|
25171
25092
|
mode: parser2.mode,
|
|
@@ -25199,13 +25120,9 @@ defineFunction({
|
|
|
25199
25120
|
defineFunction({
|
|
25200
25121
|
type: "cdlabelparent",
|
|
25201
25122
|
names: ["\\\\cdparent"],
|
|
25202
|
-
|
|
25203
|
-
numArgs: 1
|
|
25204
|
-
},
|
|
25123
|
+
numArgs: 1,
|
|
25205
25124
|
handler(_ref2, args) {
|
|
25206
|
-
var
|
|
25207
|
-
parser: parser2
|
|
25208
|
-
} = _ref2;
|
|
25125
|
+
var parser2 = _ref2.parser;
|
|
25209
25126
|
return {
|
|
25210
25127
|
type: "cdlabelparent",
|
|
25211
25128
|
mode: parser2.mode,
|
|
@@ -25224,26 +25141,17 @@ defineFunction({
|
|
|
25224
25141
|
defineFunction({
|
|
25225
25142
|
type: "textord",
|
|
25226
25143
|
names: ["\\@char"],
|
|
25227
|
-
|
|
25228
|
-
|
|
25229
|
-
allowedInText: true
|
|
25230
|
-
},
|
|
25144
|
+
numArgs: 1,
|
|
25145
|
+
allowedInText: true,
|
|
25231
25146
|
handler(_ref, args) {
|
|
25232
|
-
var
|
|
25233
|
-
parser: parser2
|
|
25234
|
-
} = _ref;
|
|
25147
|
+
var parser2 = _ref.parser;
|
|
25235
25148
|
var arg = assertNodeType(args[0], "ordgroup");
|
|
25236
|
-
var
|
|
25237
|
-
var number2 = "";
|
|
25238
|
-
for (var i = 0; i < group.length; i++) {
|
|
25239
|
-
var node = assertNodeType(group[i], "textord");
|
|
25240
|
-
number2 += node.text;
|
|
25241
|
-
}
|
|
25149
|
+
var number2 = assertCharacterGroup(arg, "\\@char has non-numeric argument");
|
|
25242
25150
|
var code = parseInt(number2);
|
|
25243
25151
|
var text2;
|
|
25244
25152
|
if (isNaN(code)) {
|
|
25245
25153
|
throw new ParseError("\\@char has non-numeric argument " + number2);
|
|
25246
|
-
} else if (code < 0 || code
|
|
25154
|
+
} else if (code < 0 || code > 1114111) {
|
|
25247
25155
|
throw new ParseError("\\@char with invalid code point " + number2);
|
|
25248
25156
|
} else if (code <= 65535) {
|
|
25249
25157
|
text2 = String.fromCharCode(code);
|
|
@@ -25271,15 +25179,11 @@ var mathmlBuilder$7 = (group, options2) => {
|
|
|
25271
25179
|
defineFunction({
|
|
25272
25180
|
type: "color",
|
|
25273
25181
|
names: ["\\textcolor"],
|
|
25274
|
-
|
|
25275
|
-
|
|
25276
|
-
|
|
25277
|
-
argTypes: ["color", "original"]
|
|
25278
|
-
},
|
|
25182
|
+
numArgs: 2,
|
|
25183
|
+
allowedInText: true,
|
|
25184
|
+
argTypes: ["color", "original"],
|
|
25279
25185
|
handler(_ref, args) {
|
|
25280
|
-
var
|
|
25281
|
-
parser: parser2
|
|
25282
|
-
} = _ref;
|
|
25186
|
+
var parser2 = _ref.parser;
|
|
25283
25187
|
var color2 = assertNodeType(args[0], "color-token").color;
|
|
25284
25188
|
var body = args[1];
|
|
25285
25189
|
return {
|
|
@@ -25295,16 +25199,11 @@ defineFunction({
|
|
|
25295
25199
|
defineFunction({
|
|
25296
25200
|
type: "color",
|
|
25297
25201
|
names: ["\\color"],
|
|
25298
|
-
|
|
25299
|
-
|
|
25300
|
-
|
|
25301
|
-
argTypes: ["color"]
|
|
25302
|
-
},
|
|
25202
|
+
numArgs: 1,
|
|
25203
|
+
allowedInText: true,
|
|
25204
|
+
argTypes: ["color"],
|
|
25303
25205
|
handler(_ref2, args) {
|
|
25304
|
-
var
|
|
25305
|
-
parser: parser2,
|
|
25306
|
-
breakOnTokenText
|
|
25307
|
-
} = _ref2;
|
|
25206
|
+
var parser2 = _ref2.parser, breakOnTokenText = _ref2.breakOnTokenText;
|
|
25308
25207
|
var color2 = assertNodeType(args[0], "color-token").color;
|
|
25309
25208
|
parser2.gullet.macros.set("\\current@color", color2);
|
|
25310
25209
|
var body = parser2.parseExpression(true, breakOnTokenText);
|
|
@@ -25314,24 +25213,23 @@ defineFunction({
|
|
|
25314
25213
|
color: color2,
|
|
25315
25214
|
body
|
|
25316
25215
|
};
|
|
25317
|
-
}
|
|
25318
|
-
htmlBuilder: htmlBuilder$8,
|
|
25319
|
-
mathmlBuilder: mathmlBuilder$7
|
|
25216
|
+
}
|
|
25320
25217
|
});
|
|
25321
25218
|
defineFunction({
|
|
25322
25219
|
type: "cr",
|
|
25323
25220
|
names: ["\\\\"],
|
|
25324
|
-
|
|
25325
|
-
|
|
25326
|
-
|
|
25327
|
-
|
|
25328
|
-
|
|
25329
|
-
handler(_ref, args, optArgs) {
|
|
25330
|
-
var {
|
|
25331
|
-
parser: parser2
|
|
25332
|
-
} = _ref;
|
|
25221
|
+
numArgs: 0,
|
|
25222
|
+
numOptionalArgs: 0,
|
|
25223
|
+
allowedInText: true,
|
|
25224
|
+
handler(_ref) {
|
|
25225
|
+
var parser2 = _ref.parser;
|
|
25333
25226
|
var size = parser2.gullet.future().text === "[" ? parser2.parseSizeGroup(true) : null;
|
|
25334
|
-
var newLine = !parser2.settings.displayMode || !
|
|
25227
|
+
var newLine = !parser2.settings.displayMode || !handleStrict({
|
|
25228
|
+
strict: parser2.settings.strict,
|
|
25229
|
+
errorCode: "newLineInDisplayMode",
|
|
25230
|
+
errorMsg: "In LaTeX, \\\\ or \\newline does nothing in display mode",
|
|
25231
|
+
report: false
|
|
25232
|
+
});
|
|
25335
25233
|
return {
|
|
25336
25234
|
type: "cr",
|
|
25337
25235
|
mode: parser2.mode,
|
|
@@ -25344,7 +25242,7 @@ defineFunction({
|
|
|
25344
25242
|
htmlBuilder(group, options2) {
|
|
25345
25243
|
var span = makeSpan(["mspace"], [], options2);
|
|
25346
25244
|
if (group.newLine) {
|
|
25347
|
-
span.classes.push("newline");
|
|
25245
|
+
span.classes.push("katex-newline");
|
|
25348
25246
|
if (group.size) {
|
|
25349
25247
|
span.style.marginTop = makeEm(calculateSize(group.size, options2));
|
|
25350
25248
|
}
|
|
@@ -25411,15 +25309,10 @@ defineFunction({
|
|
|
25411
25309
|
"\\\\globallong"
|
|
25412
25310
|
// can’t be entered directly
|
|
25413
25311
|
],
|
|
25414
|
-
|
|
25415
|
-
|
|
25416
|
-
allowedInText: true
|
|
25417
|
-
},
|
|
25312
|
+
numArgs: 0,
|
|
25313
|
+
allowedInText: true,
|
|
25418
25314
|
handler(_ref) {
|
|
25419
|
-
var
|
|
25420
|
-
parser: parser2,
|
|
25421
|
-
funcName
|
|
25422
|
-
} = _ref;
|
|
25315
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
25423
25316
|
parser2.consumeSpaces();
|
|
25424
25317
|
var token = parser2.fetch();
|
|
25425
25318
|
if (globalMap[token.text]) {
|
|
@@ -25434,16 +25327,11 @@ defineFunction({
|
|
|
25434
25327
|
defineFunction({
|
|
25435
25328
|
type: "internal",
|
|
25436
25329
|
names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
|
|
25437
|
-
|
|
25438
|
-
|
|
25439
|
-
|
|
25440
|
-
primitive: true
|
|
25441
|
-
},
|
|
25330
|
+
numArgs: 0,
|
|
25331
|
+
allowedInText: true,
|
|
25332
|
+
primitive: true,
|
|
25442
25333
|
handler(_ref2) {
|
|
25443
|
-
var
|
|
25444
|
-
parser: parser2,
|
|
25445
|
-
funcName
|
|
25446
|
-
} = _ref2;
|
|
25334
|
+
var parser2 = _ref2.parser, funcName = _ref2.funcName;
|
|
25447
25335
|
var tok = parser2.gullet.popToken();
|
|
25448
25336
|
var name2 = tok.text;
|
|
25449
25337
|
if (/^(?:[\\{}$&#^_]|EOF)$/.test(name2)) {
|
|
@@ -25475,9 +25363,7 @@ defineFunction({
|
|
|
25475
25363
|
delimiters2[numArgs].push(tok.text);
|
|
25476
25364
|
}
|
|
25477
25365
|
}
|
|
25478
|
-
var
|
|
25479
|
-
tokens
|
|
25480
|
-
} = parser2.gullet.consumeArg();
|
|
25366
|
+
var _parser$gullet$consum = parser2.gullet.consumeArg(), tokens = _parser$gullet$consum.tokens;
|
|
25481
25367
|
if (insert2) {
|
|
25482
25368
|
tokens.unshift(insert2);
|
|
25483
25369
|
}
|
|
@@ -25503,16 +25389,11 @@ defineFunction({
|
|
|
25503
25389
|
"\\\\globallet"
|
|
25504
25390
|
// can’t be entered directly
|
|
25505
25391
|
],
|
|
25506
|
-
|
|
25507
|
-
|
|
25508
|
-
|
|
25509
|
-
primitive: true
|
|
25510
|
-
},
|
|
25392
|
+
numArgs: 0,
|
|
25393
|
+
allowedInText: true,
|
|
25394
|
+
primitive: true,
|
|
25511
25395
|
handler(_ref3) {
|
|
25512
|
-
var
|
|
25513
|
-
parser: parser2,
|
|
25514
|
-
funcName
|
|
25515
|
-
} = _ref3;
|
|
25396
|
+
var parser2 = _ref3.parser, funcName = _ref3.funcName;
|
|
25516
25397
|
var name2 = checkControlSequence(parser2.gullet.popToken());
|
|
25517
25398
|
parser2.gullet.consumeSpaces();
|
|
25518
25399
|
var tok = getRHS(parser2);
|
|
@@ -25530,16 +25411,11 @@ defineFunction({
|
|
|
25530
25411
|
"\\\\globalfuture"
|
|
25531
25412
|
// can’t be entered directly
|
|
25532
25413
|
],
|
|
25533
|
-
|
|
25534
|
-
|
|
25535
|
-
|
|
25536
|
-
primitive: true
|
|
25537
|
-
},
|
|
25414
|
+
numArgs: 0,
|
|
25415
|
+
allowedInText: true,
|
|
25416
|
+
primitive: true,
|
|
25538
25417
|
handler(_ref4) {
|
|
25539
|
-
var
|
|
25540
|
-
parser: parser2,
|
|
25541
|
-
funcName
|
|
25542
|
-
} = _ref4;
|
|
25418
|
+
var parser2 = _ref4.parser, funcName = _ref4.funcName;
|
|
25543
25419
|
var name2 = checkControlSequence(parser2.gullet.popToken());
|
|
25544
25420
|
var middle = parser2.gullet.popToken();
|
|
25545
25421
|
var tok = parser2.gullet.popToken();
|
|
@@ -25596,14 +25472,14 @@ var makeLargeDelim = function makeLargeDelim2(delim, size, center, options2, mod
|
|
|
25596
25472
|
}
|
|
25597
25473
|
return span;
|
|
25598
25474
|
};
|
|
25599
|
-
var makeGlyphSpan = function makeGlyphSpan2(symbol, font, mode) {
|
|
25475
|
+
var makeGlyphSpan = function makeGlyphSpan2(symbol, font, mode, options2) {
|
|
25600
25476
|
var sizeClass;
|
|
25601
25477
|
if (font === "Size1-Regular") {
|
|
25602
25478
|
sizeClass = "delim-size1";
|
|
25603
25479
|
} else {
|
|
25604
25480
|
sizeClass = "delim-size4";
|
|
25605
25481
|
}
|
|
25606
|
-
var corner = makeSpan(["delimsizinginner", sizeClass], [makeSpan([], [makeSymbol(symbol, font, mode)])]);
|
|
25482
|
+
var corner = makeSpan(["delimsizinginner", sizeClass], [makeSpan([], [makeSymbol(symbol, font, mode, options2)])]);
|
|
25607
25483
|
return {
|
|
25608
25484
|
type: "elem",
|
|
25609
25485
|
elem: corner
|
|
@@ -25798,7 +25674,7 @@ var makeStackedDelim = function makeStackedDelim2(delim, heightTotal, center, op
|
|
|
25798
25674
|
elem: wrapper
|
|
25799
25675
|
});
|
|
25800
25676
|
} else {
|
|
25801
|
-
stack.push(makeGlyphSpan(bottom, font, mode));
|
|
25677
|
+
stack.push(makeGlyphSpan(bottom, font, mode, options2));
|
|
25802
25678
|
stack.push(lap);
|
|
25803
25679
|
if (middle === null) {
|
|
25804
25680
|
var innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms;
|
|
@@ -25807,12 +25683,12 @@ var makeStackedDelim = function makeStackedDelim2(delim, heightTotal, center, op
|
|
|
25807
25683
|
var _innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms;
|
|
25808
25684
|
stack.push(makeInner(repeat, _innerHeight, options2));
|
|
25809
25685
|
stack.push(lap);
|
|
25810
|
-
stack.push(makeGlyphSpan(middle, font, mode));
|
|
25686
|
+
stack.push(makeGlyphSpan(middle, font, mode, options2));
|
|
25811
25687
|
stack.push(lap);
|
|
25812
25688
|
stack.push(makeInner(repeat, _innerHeight, options2));
|
|
25813
25689
|
}
|
|
25814
25690
|
stack.push(lap);
|
|
25815
|
-
stack.push(makeGlyphSpan(top2, font, mode));
|
|
25691
|
+
stack.push(makeGlyphSpan(top2, font, mode, options2));
|
|
25816
25692
|
}
|
|
25817
25693
|
var newOptions = options2.havingBaseStyle(Style$1.TEXT);
|
|
25818
25694
|
var inner2 = makeVList({
|
|
@@ -26118,12 +25994,10 @@ function checkDelimiter(delim, context) {
|
|
|
26118
25994
|
defineFunction({
|
|
26119
25995
|
type: "delimsizing",
|
|
26120
25996
|
names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"],
|
|
26121
|
-
|
|
26122
|
-
|
|
26123
|
-
argTypes: ["primitive"]
|
|
26124
|
-
},
|
|
25997
|
+
numArgs: 1,
|
|
25998
|
+
argTypes: ["primitive"],
|
|
26125
25999
|
handler: (context, args) => {
|
|
26126
|
-
var delim = checkDelimiter(args[0], context);
|
|
26000
|
+
var delim = checkDelimiter(normalizeArgument(args[0]), context);
|
|
26127
26001
|
return {
|
|
26128
26002
|
type: "delimsizing",
|
|
26129
26003
|
mode: context.parser.mode,
|
|
@@ -26164,10 +26038,8 @@ function assertParsed(group) {
|
|
|
26164
26038
|
defineFunction({
|
|
26165
26039
|
type: "leftright-right",
|
|
26166
26040
|
names: ["\\right"],
|
|
26167
|
-
|
|
26168
|
-
|
|
26169
|
-
primitive: true
|
|
26170
|
-
},
|
|
26041
|
+
numArgs: 1,
|
|
26042
|
+
primitive: true,
|
|
26171
26043
|
handler: (context, args) => {
|
|
26172
26044
|
var color2 = context.parser.gullet.macros.get("\\current@color");
|
|
26173
26045
|
if (color2 && typeof color2 !== "string") {
|
|
@@ -26185,10 +26057,8 @@ defineFunction({
|
|
|
26185
26057
|
defineFunction({
|
|
26186
26058
|
type: "leftright",
|
|
26187
26059
|
names: ["\\left"],
|
|
26188
|
-
|
|
26189
|
-
|
|
26190
|
-
primitive: true
|
|
26191
|
-
},
|
|
26060
|
+
numArgs: 1,
|
|
26061
|
+
primitive: true,
|
|
26192
26062
|
handler: (context, args) => {
|
|
26193
26063
|
var delim = checkDelimiter(args[0], context);
|
|
26194
26064
|
var parser2 = context.parser;
|
|
@@ -26271,10 +26141,8 @@ defineFunction({
|
|
|
26271
26141
|
defineFunction({
|
|
26272
26142
|
type: "middle",
|
|
26273
26143
|
names: ["\\middle"],
|
|
26274
|
-
|
|
26275
|
-
|
|
26276
|
-
primitive: true
|
|
26277
|
-
},
|
|
26144
|
+
numArgs: 1,
|
|
26145
|
+
primitive: true,
|
|
26278
26146
|
handler: (context, args) => {
|
|
26279
26147
|
var delim = checkDelimiter(args[0], context);
|
|
26280
26148
|
if (!context.parser.leftrightDepth) {
|
|
@@ -26316,7 +26184,7 @@ var htmlBuilder$7 = (group, options2) => {
|
|
|
26316
26184
|
var imgShift;
|
|
26317
26185
|
var isSingleChar = isCharacterBox(group.body);
|
|
26318
26186
|
if (label === "sout") {
|
|
26319
|
-
img = makeSpan(["stretchy", "sout"]);
|
|
26187
|
+
img = makeSpan(["katex-stretchy", "katex-sout"]);
|
|
26320
26188
|
img.height = options2.fontMetrics().defaultRuleThickness / scale;
|
|
26321
26189
|
imgShift = -0.5 * options2.fontMetrics().xHeight;
|
|
26322
26190
|
} else if (label === "phase") {
|
|
@@ -26486,16 +26354,11 @@ var mathmlBuilder$6 = (group, options2) => {
|
|
|
26486
26354
|
defineFunction({
|
|
26487
26355
|
type: "enclose",
|
|
26488
26356
|
names: ["\\colorbox"],
|
|
26489
|
-
|
|
26490
|
-
|
|
26491
|
-
|
|
26492
|
-
argTypes: ["color", "hbox"]
|
|
26493
|
-
},
|
|
26357
|
+
numArgs: 2,
|
|
26358
|
+
allowedInText: true,
|
|
26359
|
+
argTypes: ["color", "hbox"],
|
|
26494
26360
|
handler(_ref, args, optArgs) {
|
|
26495
|
-
var
|
|
26496
|
-
parser: parser2,
|
|
26497
|
-
funcName
|
|
26498
|
-
} = _ref;
|
|
26361
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
26499
26362
|
var color2 = assertNodeType(args[0], "color-token").color;
|
|
26500
26363
|
var body = args[1];
|
|
26501
26364
|
return {
|
|
@@ -26512,16 +26375,11 @@ defineFunction({
|
|
|
26512
26375
|
defineFunction({
|
|
26513
26376
|
type: "enclose",
|
|
26514
26377
|
names: ["\\fcolorbox"],
|
|
26515
|
-
|
|
26516
|
-
|
|
26517
|
-
|
|
26518
|
-
argTypes: ["color", "color", "hbox"]
|
|
26519
|
-
},
|
|
26378
|
+
numArgs: 3,
|
|
26379
|
+
allowedInText: true,
|
|
26380
|
+
argTypes: ["color", "color", "hbox"],
|
|
26520
26381
|
handler(_ref2, args, optArgs) {
|
|
26521
|
-
var
|
|
26522
|
-
parser: parser2,
|
|
26523
|
-
funcName
|
|
26524
|
-
} = _ref2;
|
|
26382
|
+
var parser2 = _ref2.parser, funcName = _ref2.funcName;
|
|
26525
26383
|
var borderColor = assertNodeType(args[0], "color-token").color;
|
|
26526
26384
|
var backgroundColor = assertNodeType(args[1], "color-token").color;
|
|
26527
26385
|
var body = args[2];
|
|
@@ -26533,22 +26391,16 @@ defineFunction({
|
|
|
26533
26391
|
borderColor,
|
|
26534
26392
|
body
|
|
26535
26393
|
};
|
|
26536
|
-
}
|
|
26537
|
-
htmlBuilder: htmlBuilder$7,
|
|
26538
|
-
mathmlBuilder: mathmlBuilder$6
|
|
26394
|
+
}
|
|
26539
26395
|
});
|
|
26540
26396
|
defineFunction({
|
|
26541
26397
|
type: "enclose",
|
|
26542
26398
|
names: ["\\fbox"],
|
|
26543
|
-
|
|
26544
|
-
|
|
26545
|
-
|
|
26546
|
-
allowedInText: true
|
|
26547
|
-
},
|
|
26399
|
+
numArgs: 1,
|
|
26400
|
+
argTypes: ["hbox"],
|
|
26401
|
+
allowedInText: true,
|
|
26548
26402
|
handler(_ref3, args) {
|
|
26549
|
-
var
|
|
26550
|
-
parser: parser2
|
|
26551
|
-
} = _ref3;
|
|
26403
|
+
var parser2 = _ref3.parser;
|
|
26552
26404
|
return {
|
|
26553
26405
|
type: "enclose",
|
|
26554
26406
|
mode: parser2.mode,
|
|
@@ -26560,14 +26412,9 @@ defineFunction({
|
|
|
26560
26412
|
defineFunction({
|
|
26561
26413
|
type: "enclose",
|
|
26562
26414
|
names: ["\\cancel", "\\bcancel", "\\xcancel", "\\phase"],
|
|
26563
|
-
|
|
26564
|
-
numArgs: 1
|
|
26565
|
-
},
|
|
26415
|
+
numArgs: 1,
|
|
26566
26416
|
handler(_ref4, args) {
|
|
26567
|
-
var
|
|
26568
|
-
parser: parser2,
|
|
26569
|
-
funcName
|
|
26570
|
-
} = _ref4;
|
|
26417
|
+
var parser2 = _ref4.parser, funcName = _ref4.funcName;
|
|
26571
26418
|
var body = args[0];
|
|
26572
26419
|
return {
|
|
26573
26420
|
type: "enclose",
|
|
@@ -26575,24 +26422,22 @@ defineFunction({
|
|
|
26575
26422
|
label: funcName,
|
|
26576
26423
|
body
|
|
26577
26424
|
};
|
|
26578
|
-
}
|
|
26579
|
-
htmlBuilder: htmlBuilder$7,
|
|
26580
|
-
mathmlBuilder: mathmlBuilder$6
|
|
26425
|
+
}
|
|
26581
26426
|
});
|
|
26582
26427
|
defineFunction({
|
|
26583
26428
|
type: "enclose",
|
|
26584
26429
|
names: ["\\sout"],
|
|
26585
|
-
|
|
26586
|
-
|
|
26587
|
-
allowedInText: true
|
|
26588
|
-
},
|
|
26430
|
+
numArgs: 1,
|
|
26431
|
+
allowedInText: true,
|
|
26589
26432
|
handler(_ref5, args) {
|
|
26590
|
-
var
|
|
26591
|
-
parser: parser2,
|
|
26592
|
-
funcName
|
|
26593
|
-
} = _ref5;
|
|
26433
|
+
var parser2 = _ref5.parser, funcName = _ref5.funcName;
|
|
26594
26434
|
if (parser2.mode === "math") {
|
|
26595
|
-
|
|
26435
|
+
handleStrict({
|
|
26436
|
+
strict: parser2.settings.strict,
|
|
26437
|
+
errorCode: "mathVsSout",
|
|
26438
|
+
errorMsg: "LaTeX's \\sout works only in text mode",
|
|
26439
|
+
report: true
|
|
26440
|
+
});
|
|
26596
26441
|
}
|
|
26597
26442
|
var body = args[0];
|
|
26598
26443
|
return {
|
|
@@ -26601,22 +26446,16 @@ defineFunction({
|
|
|
26601
26446
|
label: funcName,
|
|
26602
26447
|
body
|
|
26603
26448
|
};
|
|
26604
|
-
}
|
|
26605
|
-
htmlBuilder: htmlBuilder$7,
|
|
26606
|
-
mathmlBuilder: mathmlBuilder$6
|
|
26449
|
+
}
|
|
26607
26450
|
});
|
|
26608
26451
|
defineFunction({
|
|
26609
26452
|
type: "enclose",
|
|
26610
26453
|
names: ["\\angl"],
|
|
26611
|
-
|
|
26612
|
-
|
|
26613
|
-
|
|
26614
|
-
allowedInText: false
|
|
26615
|
-
},
|
|
26454
|
+
numArgs: 1,
|
|
26455
|
+
argTypes: ["hbox"],
|
|
26456
|
+
allowedInText: false,
|
|
26616
26457
|
handler(_ref6, args) {
|
|
26617
|
-
var
|
|
26618
|
-
parser: parser2
|
|
26619
|
-
} = _ref6;
|
|
26458
|
+
var parser2 = _ref6.parser;
|
|
26620
26459
|
return {
|
|
26621
26460
|
type: "enclose",
|
|
26622
26461
|
mode: parser2.mode,
|
|
@@ -26627,20 +26466,13 @@ defineFunction({
|
|
|
26627
26466
|
});
|
|
26628
26467
|
var _environments = {};
|
|
26629
26468
|
function defineEnvironment(_ref) {
|
|
26630
|
-
var
|
|
26631
|
-
type,
|
|
26632
|
-
names,
|
|
26633
|
-
props,
|
|
26634
|
-
handler,
|
|
26635
|
-
htmlBuilder: htmlBuilder3,
|
|
26636
|
-
mathmlBuilder: mathmlBuilder3
|
|
26637
|
-
} = _ref;
|
|
26469
|
+
var type = _ref.type, names = _ref.names, props = _ref.props, handler2 = _ref.handler, htmlBuilder3 = _ref.htmlBuilder, mathmlBuilder3 = _ref.mathmlBuilder;
|
|
26638
26470
|
var data2 = {
|
|
26639
26471
|
type,
|
|
26640
26472
|
numArgs: props.numArgs || 0,
|
|
26641
26473
|
allowedInText: false,
|
|
26642
26474
|
numOptionalArgs: 0,
|
|
26643
|
-
handler
|
|
26475
|
+
handler: handler2
|
|
26644
26476
|
};
|
|
26645
26477
|
for (var i = 0; i < names.length; ++i) {
|
|
26646
26478
|
_environments[names[i]] = data2;
|
|
@@ -26732,18 +26564,7 @@ function getAutoTag(name2) {
|
|
|
26732
26564
|
}
|
|
26733
26565
|
}
|
|
26734
26566
|
function parseArray(parser2, _ref, style) {
|
|
26735
|
-
var
|
|
26736
|
-
hskipBeforeAndAfter,
|
|
26737
|
-
addJot,
|
|
26738
|
-
cols,
|
|
26739
|
-
arraystretch,
|
|
26740
|
-
colSeparationType,
|
|
26741
|
-
autoTag,
|
|
26742
|
-
singleRow,
|
|
26743
|
-
emptySingleRow,
|
|
26744
|
-
maxNumCols,
|
|
26745
|
-
leqno
|
|
26746
|
-
} = _ref;
|
|
26567
|
+
var hskipBeforeAndAfter = _ref.hskipBeforeAndAfter, addJot = _ref.addJot, cols = _ref.cols, arraystretch = _ref.arraystretch, colSeparationType = _ref.colSeparationType, autoTag = _ref.autoTag, singleRow = _ref.singleRow, emptySingleRow = _ref.emptySingleRow, maxNumCols = _ref.maxNumCols, leqno = _ref.leqno;
|
|
26747
26568
|
parser2.gullet.beginGroup();
|
|
26748
26569
|
if (!singleRow) {
|
|
26749
26570
|
parser2.gullet.macros.set("\\cr", "\\\\\\relax");
|
|
@@ -26807,13 +26628,18 @@ function parseArray(parser2, _ref, style) {
|
|
|
26807
26628
|
if (singleRow || colSeparationType) {
|
|
26808
26629
|
throw new ParseError("Too many tab characters: &", parser2.nextToken);
|
|
26809
26630
|
} else {
|
|
26810
|
-
|
|
26631
|
+
handleStrict({
|
|
26632
|
+
strict: parser2.settings.strict,
|
|
26633
|
+
errorCode: "textEnv",
|
|
26634
|
+
errorMsg: "Too few columns specified in the {array} column argument.",
|
|
26635
|
+
report: true
|
|
26636
|
+
});
|
|
26811
26637
|
}
|
|
26812
26638
|
}
|
|
26813
26639
|
parser2.consume();
|
|
26814
26640
|
} else if (next === "\\end") {
|
|
26815
26641
|
endRow();
|
|
26816
|
-
if (row.length === 1 && cell.type === "styling" && cell.body.length === 1 && cell.body[0].type === "ordgroup" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow)) {
|
|
26642
|
+
if (row.length === 1 && cell.type === "styling" && cell.body.length === 1 && cell.body[0].type === "ordgroup" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow) && !Array.isArray(tags2 == null ? void 0 : tags2[tags2.length - 1]) && !(autoTag && (tags2 == null ? void 0 : tags2[tags2.length - 1]) === true)) {
|
|
26817
26643
|
body.pop();
|
|
26818
26644
|
}
|
|
26819
26645
|
if (hLinesBeforeRow.length < body.length + 1) {
|
|
@@ -27057,8 +26883,8 @@ var htmlBuilder$6 = function htmlBuilder(group, options2) {
|
|
|
27057
26883
|
}
|
|
27058
26884
|
var tableBody = makeSpan(["mtable"], cols);
|
|
27059
26885
|
if (hlines.length > 0) {
|
|
27060
|
-
var line = makeLineSpan("hline", options2, ruleThickness);
|
|
27061
|
-
var dashes = makeLineSpan("hdashline", options2, ruleThickness);
|
|
26886
|
+
var line = makeLineSpan("katex-hline", options2, ruleThickness);
|
|
26887
|
+
var dashes = makeLineSpan("katex-hdashline", options2, ruleThickness);
|
|
27062
26888
|
var vListElems = [{
|
|
27063
26889
|
type: "elem",
|
|
27064
26890
|
elem: tableBody,
|
|
@@ -27093,7 +26919,7 @@ var htmlBuilder$6 = function htmlBuilder(group, options2) {
|
|
|
27093
26919
|
positionType: "individualShift",
|
|
27094
26920
|
children: tagSpans
|
|
27095
26921
|
});
|
|
27096
|
-
var tagCol = makeSpan(["tag"], [eqnNumCol], options2);
|
|
26922
|
+
var tagCol = makeSpan(["katex-tag"], [eqnNumCol], options2);
|
|
27097
26923
|
return makeFragment([tableBody, tagCol]);
|
|
27098
26924
|
}
|
|
27099
26925
|
};
|
|
@@ -27203,14 +27029,13 @@ var alignedHandler = function alignedHandler2(context, args) {
|
|
|
27203
27029
|
validateAmsEnvironmentContext(context);
|
|
27204
27030
|
}
|
|
27205
27031
|
var cols = [];
|
|
27206
|
-
var separationType = context.envName.includes("at") ? "alignat" : "align";
|
|
27207
27032
|
var isSplit = context.envName === "split";
|
|
27208
27033
|
var res = parseArray(context.parser, {
|
|
27209
27034
|
cols,
|
|
27210
27035
|
addJot: true,
|
|
27211
27036
|
autoTag: isSplit ? void 0 : getAutoTag(context.envName),
|
|
27212
27037
|
emptySingleRow: true,
|
|
27213
|
-
colSeparationType:
|
|
27038
|
+
colSeparationType: context.envName.includes("at") ? "alignat" : "align",
|
|
27214
27039
|
maxNumCols: isSplit ? 2 : void 0,
|
|
27215
27040
|
leqno: context.parser.settings.leqno
|
|
27216
27041
|
}, "display");
|
|
@@ -27222,18 +27047,18 @@ var alignedHandler = function alignedHandler2(context, args) {
|
|
|
27222
27047
|
body: []
|
|
27223
27048
|
};
|
|
27224
27049
|
if (args[0] && args[0].type === "ordgroup") {
|
|
27225
|
-
var
|
|
27226
|
-
|
|
27227
|
-
|
|
27228
|
-
|
|
27050
|
+
var message = "Number of columns should be a positive integer";
|
|
27051
|
+
var numColumns = assertCharacterGroup(args[0], message);
|
|
27052
|
+
if (!/^[0-9]+$/.test(numColumns) || Number(numColumns) < 1) {
|
|
27053
|
+
throw new ParseError(message, args[0]);
|
|
27229
27054
|
}
|
|
27230
|
-
numMaths = Number(
|
|
27055
|
+
numMaths = Number(numColumns);
|
|
27231
27056
|
numCols = numMaths * 2;
|
|
27232
27057
|
}
|
|
27233
27058
|
var isAligned = !numCols;
|
|
27234
27059
|
res.body.forEach(function(row) {
|
|
27235
|
-
for (var
|
|
27236
|
-
var styling = assertNodeType(row[
|
|
27060
|
+
for (var i2 = 1; i2 < row.length; i2 += 2) {
|
|
27061
|
+
var styling = assertNodeType(row[i2], "styling");
|
|
27237
27062
|
var ordgroup = assertNodeType(styling.body[0], "ordgroup");
|
|
27238
27063
|
ordgroup.body.unshift(emptyGroup);
|
|
27239
27064
|
}
|
|
@@ -27246,15 +27071,15 @@ var alignedHandler = function alignedHandler2(context, args) {
|
|
|
27246
27071
|
numCols = row.length;
|
|
27247
27072
|
}
|
|
27248
27073
|
});
|
|
27249
|
-
for (var
|
|
27074
|
+
for (var i = 0; i < numCols; ++i) {
|
|
27250
27075
|
var align = "r";
|
|
27251
27076
|
var pregap = 0;
|
|
27252
|
-
if (
|
|
27077
|
+
if (i % 2 === 1) {
|
|
27253
27078
|
align = "l";
|
|
27254
|
-
} else if (
|
|
27079
|
+
} else if (i > 0 && isAligned) {
|
|
27255
27080
|
pregap = 1;
|
|
27256
27081
|
}
|
|
27257
|
-
cols[
|
|
27082
|
+
cols[i] = {
|
|
27258
27083
|
type: "align",
|
|
27259
27084
|
align,
|
|
27260
27085
|
pregap,
|
|
@@ -27545,11 +27370,9 @@ defineFunction({
|
|
|
27545
27370
|
type: "text",
|
|
27546
27371
|
// Doesn't matter what this is.
|
|
27547
27372
|
names: ["\\hline", "\\hdashline"],
|
|
27548
|
-
|
|
27549
|
-
|
|
27550
|
-
|
|
27551
|
-
allowedInMath: true
|
|
27552
|
-
},
|
|
27373
|
+
numArgs: 0,
|
|
27374
|
+
allowedInText: true,
|
|
27375
|
+
allowedInMath: true,
|
|
27553
27376
|
handler(context, args) {
|
|
27554
27377
|
throw new ParseError(context.funcName + " valid only within array environment");
|
|
27555
27378
|
}
|
|
@@ -27558,32 +27381,21 @@ var environments = _environments;
|
|
|
27558
27381
|
defineFunction({
|
|
27559
27382
|
type: "environment",
|
|
27560
27383
|
names: ["\\begin", "\\end"],
|
|
27561
|
-
|
|
27562
|
-
|
|
27563
|
-
argTypes: ["text"]
|
|
27564
|
-
},
|
|
27384
|
+
numArgs: 1,
|
|
27385
|
+
argTypes: ["text"],
|
|
27565
27386
|
handler(_ref, args) {
|
|
27566
|
-
var
|
|
27567
|
-
parser: parser2,
|
|
27568
|
-
funcName
|
|
27569
|
-
} = _ref;
|
|
27387
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
27570
27388
|
var nameGroup = args[0];
|
|
27571
27389
|
if (nameGroup.type !== "ordgroup") {
|
|
27572
27390
|
throw new ParseError("Invalid environment name", nameGroup);
|
|
27573
27391
|
}
|
|
27574
|
-
var envName = "";
|
|
27575
|
-
for (var i = 0; i < nameGroup.body.length; ++i) {
|
|
27576
|
-
envName += assertNodeType(nameGroup.body[i], "textord").text;
|
|
27577
|
-
}
|
|
27392
|
+
var envName = assertCharacterGroup(nameGroup, "Environment name should contain only text characters and spaces", true);
|
|
27578
27393
|
if (funcName === "\\begin") {
|
|
27579
|
-
if (!
|
|
27394
|
+
if (!Object.prototype.hasOwnProperty.call(environments, envName)) {
|
|
27580
27395
|
throw new ParseError("No such environment: " + envName, nameGroup);
|
|
27581
27396
|
}
|
|
27582
27397
|
var env = environments[envName];
|
|
27583
|
-
var {
|
|
27584
|
-
args: _args,
|
|
27585
|
-
optArgs
|
|
27586
|
-
} = parser2.parseArguments("\\begin{" + envName + "}", env);
|
|
27398
|
+
var _parser$parseArgument = parser2.parseArguments("\\begin{" + envName + "}", env), _args = _parser$parseArgument.args, optArgs = _parser$parseArgument.optArgs;
|
|
27587
27399
|
var context = {
|
|
27588
27400
|
mode: parser2.mode,
|
|
27589
27401
|
envName,
|
|
@@ -27642,20 +27454,12 @@ defineFunction({
|
|
|
27642
27454
|
"\\bold",
|
|
27643
27455
|
"\\frak"
|
|
27644
27456
|
],
|
|
27645
|
-
|
|
27646
|
-
|
|
27647
|
-
allowedInArgument: true
|
|
27648
|
-
},
|
|
27457
|
+
numArgs: 1,
|
|
27458
|
+
allowedInArgument: true,
|
|
27649
27459
|
handler: (_ref, args) => {
|
|
27650
|
-
var
|
|
27651
|
-
parser: parser2,
|
|
27652
|
-
funcName
|
|
27653
|
-
} = _ref;
|
|
27460
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
27654
27461
|
var body = normalizeArgument(args[0]);
|
|
27655
|
-
var func = funcName;
|
|
27656
|
-
if (func in fontAliases) {
|
|
27657
|
-
func = fontAliases[func];
|
|
27658
|
-
}
|
|
27462
|
+
var func = funcName in fontAliases ? fontAliases[funcName] : funcName;
|
|
27659
27463
|
return {
|
|
27660
27464
|
type: "font",
|
|
27661
27465
|
mode: parser2.mode,
|
|
@@ -27669,13 +27473,9 @@ defineFunction({
|
|
|
27669
27473
|
defineFunction({
|
|
27670
27474
|
type: "mclass",
|
|
27671
27475
|
names: ["\\boldsymbol", "\\bm"],
|
|
27672
|
-
|
|
27673
|
-
numArgs: 1
|
|
27674
|
-
},
|
|
27476
|
+
numArgs: 1,
|
|
27675
27477
|
handler: (_ref2, args) => {
|
|
27676
|
-
var
|
|
27677
|
-
parser: parser2
|
|
27678
|
-
} = _ref2;
|
|
27478
|
+
var parser2 = _ref2.parser;
|
|
27679
27479
|
var body = args[0];
|
|
27680
27480
|
return {
|
|
27681
27481
|
type: "mclass",
|
|
@@ -27694,19 +27494,11 @@ defineFunction({
|
|
|
27694
27494
|
defineFunction({
|
|
27695
27495
|
type: "font",
|
|
27696
27496
|
names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
|
|
27697
|
-
|
|
27698
|
-
|
|
27699
|
-
allowedInText: true
|
|
27700
|
-
},
|
|
27497
|
+
numArgs: 0,
|
|
27498
|
+
allowedInText: true,
|
|
27701
27499
|
handler: (_ref3, args) => {
|
|
27702
|
-
var
|
|
27703
|
-
|
|
27704
|
-
funcName,
|
|
27705
|
-
breakOnTokenText
|
|
27706
|
-
} = _ref3;
|
|
27707
|
-
var {
|
|
27708
|
-
mode
|
|
27709
|
-
} = parser2;
|
|
27500
|
+
var parser2 = _ref3.parser, funcName = _ref3.funcName, breakOnTokenText = _ref3.breakOnTokenText;
|
|
27501
|
+
var mode = parser2.mode;
|
|
27710
27502
|
var body = parser2.parseExpression(true, breakOnTokenText);
|
|
27711
27503
|
return {
|
|
27712
27504
|
type: "font",
|
|
@@ -27718,9 +27510,7 @@ defineFunction({
|
|
|
27718
27510
|
body
|
|
27719
27511
|
}
|
|
27720
27512
|
};
|
|
27721
|
-
}
|
|
27722
|
-
htmlBuilder: htmlBuilder$5,
|
|
27723
|
-
mathmlBuilder: mathmlBuilder$4
|
|
27513
|
+
}
|
|
27724
27514
|
});
|
|
27725
27515
|
var htmlBuilder$4 = (group, options2) => {
|
|
27726
27516
|
var style = options2.style;
|
|
@@ -27900,15 +27690,10 @@ defineFunction({
|
|
|
27900
27690
|
"\\\\brackfrac"
|
|
27901
27691
|
// ditto
|
|
27902
27692
|
],
|
|
27903
|
-
|
|
27904
|
-
|
|
27905
|
-
allowedInArgument: true
|
|
27906
|
-
},
|
|
27693
|
+
numArgs: 2,
|
|
27694
|
+
allowedInArgument: true,
|
|
27907
27695
|
handler: (_ref, args) => {
|
|
27908
|
-
var
|
|
27909
|
-
parser: parser2,
|
|
27910
|
-
funcName
|
|
27911
|
-
} = _ref;
|
|
27696
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
27912
27697
|
var numer = args[0];
|
|
27913
27698
|
var denom = args[1];
|
|
27914
27699
|
var hasBarLine;
|
|
@@ -27969,16 +27754,10 @@ defineFunction({
|
|
|
27969
27754
|
defineFunction({
|
|
27970
27755
|
type: "infix",
|
|
27971
27756
|
names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
|
|
27972
|
-
|
|
27973
|
-
|
|
27974
|
-
infix: true
|
|
27975
|
-
},
|
|
27757
|
+
numArgs: 0,
|
|
27758
|
+
infix: true,
|
|
27976
27759
|
handler(_ref2) {
|
|
27977
|
-
var
|
|
27978
|
-
parser: parser2,
|
|
27979
|
-
funcName,
|
|
27980
|
-
token
|
|
27981
|
-
} = _ref2;
|
|
27760
|
+
var parser2 = _ref2.parser, funcName = _ref2.funcName, token = _ref2.token;
|
|
27982
27761
|
var replaceWith;
|
|
27983
27762
|
switch (funcName) {
|
|
27984
27763
|
case "\\over":
|
|
@@ -28019,15 +27798,11 @@ var delimFromValue = function delimFromValue2(delimString) {
|
|
|
28019
27798
|
defineFunction({
|
|
28020
27799
|
type: "genfrac",
|
|
28021
27800
|
names: ["\\genfrac"],
|
|
28022
|
-
|
|
28023
|
-
|
|
28024
|
-
|
|
28025
|
-
argTypes: ["math", "math", "size", "text", "math", "math"]
|
|
28026
|
-
},
|
|
27801
|
+
numArgs: 6,
|
|
27802
|
+
allowedInArgument: true,
|
|
27803
|
+
argTypes: ["math", "math", "size", "text", "math", "math"],
|
|
28027
27804
|
handler(_ref3, args) {
|
|
28028
|
-
var
|
|
28029
|
-
parser: parser2
|
|
28030
|
-
} = _ref3;
|
|
27805
|
+
var parser2 = _ref3.parser;
|
|
28031
27806
|
var numer = args[4];
|
|
28032
27807
|
var denom = args[5];
|
|
28033
27808
|
var leftNode = normalizeArgument(args[0]);
|
|
@@ -28070,17 +27845,13 @@ defineFunction({
|
|
|
28070
27845
|
defineFunction({
|
|
28071
27846
|
type: "infix",
|
|
28072
27847
|
names: ["\\above"],
|
|
28073
|
-
|
|
28074
|
-
|
|
28075
|
-
|
|
28076
|
-
infix: true
|
|
28077
|
-
},
|
|
27848
|
+
numArgs: 1,
|
|
27849
|
+
argTypes: ["size"],
|
|
27850
|
+
infix: true,
|
|
28078
27851
|
handler(_ref4, args) {
|
|
28079
|
-
var
|
|
28080
|
-
|
|
28081
|
-
|
|
28082
|
-
token
|
|
28083
|
-
} = _ref4;
|
|
27852
|
+
var parser2 = _ref4.parser;
|
|
27853
|
+
_ref4.funcName;
|
|
27854
|
+
var token = _ref4.token;
|
|
28084
27855
|
return {
|
|
28085
27856
|
type: "infix",
|
|
28086
27857
|
mode: parser2.mode,
|
|
@@ -28093,15 +27864,11 @@ defineFunction({
|
|
|
28093
27864
|
defineFunction({
|
|
28094
27865
|
type: "genfrac",
|
|
28095
27866
|
names: ["\\\\abovefrac"],
|
|
28096
|
-
|
|
28097
|
-
|
|
28098
|
-
argTypes: ["math", "size", "math"]
|
|
28099
|
-
},
|
|
27867
|
+
numArgs: 3,
|
|
27868
|
+
argTypes: ["math", "size", "math"],
|
|
28100
27869
|
handler: (_ref5, args) => {
|
|
28101
|
-
var
|
|
28102
|
-
|
|
28103
|
-
funcName
|
|
28104
|
-
} = _ref5;
|
|
27870
|
+
var parser2 = _ref5.parser;
|
|
27871
|
+
_ref5.funcName;
|
|
28105
27872
|
var numer = args[0];
|
|
28106
27873
|
var barSize = assertNodeType(args[1], "infix").size;
|
|
28107
27874
|
if (!barSize) {
|
|
@@ -28209,14 +27976,9 @@ var mathmlBuilder$2 = (group, options2) => {
|
|
|
28209
27976
|
defineFunction({
|
|
28210
27977
|
type: "horizBrace",
|
|
28211
27978
|
names: ["\\overbrace", "\\underbrace", "\\overbracket", "\\underbracket"],
|
|
28212
|
-
|
|
28213
|
-
numArgs: 1
|
|
28214
|
-
},
|
|
27979
|
+
numArgs: 1,
|
|
28215
27980
|
handler(_ref, args) {
|
|
28216
|
-
var
|
|
28217
|
-
parser: parser2,
|
|
28218
|
-
funcName
|
|
28219
|
-
} = _ref;
|
|
27981
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
28220
27982
|
return {
|
|
28221
27983
|
type: "horizBrace",
|
|
28222
27984
|
mode: parser2.mode,
|
|
@@ -28231,15 +27993,11 @@ defineFunction({
|
|
|
28231
27993
|
defineFunction({
|
|
28232
27994
|
type: "href",
|
|
28233
27995
|
names: ["\\href"],
|
|
28234
|
-
|
|
28235
|
-
|
|
28236
|
-
|
|
28237
|
-
allowedInText: true
|
|
28238
|
-
},
|
|
27996
|
+
numArgs: 2,
|
|
27997
|
+
argTypes: ["url", "original"],
|
|
27998
|
+
allowedInText: true,
|
|
28239
27999
|
handler: (_ref, args) => {
|
|
28240
|
-
var
|
|
28241
|
-
parser: parser2
|
|
28242
|
-
} = _ref;
|
|
28000
|
+
var parser2 = _ref.parser;
|
|
28243
28001
|
var body = args[1];
|
|
28244
28002
|
var href = assertNodeType(args[0], "url").url;
|
|
28245
28003
|
if (!parser2.settings.isTrusted({
|
|
@@ -28271,15 +28029,11 @@ defineFunction({
|
|
|
28271
28029
|
defineFunction({
|
|
28272
28030
|
type: "href",
|
|
28273
28031
|
names: ["\\url"],
|
|
28274
|
-
|
|
28275
|
-
|
|
28276
|
-
|
|
28277
|
-
allowedInText: true
|
|
28278
|
-
},
|
|
28032
|
+
numArgs: 1,
|
|
28033
|
+
argTypes: ["url"],
|
|
28034
|
+
allowedInText: true,
|
|
28279
28035
|
handler: (_ref2, args) => {
|
|
28280
|
-
var
|
|
28281
|
-
parser: parser2
|
|
28282
|
-
} = _ref2;
|
|
28036
|
+
var parser2 = _ref2.parser;
|
|
28283
28037
|
var href = assertNodeType(args[0], "url").url;
|
|
28284
28038
|
if (!parser2.settings.isTrusted({
|
|
28285
28039
|
command: "\\url",
|
|
@@ -28316,16 +28070,12 @@ defineFunction({
|
|
|
28316
28070
|
defineFunction({
|
|
28317
28071
|
type: "hbox",
|
|
28318
28072
|
names: ["\\hbox"],
|
|
28319
|
-
|
|
28320
|
-
|
|
28321
|
-
|
|
28322
|
-
|
|
28323
|
-
primitive: true
|
|
28324
|
-
},
|
|
28073
|
+
numArgs: 1,
|
|
28074
|
+
argTypes: ["text"],
|
|
28075
|
+
allowedInText: true,
|
|
28076
|
+
primitive: true,
|
|
28325
28077
|
handler(_ref, args) {
|
|
28326
|
-
var
|
|
28327
|
-
parser: parser2
|
|
28328
|
-
} = _ref;
|
|
28078
|
+
var parser2 = _ref.parser;
|
|
28329
28079
|
return {
|
|
28330
28080
|
type: "hbox",
|
|
28331
28081
|
mode: parser2.mode,
|
|
@@ -28343,21 +28093,21 @@ defineFunction({
|
|
|
28343
28093
|
defineFunction({
|
|
28344
28094
|
type: "html",
|
|
28345
28095
|
names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
|
|
28346
|
-
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
allowedInText: true
|
|
28350
|
-
},
|
|
28096
|
+
numArgs: 2,
|
|
28097
|
+
argTypes: ["raw", "original"],
|
|
28098
|
+
allowedInText: true,
|
|
28351
28099
|
handler: (_ref, args) => {
|
|
28352
|
-
var
|
|
28353
|
-
|
|
28354
|
-
funcName,
|
|
28355
|
-
token
|
|
28356
|
-
} = _ref;
|
|
28100
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
28101
|
+
_ref.token;
|
|
28357
28102
|
var value = assertNodeType(args[0], "raw").string;
|
|
28358
28103
|
var body = args[1];
|
|
28359
28104
|
if (parser2.settings.strict) {
|
|
28360
|
-
|
|
28105
|
+
handleStrict({
|
|
28106
|
+
strict: parser2.settings.strict,
|
|
28107
|
+
errorCode: "htmlExtension",
|
|
28108
|
+
errorMsg: "HTML extension is disabled on strict mode",
|
|
28109
|
+
report: true
|
|
28110
|
+
});
|
|
28361
28111
|
}
|
|
28362
28112
|
var trustContext;
|
|
28363
28113
|
var attributes = {};
|
|
@@ -28384,9 +28134,23 @@ defineFunction({
|
|
|
28384
28134
|
};
|
|
28385
28135
|
break;
|
|
28386
28136
|
case "\\htmlData": {
|
|
28387
|
-
var
|
|
28388
|
-
|
|
28389
|
-
|
|
28137
|
+
var ESCAPED_COMMA = "{,}";
|
|
28138
|
+
var data2 = [];
|
|
28139
|
+
var current = "";
|
|
28140
|
+
for (var i = 0; i < value.length; i++) {
|
|
28141
|
+
if (value.startsWith(ESCAPED_COMMA, i)) {
|
|
28142
|
+
current += ",";
|
|
28143
|
+
i += ESCAPED_COMMA.length - 1;
|
|
28144
|
+
} else if (value[i] === ",") {
|
|
28145
|
+
data2.push(current);
|
|
28146
|
+
current = "";
|
|
28147
|
+
} else {
|
|
28148
|
+
current += value[i];
|
|
28149
|
+
}
|
|
28150
|
+
}
|
|
28151
|
+
data2.push(current);
|
|
28152
|
+
for (var _i = 0; _i < data2.length; _i++) {
|
|
28153
|
+
var item = data2[_i];
|
|
28390
28154
|
var firstEquals = item.indexOf("=");
|
|
28391
28155
|
if (firstEquals < 0) {
|
|
28392
28156
|
throw new ParseError("\\htmlData key/value '" + item + "' missing equals sign");
|
|
@@ -28421,9 +28185,11 @@ defineFunction({
|
|
|
28421
28185
|
classes.push(...group.attributes.class.trim().split(/\s+/));
|
|
28422
28186
|
}
|
|
28423
28187
|
var span = makeSpan(classes, elements, options2);
|
|
28424
|
-
for (var
|
|
28425
|
-
|
|
28426
|
-
|
|
28188
|
+
for (var _ref3 of Object.entries(group.attributes)) {
|
|
28189
|
+
var attr = _ref3[0];
|
|
28190
|
+
var value = _ref3[1];
|
|
28191
|
+
if (attr !== "class") {
|
|
28192
|
+
span.setAttribute(attr, value);
|
|
28427
28193
|
}
|
|
28428
28194
|
}
|
|
28429
28195
|
return span;
|
|
@@ -28435,15 +28201,11 @@ defineFunction({
|
|
|
28435
28201
|
defineFunction({
|
|
28436
28202
|
type: "htmlmathml",
|
|
28437
28203
|
names: ["\\html@mathml"],
|
|
28438
|
-
|
|
28439
|
-
|
|
28440
|
-
|
|
28441
|
-
allowedInText: true
|
|
28442
|
-
},
|
|
28204
|
+
numArgs: 2,
|
|
28205
|
+
allowedInArgument: true,
|
|
28206
|
+
allowedInText: true,
|
|
28443
28207
|
handler: (_ref, args) => {
|
|
28444
|
-
var
|
|
28445
|
-
parser: parser2
|
|
28446
|
-
} = _ref;
|
|
28208
|
+
var parser2 = _ref.parser;
|
|
28447
28209
|
return {
|
|
28448
28210
|
type: "htmlmathml",
|
|
28449
28211
|
mode: parser2.mode,
|
|
@@ -28484,16 +28246,12 @@ var sizeData = function sizeData2(str) {
|
|
|
28484
28246
|
defineFunction({
|
|
28485
28247
|
type: "includegraphics",
|
|
28486
28248
|
names: ["\\includegraphics"],
|
|
28487
|
-
|
|
28488
|
-
|
|
28489
|
-
|
|
28490
|
-
|
|
28491
|
-
allowedInText: false
|
|
28492
|
-
},
|
|
28249
|
+
numArgs: 1,
|
|
28250
|
+
numOptionalArgs: 1,
|
|
28251
|
+
argTypes: ["raw", "url"],
|
|
28252
|
+
allowedInText: false,
|
|
28493
28253
|
handler: (_ref, args, optArgs) => {
|
|
28494
|
-
var
|
|
28495
|
-
parser: parser2
|
|
28496
|
-
} = _ref;
|
|
28254
|
+
var parser2 = _ref.parser;
|
|
28497
28255
|
var width = {
|
|
28498
28256
|
number: 0,
|
|
28499
28257
|
unit: "em"
|
|
@@ -28600,31 +28358,41 @@ defineFunction({
|
|
|
28600
28358
|
defineFunction({
|
|
28601
28359
|
type: "kern",
|
|
28602
28360
|
names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
|
|
28603
|
-
|
|
28604
|
-
|
|
28605
|
-
|
|
28606
|
-
|
|
28607
|
-
allowedInText: true
|
|
28608
|
-
},
|
|
28361
|
+
numArgs: 1,
|
|
28362
|
+
argTypes: ["size"],
|
|
28363
|
+
primitive: true,
|
|
28364
|
+
allowedInText: true,
|
|
28609
28365
|
handler(_ref, args) {
|
|
28610
|
-
var
|
|
28611
|
-
parser: parser2,
|
|
28612
|
-
funcName
|
|
28613
|
-
} = _ref;
|
|
28366
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
28614
28367
|
var size = assertNodeType(args[0], "size");
|
|
28615
28368
|
if (parser2.settings.strict) {
|
|
28616
28369
|
var mathFunction = funcName[1] === "m";
|
|
28617
28370
|
var muUnit = size.value.unit === "mu";
|
|
28618
28371
|
if (mathFunction) {
|
|
28619
28372
|
if (!muUnit) {
|
|
28620
|
-
|
|
28373
|
+
handleStrict({
|
|
28374
|
+
strict: parser2.settings.strict,
|
|
28375
|
+
errorCode: "mathVsTextUnits",
|
|
28376
|
+
errorMsg: "LaTeX's " + funcName + " supports only mu units, " + ("not " + size.value.unit + " units"),
|
|
28377
|
+
report: true
|
|
28378
|
+
});
|
|
28621
28379
|
}
|
|
28622
28380
|
if (parser2.mode !== "math") {
|
|
28623
|
-
|
|
28381
|
+
handleStrict({
|
|
28382
|
+
strict: parser2.settings.strict,
|
|
28383
|
+
errorCode: "mathVsTextUnits",
|
|
28384
|
+
errorMsg: "LaTeX's " + funcName + " works only in math mode",
|
|
28385
|
+
report: true
|
|
28386
|
+
});
|
|
28624
28387
|
}
|
|
28625
28388
|
} else {
|
|
28626
28389
|
if (muUnit) {
|
|
28627
|
-
|
|
28390
|
+
handleStrict({
|
|
28391
|
+
strict: parser2.settings.strict,
|
|
28392
|
+
errorCode: "mathVsTextUnits",
|
|
28393
|
+
errorMsg: "LaTeX's " + funcName + " doesn't support mu units",
|
|
28394
|
+
report: true
|
|
28395
|
+
});
|
|
28628
28396
|
}
|
|
28629
28397
|
}
|
|
28630
28398
|
}
|
|
@@ -28645,15 +28413,10 @@ defineFunction({
|
|
|
28645
28413
|
defineFunction({
|
|
28646
28414
|
type: "lap",
|
|
28647
28415
|
names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
|
|
28648
|
-
|
|
28649
|
-
|
|
28650
|
-
allowedInText: true
|
|
28651
|
-
},
|
|
28416
|
+
numArgs: 1,
|
|
28417
|
+
allowedInText: true,
|
|
28652
28418
|
handler: (_ref, args) => {
|
|
28653
|
-
var
|
|
28654
|
-
parser: parser2,
|
|
28655
|
-
funcName
|
|
28656
|
-
} = _ref;
|
|
28419
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
28657
28420
|
var body = args[0];
|
|
28658
28421
|
return {
|
|
28659
28422
|
type: "lap",
|
|
@@ -28666,20 +28429,20 @@ defineFunction({
|
|
|
28666
28429
|
var inner2;
|
|
28667
28430
|
if (group.alignment === "clap") {
|
|
28668
28431
|
inner2 = makeSpan([], [buildGroup$1(group.body, options2)]);
|
|
28669
|
-
inner2 = makeSpan(["inner"], [inner2], options2);
|
|
28432
|
+
inner2 = makeSpan(["katex-inner"], [inner2], options2);
|
|
28670
28433
|
} else {
|
|
28671
|
-
inner2 = makeSpan(["inner"], [buildGroup$1(group.body, options2)]);
|
|
28434
|
+
inner2 = makeSpan(["katex-inner"], [buildGroup$1(group.body, options2)]);
|
|
28672
28435
|
}
|
|
28673
|
-
var fix = makeSpan(["fix"], []);
|
|
28436
|
+
var fix = makeSpan(["katex-fix"], []);
|
|
28674
28437
|
var node = makeSpan([group.alignment], [inner2, fix], options2);
|
|
28675
|
-
var strut = makeSpan(["strut"]);
|
|
28438
|
+
var strut = makeSpan(["katex-strut"]);
|
|
28676
28439
|
strut.style.height = makeEm(node.height + node.depth);
|
|
28677
28440
|
if (node.depth) {
|
|
28678
28441
|
strut.style.verticalAlign = makeEm(-node.depth);
|
|
28679
28442
|
}
|
|
28680
28443
|
node.children.unshift(strut);
|
|
28681
|
-
node = makeSpan(["thinbox"], [node], options2);
|
|
28682
|
-
return makeSpan(["mord", "vbox"], [node], options2);
|
|
28444
|
+
node = makeSpan(["katex-thinbox"], [node], options2);
|
|
28445
|
+
return makeSpan(["mord", "katex-vbox"], [node], options2);
|
|
28683
28446
|
},
|
|
28684
28447
|
mathmlBuilder: (group, options2) => {
|
|
28685
28448
|
var node = new MathNode("mpadded", [buildGroup2(group.body, options2)]);
|
|
@@ -28694,16 +28457,11 @@ defineFunction({
|
|
|
28694
28457
|
defineFunction({
|
|
28695
28458
|
type: "styling",
|
|
28696
28459
|
names: ["\\(", "$"],
|
|
28697
|
-
|
|
28698
|
-
|
|
28699
|
-
|
|
28700
|
-
allowedInMath: false
|
|
28701
|
-
},
|
|
28460
|
+
numArgs: 0,
|
|
28461
|
+
allowedInText: true,
|
|
28462
|
+
allowedInMath: false,
|
|
28702
28463
|
handler(_ref, args) {
|
|
28703
|
-
var
|
|
28704
|
-
funcName,
|
|
28705
|
-
parser: parser2
|
|
28706
|
-
} = _ref;
|
|
28464
|
+
var funcName = _ref.funcName, parser2 = _ref.parser;
|
|
28707
28465
|
var outerMode = parser2.mode;
|
|
28708
28466
|
parser2.switchMode("math");
|
|
28709
28467
|
var close2 = funcName === "\\(" ? "\\)" : "$";
|
|
@@ -28723,11 +28481,9 @@ defineFunction({
|
|
|
28723
28481
|
type: "text",
|
|
28724
28482
|
// Doesn't matter what this is.
|
|
28725
28483
|
names: ["\\)", "\\]"],
|
|
28726
|
-
|
|
28727
|
-
|
|
28728
|
-
|
|
28729
|
-
allowedInMath: false
|
|
28730
|
-
},
|
|
28484
|
+
numArgs: 0,
|
|
28485
|
+
allowedInText: true,
|
|
28486
|
+
allowedInMath: false,
|
|
28731
28487
|
handler(context, args) {
|
|
28732
28488
|
throw new ParseError("Mismatched " + context.funcName);
|
|
28733
28489
|
}
|
|
@@ -28749,14 +28505,10 @@ var chooseMathStyle = (group, options2) => {
|
|
|
28749
28505
|
defineFunction({
|
|
28750
28506
|
type: "mathchoice",
|
|
28751
28507
|
names: ["\\mathchoice"],
|
|
28752
|
-
|
|
28753
|
-
|
|
28754
|
-
primitive: true
|
|
28755
|
-
},
|
|
28508
|
+
numArgs: 4,
|
|
28509
|
+
primitive: true,
|
|
28756
28510
|
handler: (_ref, args) => {
|
|
28757
|
-
var
|
|
28758
|
-
parser: parser2
|
|
28759
|
-
} = _ref;
|
|
28511
|
+
var parser2 = _ref.parser;
|
|
28760
28512
|
return {
|
|
28761
28513
|
type: "mathchoice",
|
|
28762
28514
|
mode: parser2.mode,
|
|
@@ -28994,14 +28746,9 @@ var singleCharBigOps = {
|
|
|
28994
28746
|
defineFunction({
|
|
28995
28747
|
type: "op",
|
|
28996
28748
|
names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "∏", "∐", "∑", "⋀", "⋁", "⋂", "⋃", "⨀", "⨁", "⨂", "⨄", "⨆"],
|
|
28997
|
-
|
|
28998
|
-
numArgs: 0
|
|
28999
|
-
},
|
|
28749
|
+
numArgs: 0,
|
|
29000
28750
|
handler: (_ref, args) => {
|
|
29001
|
-
var
|
|
29002
|
-
parser: parser2,
|
|
29003
|
-
funcName
|
|
29004
|
-
} = _ref;
|
|
28751
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
29005
28752
|
var fName = funcName;
|
|
29006
28753
|
if (fName.length === 1) {
|
|
29007
28754
|
fName = singleCharBigOps[fName];
|
|
@@ -29021,14 +28768,10 @@ defineFunction({
|
|
|
29021
28768
|
defineFunction({
|
|
29022
28769
|
type: "op",
|
|
29023
28770
|
names: ["\\mathop"],
|
|
29024
|
-
|
|
29025
|
-
|
|
29026
|
-
primitive: true
|
|
29027
|
-
},
|
|
28771
|
+
numArgs: 1,
|
|
28772
|
+
primitive: true,
|
|
29028
28773
|
handler: (_ref2, args) => {
|
|
29029
|
-
var
|
|
29030
|
-
parser: parser2
|
|
29031
|
-
} = _ref2;
|
|
28774
|
+
var parser2 = _ref2.parser;
|
|
29032
28775
|
var body = args[0];
|
|
29033
28776
|
return {
|
|
29034
28777
|
type: "op",
|
|
@@ -29038,9 +28781,7 @@ defineFunction({
|
|
|
29038
28781
|
symbol: false,
|
|
29039
28782
|
body: ordargument(body)
|
|
29040
28783
|
};
|
|
29041
|
-
}
|
|
29042
|
-
htmlBuilder: htmlBuilder$2,
|
|
29043
|
-
mathmlBuilder: mathmlBuilder$1
|
|
28784
|
+
}
|
|
29044
28785
|
});
|
|
29045
28786
|
var singleCharIntegrals = {
|
|
29046
28787
|
"∫": "\\int",
|
|
@@ -29053,14 +28794,9 @@ var singleCharIntegrals = {
|
|
|
29053
28794
|
defineFunction({
|
|
29054
28795
|
type: "op",
|
|
29055
28796
|
names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"],
|
|
29056
|
-
|
|
29057
|
-
numArgs: 0
|
|
29058
|
-
},
|
|
28797
|
+
numArgs: 0,
|
|
29059
28798
|
handler(_ref3) {
|
|
29060
|
-
var
|
|
29061
|
-
parser: parser2,
|
|
29062
|
-
funcName
|
|
29063
|
-
} = _ref3;
|
|
28799
|
+
var parser2 = _ref3.parser, funcName = _ref3.funcName;
|
|
29064
28800
|
return {
|
|
29065
28801
|
type: "op",
|
|
29066
28802
|
mode: parser2.mode,
|
|
@@ -29069,21 +28805,14 @@ defineFunction({
|
|
|
29069
28805
|
symbol: false,
|
|
29070
28806
|
name: funcName
|
|
29071
28807
|
};
|
|
29072
|
-
}
|
|
29073
|
-
htmlBuilder: htmlBuilder$2,
|
|
29074
|
-
mathmlBuilder: mathmlBuilder$1
|
|
28808
|
+
}
|
|
29075
28809
|
});
|
|
29076
28810
|
defineFunction({
|
|
29077
28811
|
type: "op",
|
|
29078
28812
|
names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
|
|
29079
|
-
|
|
29080
|
-
numArgs: 0
|
|
29081
|
-
},
|
|
28813
|
+
numArgs: 0,
|
|
29082
28814
|
handler(_ref4) {
|
|
29083
|
-
var
|
|
29084
|
-
parser: parser2,
|
|
29085
|
-
funcName
|
|
29086
|
-
} = _ref4;
|
|
28815
|
+
var parser2 = _ref4.parser, funcName = _ref4.funcName;
|
|
29087
28816
|
return {
|
|
29088
28817
|
type: "op",
|
|
29089
28818
|
mode: parser2.mode,
|
|
@@ -29092,22 +28821,15 @@ defineFunction({
|
|
|
29092
28821
|
symbol: false,
|
|
29093
28822
|
name: funcName
|
|
29094
28823
|
};
|
|
29095
|
-
}
|
|
29096
|
-
htmlBuilder: htmlBuilder$2,
|
|
29097
|
-
mathmlBuilder: mathmlBuilder$1
|
|
28824
|
+
}
|
|
29098
28825
|
});
|
|
29099
28826
|
defineFunction({
|
|
29100
28827
|
type: "op",
|
|
29101
28828
|
names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "∫", "∬", "∭", "∮", "∯", "∰"],
|
|
29102
|
-
|
|
29103
|
-
|
|
29104
|
-
allowedInArgument: true
|
|
29105
|
-
},
|
|
28829
|
+
numArgs: 0,
|
|
28830
|
+
allowedInArgument: true,
|
|
29106
28831
|
handler(_ref5) {
|
|
29107
|
-
var
|
|
29108
|
-
parser: parser2,
|
|
29109
|
-
funcName
|
|
29110
|
-
} = _ref5;
|
|
28832
|
+
var parser2 = _ref5.parser, funcName = _ref5.funcName;
|
|
29111
28833
|
var fName = funcName;
|
|
29112
28834
|
if (fName.length === 1) {
|
|
29113
28835
|
fName = singleCharIntegrals[fName];
|
|
@@ -29120,9 +28842,7 @@ defineFunction({
|
|
|
29120
28842
|
symbol: true,
|
|
29121
28843
|
name: fName
|
|
29122
28844
|
};
|
|
29123
|
-
}
|
|
29124
|
-
htmlBuilder: htmlBuilder$2,
|
|
29125
|
-
mathmlBuilder: mathmlBuilder$1
|
|
28845
|
+
}
|
|
29126
28846
|
});
|
|
29127
28847
|
var htmlBuilder$1 = (grp, options2) => {
|
|
29128
28848
|
var supGroup;
|
|
@@ -29214,14 +28934,9 @@ var mathmlBuilder2 = (group, options2) => {
|
|
|
29214
28934
|
defineFunction({
|
|
29215
28935
|
type: "operatorname",
|
|
29216
28936
|
names: ["\\operatorname@", "\\operatornamewithlimits"],
|
|
29217
|
-
|
|
29218
|
-
numArgs: 1
|
|
29219
|
-
},
|
|
28937
|
+
numArgs: 1,
|
|
29220
28938
|
handler: (_ref, args) => {
|
|
29221
|
-
var
|
|
29222
|
-
parser: parser2,
|
|
29223
|
-
funcName
|
|
29224
|
-
} = _ref;
|
|
28939
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
29225
28940
|
var body = args[0];
|
|
29226
28941
|
return {
|
|
29227
28942
|
type: "operatorname",
|
|
@@ -29251,13 +28966,9 @@ defineFunctionBuilders({
|
|
|
29251
28966
|
defineFunction({
|
|
29252
28967
|
type: "overline",
|
|
29253
28968
|
names: ["\\overline"],
|
|
29254
|
-
|
|
29255
|
-
numArgs: 1
|
|
29256
|
-
},
|
|
28969
|
+
numArgs: 1,
|
|
29257
28970
|
handler(_ref, args) {
|
|
29258
|
-
var
|
|
29259
|
-
parser: parser2
|
|
29260
|
-
} = _ref;
|
|
28971
|
+
var parser2 = _ref.parser;
|
|
29261
28972
|
var body = args[0];
|
|
29262
28973
|
return {
|
|
29263
28974
|
type: "overline",
|
|
@@ -29285,7 +28996,7 @@ defineFunction({
|
|
|
29285
28996
|
size: defaultRuleThickness
|
|
29286
28997
|
}]
|
|
29287
28998
|
});
|
|
29288
|
-
return makeSpan(["mord", "overline"], [vlist], options2);
|
|
28999
|
+
return makeSpan(["mord", "katex-overline"], [vlist], options2);
|
|
29289
29000
|
},
|
|
29290
29001
|
mathmlBuilder(group, options2) {
|
|
29291
29002
|
var operator2 = new MathNode("mo", [new TextNode2("‾")]);
|
|
@@ -29298,14 +29009,10 @@ defineFunction({
|
|
|
29298
29009
|
defineFunction({
|
|
29299
29010
|
type: "phantom",
|
|
29300
29011
|
names: ["\\phantom"],
|
|
29301
|
-
|
|
29302
|
-
|
|
29303
|
-
allowedInText: true
|
|
29304
|
-
},
|
|
29012
|
+
numArgs: 1,
|
|
29013
|
+
allowedInText: true,
|
|
29305
29014
|
handler: (_ref, args) => {
|
|
29306
|
-
var
|
|
29307
|
-
parser: parser2
|
|
29308
|
-
} = _ref;
|
|
29015
|
+
var parser2 = _ref.parser;
|
|
29309
29016
|
var body = args[0];
|
|
29310
29017
|
return {
|
|
29311
29018
|
type: "phantom",
|
|
@@ -29326,14 +29033,10 @@ defineMacro("\\hphantom", "\\smash{\\phantom{#1}}");
|
|
|
29326
29033
|
defineFunction({
|
|
29327
29034
|
type: "vphantom",
|
|
29328
29035
|
names: ["\\vphantom"],
|
|
29329
|
-
|
|
29330
|
-
|
|
29331
|
-
allowedInText: true
|
|
29332
|
-
},
|
|
29036
|
+
numArgs: 1,
|
|
29037
|
+
allowedInText: true,
|
|
29333
29038
|
handler: (_ref2, args) => {
|
|
29334
|
-
var
|
|
29335
|
-
parser: parser2
|
|
29336
|
-
} = _ref2;
|
|
29039
|
+
var parser2 = _ref2.parser;
|
|
29337
29040
|
var body = args[0];
|
|
29338
29041
|
return {
|
|
29339
29042
|
type: "vphantom",
|
|
@@ -29342,8 +29045,8 @@ defineFunction({
|
|
|
29342
29045
|
};
|
|
29343
29046
|
},
|
|
29344
29047
|
htmlBuilder: (group, options2) => {
|
|
29345
|
-
var inner2 = makeSpan(["inner"], [buildGroup$1(group.body, options2.withPhantom())]);
|
|
29346
|
-
var fix = makeSpan(["fix"], []);
|
|
29048
|
+
var inner2 = makeSpan(["katex-inner"], [buildGroup$1(group.body, options2.withPhantom())]);
|
|
29049
|
+
var fix = makeSpan(["katex-fix"], []);
|
|
29347
29050
|
return makeSpan(["mord", "rlap"], [inner2, fix], options2);
|
|
29348
29051
|
},
|
|
29349
29052
|
mathmlBuilder: (group, options2) => {
|
|
@@ -29357,15 +29060,11 @@ defineFunction({
|
|
|
29357
29060
|
defineFunction({
|
|
29358
29061
|
type: "raisebox",
|
|
29359
29062
|
names: ["\\raisebox"],
|
|
29360
|
-
|
|
29361
|
-
|
|
29362
|
-
|
|
29363
|
-
allowedInText: true
|
|
29364
|
-
},
|
|
29063
|
+
numArgs: 2,
|
|
29064
|
+
argTypes: ["size", "hbox"],
|
|
29065
|
+
allowedInText: true,
|
|
29365
29066
|
handler(_ref, args) {
|
|
29366
|
-
var
|
|
29367
|
-
parser: parser2
|
|
29368
|
-
} = _ref;
|
|
29067
|
+
var parser2 = _ref.parser;
|
|
29369
29068
|
var amount = assertNodeType(args[0], "size").value;
|
|
29370
29069
|
var body = args[1];
|
|
29371
29070
|
return {
|
|
@@ -29394,18 +29093,43 @@ defineFunction({
|
|
|
29394
29093
|
return node;
|
|
29395
29094
|
}
|
|
29396
29095
|
});
|
|
29096
|
+
var handler = (_ref, args) => {
|
|
29097
|
+
var parser2 = _ref.parser;
|
|
29098
|
+
return {
|
|
29099
|
+
type: "reflectbox",
|
|
29100
|
+
mode: parser2.mode,
|
|
29101
|
+
body: args[0]
|
|
29102
|
+
};
|
|
29103
|
+
};
|
|
29104
|
+
defineFunction({
|
|
29105
|
+
type: "reflectbox",
|
|
29106
|
+
names: ["\\reflectbox"],
|
|
29107
|
+
numArgs: 1,
|
|
29108
|
+
argTypes: ["hbox"],
|
|
29109
|
+
allowedInText: true,
|
|
29110
|
+
handler,
|
|
29111
|
+
htmlBuilder(group, options2) {
|
|
29112
|
+
return makeSpan(["mord", "reflectbox"], [buildGroup$1(group.body, options2)], options2);
|
|
29113
|
+
},
|
|
29114
|
+
mathmlBuilder(group, options2) {
|
|
29115
|
+
return buildGroup2(group.body, options2);
|
|
29116
|
+
}
|
|
29117
|
+
});
|
|
29118
|
+
defineFunction({
|
|
29119
|
+
type: "reflectbox",
|
|
29120
|
+
names: ["\\mathreflectbox"],
|
|
29121
|
+
numArgs: 1,
|
|
29122
|
+
argTypes: ["math"],
|
|
29123
|
+
handler
|
|
29124
|
+
});
|
|
29397
29125
|
defineFunction({
|
|
29398
29126
|
type: "internal",
|
|
29399
29127
|
names: ["\\relax"],
|
|
29400
|
-
|
|
29401
|
-
|
|
29402
|
-
|
|
29403
|
-
allowedInArgument: true
|
|
29404
|
-
},
|
|
29128
|
+
numArgs: 0,
|
|
29129
|
+
allowedInText: true,
|
|
29130
|
+
allowedInArgument: true,
|
|
29405
29131
|
handler(_ref) {
|
|
29406
|
-
var
|
|
29407
|
-
parser: parser2
|
|
29408
|
-
} = _ref;
|
|
29132
|
+
var parser2 = _ref.parser;
|
|
29409
29133
|
return {
|
|
29410
29134
|
type: "internal",
|
|
29411
29135
|
mode: parser2.mode
|
|
@@ -29415,17 +29139,13 @@ defineFunction({
|
|
|
29415
29139
|
defineFunction({
|
|
29416
29140
|
type: "rule",
|
|
29417
29141
|
names: ["\\rule"],
|
|
29418
|
-
|
|
29419
|
-
|
|
29420
|
-
|
|
29421
|
-
|
|
29422
|
-
|
|
29423
|
-
argTypes: ["size", "size", "size"]
|
|
29424
|
-
},
|
|
29142
|
+
numArgs: 2,
|
|
29143
|
+
numOptionalArgs: 1,
|
|
29144
|
+
allowedInText: true,
|
|
29145
|
+
allowedInMath: true,
|
|
29146
|
+
argTypes: ["size", "size", "size"],
|
|
29425
29147
|
handler(_ref, args, optArgs) {
|
|
29426
|
-
var
|
|
29427
|
-
parser: parser2
|
|
29428
|
-
} = _ref;
|
|
29148
|
+
var parser2 = _ref.parser;
|
|
29429
29149
|
var shift2 = optArgs[0];
|
|
29430
29150
|
var width = assertNodeType(args[0], "size");
|
|
29431
29151
|
var height = assertNodeType(args[1], "size");
|
|
@@ -29438,7 +29158,7 @@ defineFunction({
|
|
|
29438
29158
|
};
|
|
29439
29159
|
},
|
|
29440
29160
|
htmlBuilder(group, options2) {
|
|
29441
|
-
var rule = makeSpan(["mord", "rule"], [], options2);
|
|
29161
|
+
var rule = makeSpan(["mord", "katex-rule"], [], options2);
|
|
29442
29162
|
var width = calculateSize(group.width, options2);
|
|
29443
29163
|
var height = calculateSize(group.height, options2);
|
|
29444
29164
|
var shift2 = group.shift ? calculateSize(group.shift, options2) : 0;
|
|
@@ -29475,7 +29195,7 @@ function sizingGroup(value, options2, baseOptions) {
|
|
|
29475
29195
|
var inner2 = buildExpression$1(value, options2, false);
|
|
29476
29196
|
var multiplier = options2.sizeMultiplier / baseOptions.sizeMultiplier;
|
|
29477
29197
|
for (var i = 0; i < inner2.length; i++) {
|
|
29478
|
-
var pos = inner2[i].classes.indexOf("sizing");
|
|
29198
|
+
var pos = inner2[i].classes.indexOf("katex-sizing");
|
|
29479
29199
|
if (pos < 0) {
|
|
29480
29200
|
Array.prototype.push.apply(inner2[i].classes, options2.sizingClasses(baseOptions));
|
|
29481
29201
|
} else if (inner2[i].classes[pos + 1] === "reset-size" + options2.size) {
|
|
@@ -29494,16 +29214,10 @@ var htmlBuilder2 = (group, options2) => {
|
|
|
29494
29214
|
defineFunction({
|
|
29495
29215
|
type: "sizing",
|
|
29496
29216
|
names: sizeFuncs,
|
|
29497
|
-
|
|
29498
|
-
|
|
29499
|
-
allowedInText: true
|
|
29500
|
-
},
|
|
29217
|
+
numArgs: 0,
|
|
29218
|
+
allowedInText: true,
|
|
29501
29219
|
handler: (_ref, args) => {
|
|
29502
|
-
var
|
|
29503
|
-
breakOnTokenText,
|
|
29504
|
-
funcName,
|
|
29505
|
-
parser: parser2
|
|
29506
|
-
} = _ref;
|
|
29220
|
+
var breakOnTokenText = _ref.breakOnTokenText, funcName = _ref.funcName, parser2 = _ref.parser;
|
|
29507
29221
|
var body = parser2.parseExpression(false, breakOnTokenText);
|
|
29508
29222
|
return {
|
|
29509
29223
|
type: "sizing",
|
|
@@ -29525,15 +29239,11 @@ defineFunction({
|
|
|
29525
29239
|
defineFunction({
|
|
29526
29240
|
type: "smash",
|
|
29527
29241
|
names: ["\\smash"],
|
|
29528
|
-
|
|
29529
|
-
|
|
29530
|
-
|
|
29531
|
-
allowedInText: true
|
|
29532
|
-
},
|
|
29242
|
+
numArgs: 1,
|
|
29243
|
+
numOptionalArgs: 1,
|
|
29244
|
+
allowedInText: true,
|
|
29533
29245
|
handler: (_ref, args, optArgs) => {
|
|
29534
|
-
var
|
|
29535
|
-
parser: parser2
|
|
29536
|
-
} = _ref;
|
|
29246
|
+
var parser2 = _ref.parser;
|
|
29537
29247
|
var smashHeight = false;
|
|
29538
29248
|
var smashDepth = false;
|
|
29539
29249
|
var tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup");
|
|
@@ -29577,7 +29287,7 @@ defineFunction({
|
|
|
29577
29287
|
node.depth = 0;
|
|
29578
29288
|
}
|
|
29579
29289
|
if (group.smashHeight && group.smashDepth) {
|
|
29580
|
-
return makeSpan(["mord", "smash"], [node], options2);
|
|
29290
|
+
return makeSpan(["mord", "katex-smash"], [node], options2);
|
|
29581
29291
|
}
|
|
29582
29292
|
if (node.children) {
|
|
29583
29293
|
for (var i = 0; i < node.children.length; i++) {
|
|
@@ -29612,14 +29322,10 @@ defineFunction({
|
|
|
29612
29322
|
defineFunction({
|
|
29613
29323
|
type: "sqrt",
|
|
29614
29324
|
names: ["\\sqrt"],
|
|
29615
|
-
|
|
29616
|
-
|
|
29617
|
-
numOptionalArgs: 1
|
|
29618
|
-
},
|
|
29325
|
+
numArgs: 1,
|
|
29326
|
+
numOptionalArgs: 1,
|
|
29619
29327
|
handler(_ref, args, optArgs) {
|
|
29620
|
-
var
|
|
29621
|
-
parser: parser2
|
|
29622
|
-
} = _ref;
|
|
29328
|
+
var parser2 = _ref.parser;
|
|
29623
29329
|
var index2 = optArgs[0];
|
|
29624
29330
|
var body = args[0];
|
|
29625
29331
|
return {
|
|
@@ -29643,11 +29349,7 @@ defineFunction({
|
|
|
29643
29349
|
}
|
|
29644
29350
|
var lineClearance = theta + phi / 4;
|
|
29645
29351
|
var minDelimiterHeight = inner2.height + inner2.depth + lineClearance + theta;
|
|
29646
|
-
var
|
|
29647
|
-
span: img,
|
|
29648
|
-
ruleWidth,
|
|
29649
|
-
advanceWidth
|
|
29650
|
-
} = makeSqrtImage(minDelimiterHeight, options2);
|
|
29352
|
+
var _makeSqrtImage = makeSqrtImage(minDelimiterHeight, options2), img = _makeSqrtImage.span, ruleWidth = _makeSqrtImage.ruleWidth, advanceWidth = _makeSqrtImage.advanceWidth;
|
|
29651
29353
|
var delimDepth = img.height - ruleWidth;
|
|
29652
29354
|
if (delimDepth > inner2.height + inner2.depth + lineClearance) {
|
|
29653
29355
|
lineClearance = (lineClearance + delimDepth - inner2.height - inner2.depth) / 2;
|
|
@@ -29685,15 +29387,12 @@ defineFunction({
|
|
|
29685
29387
|
elem: rootm
|
|
29686
29388
|
}]
|
|
29687
29389
|
});
|
|
29688
|
-
var rootVListWrap = makeSpan(["root"], [rootVList]);
|
|
29390
|
+
var rootVListWrap = makeSpan(["katex-root"], [rootVList]);
|
|
29689
29391
|
return makeSpan(["mord", "sqrt"], [rootVListWrap, body], options2);
|
|
29690
29392
|
}
|
|
29691
29393
|
},
|
|
29692
29394
|
mathmlBuilder(group, options2) {
|
|
29693
|
-
var
|
|
29694
|
-
body,
|
|
29695
|
-
index: index2
|
|
29696
|
-
} = group;
|
|
29395
|
+
var body = group.body, index2 = group.index;
|
|
29697
29396
|
return index2 ? new MathNode("mroot", [buildGroup2(body, options2), buildGroup2(index2, options2)]) : new MathNode("msqrt", [buildGroup2(body, options2)]);
|
|
29698
29397
|
}
|
|
29699
29398
|
});
|
|
@@ -29709,17 +29408,11 @@ function isStyleStr(s) {
|
|
|
29709
29408
|
defineFunction({
|
|
29710
29409
|
type: "styling",
|
|
29711
29410
|
names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
|
|
29712
|
-
|
|
29713
|
-
|
|
29714
|
-
|
|
29715
|
-
primitive: true
|
|
29716
|
-
},
|
|
29411
|
+
numArgs: 0,
|
|
29412
|
+
allowedInText: true,
|
|
29413
|
+
primitive: true,
|
|
29717
29414
|
handler(_ref, args) {
|
|
29718
|
-
var
|
|
29719
|
-
breakOnTokenText,
|
|
29720
|
-
funcName,
|
|
29721
|
-
parser: parser2
|
|
29722
|
-
} = _ref;
|
|
29415
|
+
var breakOnTokenText = _ref.breakOnTokenText, funcName = _ref.funcName, parser2 = _ref.parser;
|
|
29723
29416
|
var body = parser2.parseExpression(true, breakOnTokenText);
|
|
29724
29417
|
var style = funcName.slice(1, funcName.length - 5);
|
|
29725
29418
|
if (!isStyleStr(style)) {
|
|
@@ -29788,11 +29481,7 @@ defineFunctionBuilders({
|
|
|
29788
29481
|
if (builderDelegate) {
|
|
29789
29482
|
return builderDelegate(group, options2);
|
|
29790
29483
|
}
|
|
29791
|
-
var
|
|
29792
|
-
base: valueBase,
|
|
29793
|
-
sup: valueSup,
|
|
29794
|
-
sub: valueSub
|
|
29795
|
-
} = group;
|
|
29484
|
+
var valueBase = group.base, valueSup = group.sup, valueSub = group.sub;
|
|
29796
29485
|
var base2 = buildGroup$1(valueBase, options2);
|
|
29797
29486
|
var supm;
|
|
29798
29487
|
var subm;
|
|
@@ -29975,7 +29664,7 @@ var defaultVariant = {
|
|
|
29975
29664
|
defineFunctionBuilders({
|
|
29976
29665
|
type: "mathord",
|
|
29977
29666
|
htmlBuilder(group, options2) {
|
|
29978
|
-
return makeOrd(group, options2
|
|
29667
|
+
return makeOrd(group, options2);
|
|
29979
29668
|
},
|
|
29980
29669
|
mathmlBuilder(group, options2) {
|
|
29981
29670
|
var node = new MathNode("mi", [makeText(group.text, group.mode, options2)]);
|
|
@@ -29989,7 +29678,7 @@ defineFunctionBuilders({
|
|
|
29989
29678
|
defineFunctionBuilders({
|
|
29990
29679
|
type: "textord",
|
|
29991
29680
|
htmlBuilder(group, options2) {
|
|
29992
|
-
return makeOrd(group, options2
|
|
29681
|
+
return makeOrd(group, options2);
|
|
29993
29682
|
},
|
|
29994
29683
|
mathmlBuilder(group, options2) {
|
|
29995
29684
|
var text2 = makeText(group.text, group.mode, options2);
|
|
@@ -30010,44 +29699,37 @@ defineFunctionBuilders({
|
|
|
30010
29699
|
return node;
|
|
30011
29700
|
}
|
|
30012
29701
|
});
|
|
30013
|
-
var cssSpace =
|
|
30014
|
-
|
|
30015
|
-
|
|
30016
|
-
}
|
|
30017
|
-
|
|
30018
|
-
|
|
30019
|
-
"\\ ": {},
|
|
30020
|
-
"~": {
|
|
30021
|
-
className: "nobreak"
|
|
30022
|
-
},
|
|
30023
|
-
"\\space": {},
|
|
30024
|
-
"\\nobreakspace": {
|
|
30025
|
-
className: "nobreak"
|
|
30026
|
-
}
|
|
30027
|
-
};
|
|
29702
|
+
var cssSpace = /* @__PURE__ */ new Map([["\\nobreak", "nobreak"], ["\\allowbreak", "allowbreak"]]);
|
|
29703
|
+
var regularSpace = /* @__PURE__ */ new Map([[" ", {}], ["\\ ", {}], ["~", {
|
|
29704
|
+
className: "nobreak"
|
|
29705
|
+
}], ["\\space", {}], ["\\nobreakspace", {
|
|
29706
|
+
className: "nobreak"
|
|
29707
|
+
}]]);
|
|
30028
29708
|
defineFunctionBuilders({
|
|
30029
29709
|
type: "spacing",
|
|
30030
29710
|
htmlBuilder(group, options2) {
|
|
30031
|
-
|
|
30032
|
-
|
|
29711
|
+
var regularSpaceItem = regularSpace.get(group.text);
|
|
29712
|
+
var cssSpaceClass = cssSpace.get(group.text);
|
|
29713
|
+
if (regularSpaceItem) {
|
|
29714
|
+
var className = regularSpaceItem.className || "";
|
|
30033
29715
|
if (group.mode === "text") {
|
|
30034
|
-
var ord = makeOrd(group, options2
|
|
29716
|
+
var ord = makeOrd(group, options2);
|
|
30035
29717
|
ord.classes.push(className);
|
|
30036
29718
|
return ord;
|
|
30037
29719
|
} else {
|
|
30038
29720
|
return makeSpan(["mspace", className], [mathsym(group.text, group.mode, options2)], options2);
|
|
30039
29721
|
}
|
|
30040
|
-
} else if (
|
|
30041
|
-
return makeSpan(["mspace",
|
|
29722
|
+
} else if (cssSpaceClass) {
|
|
29723
|
+
return makeSpan(["mspace", cssSpaceClass], [], options2);
|
|
30042
29724
|
} else {
|
|
30043
29725
|
throw new ParseError('Unknown type of space "' + group.text + '"');
|
|
30044
29726
|
}
|
|
30045
29727
|
},
|
|
30046
29728
|
mathmlBuilder(group, options2) {
|
|
30047
29729
|
var node;
|
|
30048
|
-
if (regularSpace.
|
|
29730
|
+
if (regularSpace.has(group.text)) {
|
|
30049
29731
|
node = new MathNode("mtext", [new TextNode2(" ")]);
|
|
30050
|
-
} else if (cssSpace.
|
|
29732
|
+
} else if (cssSpace.has(group.text)) {
|
|
30051
29733
|
return new MathNode("mspace");
|
|
30052
29734
|
} else {
|
|
30053
29735
|
throw new ParseError('Unknown type of space "' + group.text + '"');
|
|
@@ -30113,17 +29795,12 @@ defineFunction({
|
|
|
30113
29795
|
"\\textup",
|
|
30114
29796
|
"\\emph"
|
|
30115
29797
|
],
|
|
30116
|
-
|
|
30117
|
-
|
|
30118
|
-
|
|
30119
|
-
|
|
30120
|
-
allowedInText: true
|
|
30121
|
-
},
|
|
29798
|
+
numArgs: 1,
|
|
29799
|
+
argTypes: ["text"],
|
|
29800
|
+
allowedInArgument: true,
|
|
29801
|
+
allowedInText: true,
|
|
30122
29802
|
handler(_ref, args) {
|
|
30123
|
-
var
|
|
30124
|
-
parser: parser2,
|
|
30125
|
-
funcName
|
|
30126
|
-
} = _ref;
|
|
29803
|
+
var parser2 = _ref.parser, funcName = _ref.funcName;
|
|
30127
29804
|
var body = args[0];
|
|
30128
29805
|
return {
|
|
30129
29806
|
type: "text",
|
|
@@ -30145,14 +29822,10 @@ defineFunction({
|
|
|
30145
29822
|
defineFunction({
|
|
30146
29823
|
type: "underline",
|
|
30147
29824
|
names: ["\\underline"],
|
|
30148
|
-
|
|
30149
|
-
|
|
30150
|
-
allowedInText: true
|
|
30151
|
-
},
|
|
29825
|
+
numArgs: 1,
|
|
29826
|
+
allowedInText: true,
|
|
30152
29827
|
handler(_ref, args) {
|
|
30153
|
-
var
|
|
30154
|
-
parser: parser2
|
|
30155
|
-
} = _ref;
|
|
29828
|
+
var parser2 = _ref.parser;
|
|
30156
29829
|
return {
|
|
30157
29830
|
type: "underline",
|
|
30158
29831
|
mode: parser2.mode,
|
|
@@ -30180,7 +29853,7 @@ defineFunction({
|
|
|
30180
29853
|
elem: innerGroup
|
|
30181
29854
|
}]
|
|
30182
29855
|
});
|
|
30183
|
-
return makeSpan(["mord", "underline"], [vlist], options2);
|
|
29856
|
+
return makeSpan(["mord", "katex-underline"], [vlist], options2);
|
|
30184
29857
|
},
|
|
30185
29858
|
mathmlBuilder(group, options2) {
|
|
30186
29859
|
var operator2 = new MathNode("mo", [new TextNode2("‾")]);
|
|
@@ -30193,16 +29866,12 @@ defineFunction({
|
|
|
30193
29866
|
defineFunction({
|
|
30194
29867
|
type: "vcenter",
|
|
30195
29868
|
names: ["\\vcenter"],
|
|
30196
|
-
|
|
30197
|
-
|
|
30198
|
-
|
|
30199
|
-
|
|
30200
|
-
allowedInText: false
|
|
30201
|
-
},
|
|
29869
|
+
numArgs: 1,
|
|
29870
|
+
argTypes: ["original"],
|
|
29871
|
+
// In LaTeX, \vcenter can act only on a box.
|
|
29872
|
+
allowedInText: false,
|
|
30202
29873
|
handler(_ref, args) {
|
|
30203
|
-
var
|
|
30204
|
-
parser: parser2
|
|
30205
|
-
} = _ref;
|
|
29874
|
+
var parser2 = _ref.parser;
|
|
30206
29875
|
return {
|
|
30207
29876
|
type: "vcenter",
|
|
30208
29877
|
mode: parser2.mode,
|
|
@@ -30230,10 +29899,8 @@ defineFunction({
|
|
|
30230
29899
|
defineFunction({
|
|
30231
29900
|
type: "verb",
|
|
30232
29901
|
names: ["\\verb"],
|
|
30233
|
-
|
|
30234
|
-
|
|
30235
|
-
allowedInText: true
|
|
30236
|
-
},
|
|
29902
|
+
numArgs: 0,
|
|
29903
|
+
allowedInText: true,
|
|
30237
29904
|
handler(context, args, optArgs) {
|
|
30238
29905
|
throw new ParseError("\\verb ended by end of line instead of matching delimiter");
|
|
30239
29906
|
},
|
|
@@ -30312,7 +29979,12 @@ class Lexer {
|
|
|
30312
29979
|
var nlIndex = input.indexOf("\n", this.tokenRegex.lastIndex);
|
|
30313
29980
|
if (nlIndex === -1) {
|
|
30314
29981
|
this.tokenRegex.lastIndex = input.length;
|
|
30315
|
-
|
|
29982
|
+
handleStrict({
|
|
29983
|
+
strict: this.settings.strict,
|
|
29984
|
+
errorCode: "commentAtEnd",
|
|
29985
|
+
errorMsg: "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)",
|
|
29986
|
+
report: true
|
|
29987
|
+
});
|
|
30316
29988
|
} else {
|
|
30317
29989
|
this.tokenRegex.lastIndex = nlIndex + 1;
|
|
30318
29990
|
}
|
|
@@ -30356,13 +30028,11 @@ class Namespace {
|
|
|
30356
30028
|
throw new ParseError("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");
|
|
30357
30029
|
}
|
|
30358
30030
|
var undefs = this.undefStack.pop();
|
|
30359
|
-
for (var
|
|
30360
|
-
if (undefs
|
|
30361
|
-
|
|
30362
|
-
|
|
30363
|
-
|
|
30364
|
-
this.current[undef] = undefs[undef];
|
|
30365
|
-
}
|
|
30031
|
+
for (var key of Object.keys(undefs)) {
|
|
30032
|
+
if (undefs[key] === void 0) {
|
|
30033
|
+
delete this.current[key];
|
|
30034
|
+
} else {
|
|
30035
|
+
this.current[key] = undefs[key];
|
|
30366
30036
|
}
|
|
30367
30037
|
}
|
|
30368
30038
|
}
|
|
@@ -30380,7 +30050,7 @@ class Namespace {
|
|
|
30380
30050
|
* `get(name) != null`.
|
|
30381
30051
|
*/
|
|
30382
30052
|
has(name2) {
|
|
30383
|
-
return
|
|
30053
|
+
return Object.prototype.hasOwnProperty.call(this.current, name2) || Object.prototype.hasOwnProperty.call(this.builtins, name2);
|
|
30384
30054
|
}
|
|
30385
30055
|
/**
|
|
30386
30056
|
* Get the current value of a name, or `undefined` if there is no value.
|
|
@@ -30391,10 +30061,12 @@ class Namespace {
|
|
|
30391
30061
|
* `if (namespace.has(...))`.
|
|
30392
30062
|
*/
|
|
30393
30063
|
get(name2) {
|
|
30394
|
-
if (
|
|
30064
|
+
if (Object.prototype.hasOwnProperty.call(this.current, name2)) {
|
|
30395
30065
|
return this.current[name2];
|
|
30396
|
-
} else {
|
|
30066
|
+
} else if (Object.prototype.hasOwnProperty.call(this.builtins, name2)) {
|
|
30397
30067
|
return this.builtins[name2];
|
|
30068
|
+
} else {
|
|
30069
|
+
return void 0;
|
|
30398
30070
|
}
|
|
30399
30071
|
}
|
|
30400
30072
|
/**
|
|
@@ -30417,8 +30089,8 @@ class Namespace {
|
|
|
30417
30089
|
}
|
|
30418
30090
|
} else {
|
|
30419
30091
|
var top2 = this.undefStack[this.undefStack.length - 1];
|
|
30420
|
-
if (top2 && !
|
|
30421
|
-
top2[name2] = this.current[name2];
|
|
30092
|
+
if (top2 && !Object.prototype.hasOwnProperty.call(top2, name2)) {
|
|
30093
|
+
top2[name2] = Object.prototype.hasOwnProperty.call(this.current, name2) ? this.current[name2] : void 0;
|
|
30422
30094
|
}
|
|
30423
30095
|
}
|
|
30424
30096
|
if (value == null) {
|
|
@@ -30910,6 +30582,8 @@ defineMacro("⟦", "\\llbracket");
|
|
|
30910
30582
|
defineMacro("⟧", "\\rrbracket");
|
|
30911
30583
|
defineMacro("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");
|
|
30912
30584
|
defineMacro("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");
|
|
30585
|
+
defineMacro("↤", "\\mapsfrom");
|
|
30586
|
+
defineMacro("\\mapsfrom", "\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}");
|
|
30913
30587
|
defineMacro("⦃", "\\lBrace");
|
|
30914
30588
|
defineMacro("⦄", "\\rBrace");
|
|
30915
30589
|
defineMacro("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");
|
|
@@ -31193,16 +30867,14 @@ class MacroExpander {
|
|
|
31193
30867
|
return null;
|
|
31194
30868
|
}
|
|
31195
30869
|
start = this.popToken();
|
|
31196
|
-
(
|
|
31197
|
-
|
|
31198
|
-
|
|
31199
|
-
} = this.consumeArg(["]"]));
|
|
30870
|
+
var _this$consumeArg = this.consumeArg(["]"]);
|
|
30871
|
+
tokens = _this$consumeArg.tokens;
|
|
30872
|
+
end = _this$consumeArg.end;
|
|
31200
30873
|
} else {
|
|
31201
|
-
(
|
|
31202
|
-
|
|
31203
|
-
|
|
31204
|
-
|
|
31205
|
-
} = this.consumeArg());
|
|
30874
|
+
var _this$consumeArg2 = this.consumeArg();
|
|
30875
|
+
tokens = _this$consumeArg2.tokens;
|
|
30876
|
+
start = _this$consumeArg2.start;
|
|
30877
|
+
end = _this$consumeArg2.end;
|
|
31206
30878
|
}
|
|
31207
30879
|
this.pushToken(new Token("EOF", end.loc));
|
|
31208
30880
|
this.pushTokens(tokens);
|
|
@@ -31471,14 +31143,17 @@ class MacroExpander {
|
|
|
31471
31143
|
* `implicitCommands`.
|
|
31472
31144
|
*/
|
|
31473
31145
|
isDefined(name2) {
|
|
31474
|
-
return this.macros.has(name2) ||
|
|
31146
|
+
return this.macros.has(name2) || Object.prototype.hasOwnProperty.call(functions, name2) || Object.prototype.hasOwnProperty.call(symbols.math, name2) || Object.prototype.hasOwnProperty.call(symbols.text, name2) || Object.prototype.hasOwnProperty.call(implicitCommands, name2);
|
|
31475
31147
|
}
|
|
31476
31148
|
/**
|
|
31477
31149
|
* Determine whether a command is expandable.
|
|
31478
31150
|
*/
|
|
31479
31151
|
isExpandable(name2) {
|
|
31480
31152
|
var macro = this.macros.get(name2);
|
|
31481
|
-
|
|
31153
|
+
if (macro != null) {
|
|
31154
|
+
return typeof macro === "string" || typeof macro === "function" || !macro.unexpandable;
|
|
31155
|
+
}
|
|
31156
|
+
return Object.prototype.hasOwnProperty.call(functions, name2) && !functions[name2].primitive;
|
|
31482
31157
|
}
|
|
31483
31158
|
}
|
|
31484
31159
|
var unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/;
|
|
@@ -32223,8 +31898,7 @@ class Parser2 {
|
|
|
32223
31898
|
var lex = this.fetch();
|
|
32224
31899
|
if (lex.text === "\\limits" || lex.text === "\\nolimits") {
|
|
32225
31900
|
if (base2 && base2.type === "op") {
|
|
32226
|
-
|
|
32227
|
-
base2.limits = limits;
|
|
31901
|
+
base2.limits = lex.text === "\\limits";
|
|
32228
31902
|
base2.alwaysHandleSupSub = true;
|
|
32229
31903
|
} else if (base2 && base2.type === "operatorname") {
|
|
32230
31904
|
if (base2.alwaysHandleSupSub) {
|
|
@@ -32301,7 +31975,7 @@ class Parser2 {
|
|
|
32301
31975
|
break;
|
|
32302
31976
|
}
|
|
32303
31977
|
}
|
|
32304
|
-
if (superscript
|
|
31978
|
+
if (superscript && subscript) {
|
|
32305
31979
|
return {
|
|
32306
31980
|
type: "supsub",
|
|
32307
31981
|
mode: this.mode,
|
|
@@ -32309,6 +31983,20 @@ class Parser2 {
|
|
|
32309
31983
|
sup: superscript,
|
|
32310
31984
|
sub: subscript
|
|
32311
31985
|
};
|
|
31986
|
+
} else if (superscript) {
|
|
31987
|
+
return {
|
|
31988
|
+
type: "supsub",
|
|
31989
|
+
mode: this.mode,
|
|
31990
|
+
base: base2,
|
|
31991
|
+
sup: superscript
|
|
31992
|
+
};
|
|
31993
|
+
} else if (subscript) {
|
|
31994
|
+
return {
|
|
31995
|
+
type: "supsub",
|
|
31996
|
+
mode: this.mode,
|
|
31997
|
+
base: base2,
|
|
31998
|
+
sub: subscript
|
|
31999
|
+
};
|
|
32312
32000
|
} else {
|
|
32313
32001
|
return base2;
|
|
32314
32002
|
}
|
|
@@ -32331,10 +32019,7 @@ class Parser2 {
|
|
|
32331
32019
|
} else if (this.mode === "math" && funcData.allowedInMath === false) {
|
|
32332
32020
|
throw new ParseError("Can't use function '" + func + "' in math mode", token);
|
|
32333
32021
|
}
|
|
32334
|
-
var
|
|
32335
|
-
args,
|
|
32336
|
-
optArgs
|
|
32337
|
-
} = this.parseArguments(func, funcData);
|
|
32022
|
+
var _this$parseArguments = this.parseArguments(func, funcData), args = _this$parseArguments.args, optArgs = _this$parseArguments.optArgs;
|
|
32338
32023
|
return this.callFunction(func, args, optArgs, token, breakOnTokenText);
|
|
32339
32024
|
}
|
|
32340
32025
|
/**
|
|
@@ -32358,7 +32043,9 @@ class Parser2 {
|
|
|
32358
32043
|
* Parses the arguments of a function or environment
|
|
32359
32044
|
*/
|
|
32360
32045
|
parseArguments(func, funcData) {
|
|
32361
|
-
var
|
|
32046
|
+
var _funcData$numOptional;
|
|
32047
|
+
var numOptionalArgs = (_funcData$numOptional = funcData.numOptionalArgs) != null ? _funcData$numOptional : 0;
|
|
32048
|
+
var totalArgs = funcData.numArgs + numOptionalArgs;
|
|
32362
32049
|
if (totalArgs === 0) {
|
|
32363
32050
|
return {
|
|
32364
32051
|
args: [],
|
|
@@ -32368,8 +32055,9 @@ class Parser2 {
|
|
|
32368
32055
|
var args = [];
|
|
32369
32056
|
var optArgs = [];
|
|
32370
32057
|
for (var i = 0; i < totalArgs; i++) {
|
|
32371
|
-
var
|
|
32372
|
-
var
|
|
32058
|
+
var _funcData$argTypes;
|
|
32059
|
+
var argType = (_funcData$argTypes = funcData.argTypes) == null ? void 0 : _funcData$argTypes[i];
|
|
32060
|
+
var isOptional = i < numOptionalArgs;
|
|
32373
32061
|
if ("primitive" in funcData && funcData.primitive && argType == null || // \sqrt expands into primitive if optional argument doesn't exist
|
|
32374
32062
|
funcData.type === "sqrt" && i === 1 && optArgs[0] == null) {
|
|
32375
32063
|
argType = "primitive";
|
|
@@ -32414,7 +32102,11 @@ class Parser2 {
|
|
|
32414
32102
|
} : null;
|
|
32415
32103
|
}
|
|
32416
32104
|
case "raw": {
|
|
32417
|
-
|
|
32105
|
+
this.gullet.consumeSpaces();
|
|
32106
|
+
var percentCatcode = this.gullet.lexer.catcodes["%"];
|
|
32107
|
+
this.gullet.lexer.setCatcode("%", 12);
|
|
32108
|
+
var token = this.parseStringGroup(optional);
|
|
32109
|
+
this.gullet.lexer.setCatcode("%", percentCatcode);
|
|
32418
32110
|
return token != null ? {
|
|
32419
32111
|
type: "raw",
|
|
32420
32112
|
mode: "text",
|
|
@@ -32432,7 +32124,6 @@ class Parser2 {
|
|
|
32432
32124
|
return _group2;
|
|
32433
32125
|
}
|
|
32434
32126
|
case "original":
|
|
32435
|
-
case null:
|
|
32436
32127
|
case void 0:
|
|
32437
32128
|
return this.parseArgumentGroup(optional);
|
|
32438
32129
|
default:
|
|
@@ -32451,7 +32142,7 @@ class Parser2 {
|
|
|
32451
32142
|
* Parses a group, essentially returning the string formed by the
|
|
32452
32143
|
* brace-enclosed tokens plus some position information.
|
|
32453
32144
|
*/
|
|
32454
|
-
parseStringGroup(
|
|
32145
|
+
parseStringGroup(optional) {
|
|
32455
32146
|
var argToken = this.gullet.scanArgument(optional);
|
|
32456
32147
|
if (argToken == null) {
|
|
32457
32148
|
return null;
|
|
@@ -32490,7 +32181,7 @@ class Parser2 {
|
|
|
32490
32181
|
* Parses a color description.
|
|
32491
32182
|
*/
|
|
32492
32183
|
parseColorGroup(optional) {
|
|
32493
|
-
var res = this.parseStringGroup(
|
|
32184
|
+
var res = this.parseStringGroup(optional);
|
|
32494
32185
|
if (res == null) {
|
|
32495
32186
|
return null;
|
|
32496
32187
|
}
|
|
@@ -32518,7 +32209,7 @@ class Parser2 {
|
|
|
32518
32209
|
if (!optional && this.gullet.future().text !== "{") {
|
|
32519
32210
|
res = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size");
|
|
32520
32211
|
} else {
|
|
32521
|
-
res = this.parseStringGroup(
|
|
32212
|
+
res = this.parseStringGroup(optional);
|
|
32522
32213
|
}
|
|
32523
32214
|
if (!res) {
|
|
32524
32215
|
return null;
|
|
@@ -32551,11 +32242,13 @@ class Parser2 {
|
|
|
32551
32242
|
* and setting the catcode of % as an active character (as in \hyperref).
|
|
32552
32243
|
*/
|
|
32553
32244
|
parseUrlGroup(optional) {
|
|
32245
|
+
var percentCatcode = this.gullet.lexer.catcodes["%"];
|
|
32246
|
+
var tildeCatcode = this.gullet.lexer.catcodes["~"];
|
|
32554
32247
|
this.gullet.lexer.setCatcode("%", 13);
|
|
32555
32248
|
this.gullet.lexer.setCatcode("~", 12);
|
|
32556
|
-
var res = this.parseStringGroup(
|
|
32557
|
-
this.gullet.lexer.setCatcode("%",
|
|
32558
|
-
this.gullet.lexer.setCatcode("~",
|
|
32249
|
+
var res = this.parseStringGroup(optional);
|
|
32250
|
+
this.gullet.lexer.setCatcode("%", percentCatcode);
|
|
32251
|
+
this.gullet.lexer.setCatcode("~", tildeCatcode);
|
|
32559
32252
|
if (res == null) {
|
|
32560
32253
|
return null;
|
|
32561
32254
|
}
|
|
@@ -32624,7 +32317,7 @@ class Parser2 {
|
|
|
32624
32317
|
};
|
|
32625
32318
|
} else {
|
|
32626
32319
|
result = this.parseFunction(breakOnTokenText, name2) || this.parseSymbol();
|
|
32627
|
-
if (result == null && text2[0] === "\\" && !
|
|
32320
|
+
if (result == null && text2[0] === "\\" && !Object.prototype.hasOwnProperty.call(implicitCommands, text2)) {
|
|
32628
32321
|
if (this.settings.throwOnError) {
|
|
32629
32322
|
throw new ParseError("Undefined control sequence: " + text2, firstToken);
|
|
32630
32323
|
}
|
|
@@ -32710,9 +32403,15 @@ class Parser2 {
|
|
|
32710
32403
|
star: star2
|
|
32711
32404
|
};
|
|
32712
32405
|
}
|
|
32713
|
-
if (
|
|
32406
|
+
if (Object.prototype.hasOwnProperty.call(unicodeSymbols, text2[0]) && !symbols[this.mode][text2[0]]) {
|
|
32714
32407
|
if (this.settings.strict && this.mode === "math") {
|
|
32715
|
-
|
|
32408
|
+
handleStrict({
|
|
32409
|
+
strict: this.settings.strict,
|
|
32410
|
+
errorCode: "unicodeTextInMathMode",
|
|
32411
|
+
errorMsg: 'Accented Unicode text character "' + text2[0] + '" used in math mode',
|
|
32412
|
+
report: true,
|
|
32413
|
+
token: nucleus
|
|
32414
|
+
});
|
|
32716
32415
|
}
|
|
32717
32416
|
text2 = unicodeSymbols[text2[0]] + text2.slice(1);
|
|
32718
32417
|
}
|
|
@@ -32728,7 +32427,13 @@ class Parser2 {
|
|
|
32728
32427
|
var symbol;
|
|
32729
32428
|
if (symbols[this.mode][text2]) {
|
|
32730
32429
|
if (this.settings.strict && this.mode === "math" && extraLatin.includes(text2)) {
|
|
32731
|
-
|
|
32430
|
+
handleStrict({
|
|
32431
|
+
strict: this.settings.strict,
|
|
32432
|
+
errorCode: "unicodeTextInMathMode",
|
|
32433
|
+
errorMsg: 'Latin-1/Unicode text character "' + text2[0] + '" used in math mode',
|
|
32434
|
+
report: true,
|
|
32435
|
+
token: nucleus
|
|
32436
|
+
});
|
|
32732
32437
|
}
|
|
32733
32438
|
var group = symbols[this.mode][text2].group;
|
|
32734
32439
|
var loc = SourceLocation.range(nucleus);
|
|
@@ -32753,9 +32458,21 @@ class Parser2 {
|
|
|
32753
32458
|
} else if (text2.charCodeAt(0) >= 128) {
|
|
32754
32459
|
if (this.settings.strict) {
|
|
32755
32460
|
if (!supportedCodepoint(text2.charCodeAt(0))) {
|
|
32756
|
-
|
|
32461
|
+
handleStrict({
|
|
32462
|
+
strict: this.settings.strict,
|
|
32463
|
+
errorCode: "unknownSymbol",
|
|
32464
|
+
errorMsg: 'Unrecognized Unicode character "' + text2[0] + '"' + (" (" + text2.charCodeAt(0) + ")"),
|
|
32465
|
+
report: true,
|
|
32466
|
+
token: nucleus
|
|
32467
|
+
});
|
|
32757
32468
|
} else if (this.mode === "math") {
|
|
32758
|
-
|
|
32469
|
+
handleStrict({
|
|
32470
|
+
strict: this.settings.strict,
|
|
32471
|
+
errorCode: "unicodeTextInMathMode",
|
|
32472
|
+
errorMsg: 'Unicode text character "' + text2[0] + '" used in math mode',
|
|
32473
|
+
report: true,
|
|
32474
|
+
token: nucleus
|
|
32475
|
+
});
|
|
32759
32476
|
}
|
|
32760
32477
|
}
|
|
32761
32478
|
symbol = {
|
|
@@ -32858,12 +32575,12 @@ var renderToHTMLTree = function renderToHTMLTree2(expression, options2) {
|
|
|
32858
32575
|
var settings = new Settings(options2);
|
|
32859
32576
|
try {
|
|
32860
32577
|
var tree = parseTree(expression, settings);
|
|
32861
|
-
return buildHTMLTree(tree,
|
|
32578
|
+
return buildHTMLTree(tree, settings);
|
|
32862
32579
|
} catch (error) {
|
|
32863
32580
|
return renderError(error, expression, settings);
|
|
32864
32581
|
}
|
|
32865
32582
|
};
|
|
32866
|
-
var version = "0.
|
|
32583
|
+
var version = "0.19.1";
|
|
32867
32584
|
var __domTree = {
|
|
32868
32585
|
Span,
|
|
32869
32586
|
Anchor,
|
|
@@ -33237,7 +32954,7 @@ const PRINT_PALETTE = {
|
|
|
33237
32954
|
};
|
|
33238
32955
|
let pele = null;
|
|
33239
32956
|
function loadPele() {
|
|
33240
|
-
pele ??= __vitePreload(() => import("./lazy-
|
|
32957
|
+
pele ??= __vitePreload(() => import("./lazy-DReExUTA.js").then((n) => n.l), true ? [] : void 0, import.meta.url);
|
|
33241
32958
|
return pele;
|
|
33242
32959
|
}
|
|
33243
32960
|
function withPrintPalette(svg, palette) {
|
|
@@ -33595,6 +33312,7 @@ function isActiveRange(_state, _from, _to) {
|
|
|
33595
33312
|
return false;
|
|
33596
33313
|
}
|
|
33597
33314
|
function isBlockActive(state, from, to) {
|
|
33315
|
+
if (exportingCleanly(state)) return false;
|
|
33598
33316
|
const sel = state.selection.main;
|
|
33599
33317
|
return sel.from >= from && sel.to <= to;
|
|
33600
33318
|
}
|
|
@@ -35695,11 +35413,11 @@ class BlockContext {
|
|
|
35695
35413
|
this.absoluteLineEnd = end;
|
|
35696
35414
|
line.reset(text2);
|
|
35697
35415
|
for (; line.depth < this.stack.length; line.depth++) {
|
|
35698
|
-
let cx = this.stack[line.depth],
|
|
35699
|
-
if (!
|
|
35416
|
+
let cx = this.stack[line.depth], handler2 = this.parser.skipContextMarkup[cx.type];
|
|
35417
|
+
if (!handler2)
|
|
35700
35418
|
throw new Error("Unhandled block context " + Type[cx.type]);
|
|
35701
35419
|
let marks = this.line.markers.length;
|
|
35702
|
-
if (!
|
|
35420
|
+
if (!handler2(cx, this, line)) {
|
|
35703
35421
|
if (this.line.markers.length > marks)
|
|
35704
35422
|
cx.end = this.line.markers[this.line.markers.length - 1].to;
|
|
35705
35423
|
line.forward();
|
|
@@ -42062,7 +41780,7 @@ function legacy(parser2) {
|
|
|
42062
41780
|
return new LanguageSupport(StreamLanguage.define(parser2));
|
|
42063
41781
|
}
|
|
42064
41782
|
function sql(dialectName) {
|
|
42065
|
-
return __vitePreload(() => import("./index-
|
|
41783
|
+
return __vitePreload(() => import("./index-CpAWIQHT.js"), true ? [] : void 0, import.meta.url).then((m) => m.sql({ dialect: m[dialectName] }));
|
|
42066
41784
|
}
|
|
42067
41785
|
const languages = [
|
|
42068
41786
|
// New-style language modes
|
|
@@ -42070,7 +41788,7 @@ const languages = [
|
|
|
42070
41788
|
name: "C",
|
|
42071
41789
|
extensions: ["c", "h", "ino"],
|
|
42072
41790
|
load() {
|
|
42073
|
-
return __vitePreload(() => import("./index-
|
|
41791
|
+
return __vitePreload(() => import("./index-lPCBuTEj.js"), true ? [] : void 0, import.meta.url).then((m) => m.cpp());
|
|
42074
41792
|
}
|
|
42075
41793
|
}),
|
|
42076
41794
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42078,7 +41796,7 @@ const languages = [
|
|
|
42078
41796
|
alias: ["cpp"],
|
|
42079
41797
|
extensions: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"],
|
|
42080
41798
|
load() {
|
|
42081
|
-
return __vitePreload(() => import("./index-
|
|
41799
|
+
return __vitePreload(() => import("./index-lPCBuTEj.js"), true ? [] : void 0, import.meta.url).then((m) => m.cpp());
|
|
42082
41800
|
}
|
|
42083
41801
|
}),
|
|
42084
41802
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42100,7 +41818,7 @@ const languages = [
|
|
|
42100
41818
|
name: "Go",
|
|
42101
41819
|
extensions: ["go"],
|
|
42102
41820
|
load() {
|
|
42103
|
-
return __vitePreload(() => import("./index-
|
|
41821
|
+
return __vitePreload(() => import("./index-Gr-12Gzq.js"), true ? [] : void 0, import.meta.url).then((m) => m.go());
|
|
42104
41822
|
}
|
|
42105
41823
|
}),
|
|
42106
41824
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42115,7 +41833,7 @@ const languages = [
|
|
|
42115
41833
|
name: "Java",
|
|
42116
41834
|
extensions: ["java"],
|
|
42117
41835
|
load() {
|
|
42118
|
-
return __vitePreload(() => import("./index-
|
|
41836
|
+
return __vitePreload(() => import("./index-BZK9uVRR.js"), true ? [] : void 0, import.meta.url).then((m) => m.java());
|
|
42119
41837
|
}
|
|
42120
41838
|
}),
|
|
42121
41839
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42130,7 +41848,7 @@ const languages = [
|
|
|
42130
41848
|
name: "Jinja",
|
|
42131
41849
|
extensions: ["j2", "jinja", "jinja2"],
|
|
42132
41850
|
load() {
|
|
42133
|
-
return __vitePreload(() => import("./index-
|
|
41851
|
+
return __vitePreload(() => import("./index-_-G3H01P.js"), true ? [] : void 0, import.meta.url).then((m) => m.jinja());
|
|
42134
41852
|
}
|
|
42135
41853
|
}),
|
|
42136
41854
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42138,7 +41856,7 @@ const languages = [
|
|
|
42138
41856
|
alias: ["json5"],
|
|
42139
41857
|
extensions: ["json", "map"],
|
|
42140
41858
|
load() {
|
|
42141
|
-
return __vitePreload(() => import("./index-
|
|
41859
|
+
return __vitePreload(() => import("./index-DkTSflhI.js"), true ? [] : void 0, import.meta.url).then((m) => m.json());
|
|
42142
41860
|
}
|
|
42143
41861
|
}),
|
|
42144
41862
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42152,14 +41870,14 @@ const languages = [
|
|
|
42152
41870
|
name: "LESS",
|
|
42153
41871
|
extensions: ["less"],
|
|
42154
41872
|
load() {
|
|
42155
|
-
return __vitePreload(() => import("./index-
|
|
41873
|
+
return __vitePreload(() => import("./index-D6i0AdBR.js"), true ? [] : void 0, import.meta.url).then((m) => m.less());
|
|
42156
41874
|
}
|
|
42157
41875
|
}),
|
|
42158
41876
|
/* @__PURE__ */ LanguageDescription.of({
|
|
42159
41877
|
name: "Liquid",
|
|
42160
41878
|
extensions: ["liquid"],
|
|
42161
41879
|
load() {
|
|
42162
|
-
return __vitePreload(() => import("./index-
|
|
41880
|
+
return __vitePreload(() => import("./index-De7RE4Mo.js"), true ? [] : void 0, import.meta.url).then((m) => m.liquid());
|
|
42163
41881
|
}
|
|
42164
41882
|
}),
|
|
42165
41883
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42191,7 +41909,7 @@ const languages = [
|
|
|
42191
41909
|
name: "PHP",
|
|
42192
41910
|
extensions: ["php", "php3", "php4", "php5", "php7", "phtml"],
|
|
42193
41911
|
load() {
|
|
42194
|
-
return __vitePreload(() => import("./index-
|
|
41912
|
+
return __vitePreload(() => import("./index-qlWwPzMe.js"), true ? [] : void 0, import.meta.url).then((m) => m.php());
|
|
42195
41913
|
}
|
|
42196
41914
|
}),
|
|
42197
41915
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42212,28 +41930,28 @@ const languages = [
|
|
|
42212
41930
|
extensions: ["BUILD", "bzl", "py", "pyw"],
|
|
42213
41931
|
filename: /^(BUCK|BUILD)$/,
|
|
42214
41932
|
load() {
|
|
42215
|
-
return __vitePreload(() => import("./index-
|
|
41933
|
+
return __vitePreload(() => import("./index-OOnbRmFx.js"), true ? [] : void 0, import.meta.url).then((m) => m.python());
|
|
42216
41934
|
}
|
|
42217
41935
|
}),
|
|
42218
41936
|
/* @__PURE__ */ LanguageDescription.of({
|
|
42219
41937
|
name: "Rust",
|
|
42220
41938
|
extensions: ["rs"],
|
|
42221
41939
|
load() {
|
|
42222
|
-
return __vitePreload(() => import("./index-
|
|
41940
|
+
return __vitePreload(() => import("./index-1hwQGecd.js"), true ? [] : void 0, import.meta.url).then((m) => m.rust());
|
|
42223
41941
|
}
|
|
42224
41942
|
}),
|
|
42225
41943
|
/* @__PURE__ */ LanguageDescription.of({
|
|
42226
41944
|
name: "Sass",
|
|
42227
41945
|
extensions: ["sass"],
|
|
42228
41946
|
load() {
|
|
42229
|
-
return __vitePreload(() => import("./index-
|
|
41947
|
+
return __vitePreload(() => import("./index-D9fcCIeQ.js"), true ? [] : void 0, import.meta.url).then((m) => m.sass({ indented: true }));
|
|
42230
41948
|
}
|
|
42231
41949
|
}),
|
|
42232
41950
|
/* @__PURE__ */ LanguageDescription.of({
|
|
42233
41951
|
name: "SCSS",
|
|
42234
41952
|
extensions: ["scss"],
|
|
42235
41953
|
load() {
|
|
42236
|
-
return __vitePreload(() => import("./index-
|
|
41954
|
+
return __vitePreload(() => import("./index-D9fcCIeQ.js"), true ? [] : void 0, import.meta.url).then((m) => m.sass());
|
|
42237
41955
|
}
|
|
42238
41956
|
}),
|
|
42239
41957
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42268,7 +41986,7 @@ const languages = [
|
|
|
42268
41986
|
name: "WebAssembly",
|
|
42269
41987
|
extensions: ["wat", "wast"],
|
|
42270
41988
|
load() {
|
|
42271
|
-
return __vitePreload(() => import("./index-
|
|
41989
|
+
return __vitePreload(() => import("./index-3SmJ-5Dc.js"), true ? [] : void 0, import.meta.url).then((m) => m.wast());
|
|
42272
41990
|
}
|
|
42273
41991
|
}),
|
|
42274
41992
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42276,7 +41994,7 @@ const languages = [
|
|
|
42276
41994
|
alias: ["rss", "wsdl", "xsd"],
|
|
42277
41995
|
extensions: ["xml", "xsl", "xsd", "svg"],
|
|
42278
41996
|
load() {
|
|
42279
|
-
return __vitePreload(() => import("./index-
|
|
41997
|
+
return __vitePreload(() => import("./index-BqpGj9MR.js"), true ? [] : void 0, import.meta.url).then((m) => m.xml());
|
|
42280
41998
|
}
|
|
42281
41999
|
}),
|
|
42282
42000
|
/* @__PURE__ */ LanguageDescription.of({
|
|
@@ -42284,7 +42002,7 @@ const languages = [
|
|
|
42284
42002
|
alias: ["yml"],
|
|
42285
42003
|
extensions: ["yaml", "yml"],
|
|
42286
42004
|
load() {
|
|
42287
|
-
return __vitePreload(() => import("./index-
|
|
42005
|
+
return __vitePreload(() => import("./index-BHqRO3CW.js"), true ? [] : void 0, import.meta.url).then((m) => m.yaml());
|
|
42288
42006
|
}
|
|
42289
42007
|
}),
|
|
42290
42008
|
// Legacy modes ported from CodeMirror 5
|
|
@@ -43073,13 +42791,13 @@ const languages = [
|
|
|
43073
42791
|
name: "Vue",
|
|
43074
42792
|
extensions: ["vue"],
|
|
43075
42793
|
load() {
|
|
43076
|
-
return __vitePreload(() => import("./index-
|
|
42794
|
+
return __vitePreload(() => import("./index-CBD7Wlx8.js"), true ? [] : void 0, import.meta.url).then((m) => m.vue());
|
|
43077
42795
|
}
|
|
43078
42796
|
}),
|
|
43079
42797
|
/* @__PURE__ */ LanguageDescription.of({
|
|
43080
42798
|
name: "Angular Template",
|
|
43081
42799
|
load() {
|
|
43082
|
-
return __vitePreload(() => import("./index-
|
|
42800
|
+
return __vitePreload(() => import("./index-B0zpPg3h.js"), true ? [] : void 0, import.meta.url).then((m) => m.angular());
|
|
43083
42801
|
}
|
|
43084
42802
|
})
|
|
43085
42803
|
];
|
|
@@ -44447,6 +44165,10 @@ function jumpToLine(line) {
|
|
|
44447
44165
|
flashLine(view, target.from, target.to);
|
|
44448
44166
|
}
|
|
44449
44167
|
const MERMAID_FENCE = /^([ \t]*)```[ \t]*mermaid[ \t]*\r?\n([\s\S]*?)^\1```[ \t]*$/gm;
|
|
44168
|
+
function isDarkHex(hex) {
|
|
44169
|
+
const channel = (index2) => (Number.parseInt(hex.slice(index2, index2 + 2), 16) || 0) / 255;
|
|
44170
|
+
return 0.2126 * channel(0) + 0.7152 * channel(2) + 0.0722 * channel(4) < 0.5;
|
|
44171
|
+
}
|
|
44450
44172
|
function mixSrgb(a, b, weightA) {
|
|
44451
44173
|
const parse = (hex) => [0, 2, 4].map((index2) => Number.parseInt(hex.slice(index2, index2 + 2), 16) || 0);
|
|
44452
44174
|
const [ra, ga, ba] = parse(a);
|
|
@@ -44455,8 +44177,9 @@ function mixSrgb(a, b, weightA) {
|
|
|
44455
44177
|
return [mix(ra, rb), mix(ga, gb), mix(ba, bb)].map((value) => value.toString(16).padStart(2, "0")).join("").toUpperCase();
|
|
44456
44178
|
}
|
|
44457
44179
|
function diagramPrintPalette(style) {
|
|
44458
|
-
const
|
|
44459
|
-
const
|
|
44180
|
+
const darkCodeBlock = isDarkHex(style.codeBlockBackground);
|
|
44181
|
+
const bg = darkCodeBlock ? "FFFFFF" : style.codeBlockBackground;
|
|
44182
|
+
const fg = darkCodeBlock ? style.text : style.codeBlockText;
|
|
44460
44183
|
return {
|
|
44461
44184
|
"--pele-bg": `#${bg}`,
|
|
44462
44185
|
"--pele-fg": `#${fg}`,
|
|
@@ -44502,6 +44225,7 @@ async function markdownForWord(markdown2, chinese, palette = diagramPrintPalette
|
|
|
44502
44225
|
// 与 docx-style.ts 的 LIGHT 常量同源:没有样式令牌时(脚本/兜底场景)按浅色画。
|
|
44503
44226
|
codeBlockBackground: "F6F8FA",
|
|
44504
44227
|
codeBlockText: "24292F",
|
|
44228
|
+
text: "24292F",
|
|
44505
44229
|
link: "0969DA"
|
|
44506
44230
|
})) {
|
|
44507
44231
|
const fences = [];
|
|
@@ -46173,6 +45897,7 @@ function defaultBaseName() {
|
|
|
46173
45897
|
function escapeHTML(value) {
|
|
46174
45898
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
46175
45899
|
}
|
|
45900
|
+
const PRINT_FALLBACK_TIMEOUT_MS = 18e4;
|
|
46176
45901
|
async function shareFile(f, path2, title) {
|
|
46177
45902
|
try {
|
|
46178
45903
|
const uri = await f.Filesystem.getUri({ path: path2, directory: f.Directory.Documents });
|
|
@@ -46185,11 +45910,11 @@ async function capModule(name2) {
|
|
|
46185
45910
|
try {
|
|
46186
45911
|
switch (name2) {
|
|
46187
45912
|
case "@capacitor/filesystem":
|
|
46188
|
-
return await __vitePreload(() => import("./index-
|
|
45913
|
+
return await __vitePreload(() => import("./index-DsYLJ8It.js"), true ? [] : void 0, import.meta.url);
|
|
46189
45914
|
case "@capacitor/share":
|
|
46190
|
-
return await __vitePreload(() => import("./index-
|
|
45915
|
+
return await __vitePreload(() => import("./index-B6uVUc9e.js"), true ? [] : void 0, import.meta.url);
|
|
46191
45916
|
case "@capacitor/app":
|
|
46192
|
-
return await __vitePreload(() => import("./index-
|
|
45917
|
+
return await __vitePreload(() => import("./index-DgC9JAzE.js"), true ? [] : void 0, import.meta.url);
|
|
46193
45918
|
default:
|
|
46194
45919
|
return null;
|
|
46195
45920
|
}
|
|
@@ -46300,14 +46025,22 @@ function createCapacitorAPI() {
|
|
|
46300
46025
|
const bridge = nativeBridge();
|
|
46301
46026
|
if (!bridge) return false;
|
|
46302
46027
|
const restore = enterPrintLayout();
|
|
46028
|
+
setCleanExport(true);
|
|
46303
46029
|
try {
|
|
46030
|
+
await renderWholeDocument();
|
|
46304
46031
|
await new Promise((resolve) => {
|
|
46305
46032
|
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
|
|
46306
46033
|
});
|
|
46034
|
+
const finishedP = callNative("printDocument");
|
|
46307
46035
|
bridge.printDocument(exportBaseName());
|
|
46036
|
+
await Promise.race([
|
|
46037
|
+
finishedP,
|
|
46038
|
+
new Promise((resolve) => setTimeout(() => resolve(null), PRINT_FALLBACK_TIMEOUT_MS))
|
|
46039
|
+
]);
|
|
46308
46040
|
return true;
|
|
46309
46041
|
} finally {
|
|
46310
|
-
|
|
46042
|
+
restore();
|
|
46043
|
+
setCleanExport(false);
|
|
46311
46044
|
}
|
|
46312
46045
|
},
|
|
46313
46046
|
exportHTML: async (snapshot) => {
|