@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.
@@ -2882,6 +2882,21 @@ function renderDivideOperatorLatex(side) {
2882
2882
  return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
2883
2883
  }
2884
2884
 
2885
+ // src/editor/rawOperatorPresentation.ts
2886
+ var RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE = {
2887
+ "<": ">",
2888
+ ">": "<"
2889
+ };
2890
+ function renderRawOperatorLatex(expr, side) {
2891
+ if (isDivideOperatorExpr(expr)) {
2892
+ return renderDivideOperatorLatex(side);
2893
+ }
2894
+ if (side === "arabic" && Object.prototype.hasOwnProperty.call(RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE, expr)) {
2895
+ return `\\butexmirror{${expr}}`;
2896
+ }
2897
+ return expr;
2898
+ }
2899
+
2885
2900
  // src/editor/render.ts
2886
2901
  function selectedDigitForm(options) {
2887
2902
  return options?.digitForm ?? "western";
@@ -3041,8 +3056,8 @@ function renderNodeEnglish(node, options) {
3041
3056
  }
3042
3057
  return `${renderCharContent(node, options)}${latinScripts(node, options)}`;
3043
3058
  }
3044
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
3045
- return `${renderDivideOperatorLatex("english")}${latinScripts(node, options)}`;
3059
+ if (node.kind === "operator") {
3060
+ return `${renderRawOperatorLatex(node.expr, "english")}${latinScripts(node, options)}`;
3046
3061
  }
3047
3062
  return `${formatDigits(node.expr, selectedDigitForm(options))}${latinScripts(node, options)}`;
3048
3063
  }
@@ -3102,8 +3117,8 @@ function renderNodeArabic(node, options) {
3102
3117
  }
3103
3118
  return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
3104
3119
  }
3105
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
3106
- return arabicScripts(node, renderDivideOperatorLatex("arabic"), options);
3120
+ if (node.kind === "operator") {
3121
+ return arabicScripts(node, renderRawOperatorLatex(node.expr, "arabic"), options);
3107
3122
  }
3108
3123
  return arabicScripts(node, formatDigits(node.expr, selectedDigitForm(options)), options);
3109
3124
  }