@drghaliasri/butex 7.3.2 → 7.3.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
@@ -2009,6 +2009,21 @@ function renderDivideOperatorLatex(side) {
2009
2009
  return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
2010
2010
  }
2011
2011
 
2012
+ // src/editor/rawOperatorPresentation.ts
2013
+ var RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE = {
2014
+ "<": ">",
2015
+ ">": "<"
2016
+ };
2017
+ function renderRawOperatorLatex(expr, side) {
2018
+ if (isDivideOperatorExpr(expr)) {
2019
+ return renderDivideOperatorLatex(side);
2020
+ }
2021
+ if (side === "arabic" && Object.prototype.hasOwnProperty.call(RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE, expr)) {
2022
+ return `\\butexmirror{${expr}}`;
2023
+ }
2024
+ return expr;
2025
+ }
2026
+
2012
2027
  // src/editor/digits.ts
2013
2028
  var WESTERN = "0123456789";
2014
2029
  var ARABIC_INDIC = "\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669";
@@ -2158,8 +2173,8 @@ function renderNodeArabic(node, options) {
2158
2173
  }
2159
2174
  return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
2160
2175
  }
2161
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
2162
- return arabicScripts(node, renderDivideOperatorLatex("arabic"), options);
2176
+ if (node.kind === "operator") {
2177
+ return arabicScripts(node, renderRawOperatorLatex(node.expr, "arabic"), options);
2163
2178
  }
2164
2179
  return arabicScripts(node, formatDigits(node.expr, selectedDigitForm(options)), options);
2165
2180
  }