@drghaliasri/butex 8.0.2 → 8.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/document.js CHANGED
@@ -8211,9 +8211,13 @@ function digitsMappingFromDigitForm(digitForm) {
8211
8211
  }
8212
8212
  return "arabicdigits";
8213
8213
  }
8214
+ function editorMathLatexForCompile(token) {
8215
+ const source = token.math && token.sourceSide === "arabic" && token.source.includes("\\begin{cases}") ? mathTokenSourceForSide(token, "arabic", void 0, true) : token.source;
8216
+ return mirrorBuTeXOperatorsInTex(source, { target: "compile" });
8217
+ }
8214
8218
  function mathBodyLatex(token) {
8215
8219
  if (token.sourceOwner === "editor") {
8216
- return stripDisplayMathDelimiters(mirrorBuTeXOperatorsInTex(token.source, { target: "compile" }));
8220
+ return stripDisplayMathDelimiters(editorMathLatexForCompile(token));
8217
8221
  }
8218
8222
  if (!token.math || token.sourceOwner === "raw") {
8219
8223
  return stripDisplayMathDelimiters(token.source);
@@ -8288,7 +8292,7 @@ ${body}
8288
8292
  \\end{equation}`;
8289
8293
  }
8290
8294
  if (token.sourceOwner === "editor") {
8291
- return mirrorBuTeXOperatorsInTex(token.source, { target: "compile" });
8295
+ return editorMathLatexForCompile(token);
8292
8296
  }
8293
8297
  if (!token.math || token.sourceOwner === "raw") {
8294
8298
  return token.source;