@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.
@@ -2956,6 +2956,21 @@ function renderDivideOperatorLatex(side) {
2956
2956
  return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
2957
2957
  }
2958
2958
 
2959
+ // src/editor/rawOperatorPresentation.ts
2960
+ var RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE = {
2961
+ "<": ">",
2962
+ ">": "<"
2963
+ };
2964
+ function renderRawOperatorLatex(expr, side) {
2965
+ if (isDivideOperatorExpr(expr)) {
2966
+ return renderDivideOperatorLatex(side);
2967
+ }
2968
+ if (side === "arabic" && Object.prototype.hasOwnProperty.call(RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE, expr)) {
2969
+ return `\\butexmirror{${expr}}`;
2970
+ }
2971
+ return expr;
2972
+ }
2973
+
2959
2974
  // src/editor/render.ts
2960
2975
  function selectedDigitForm(options) {
2961
2976
  return options?.digitForm ?? "western";
@@ -3115,8 +3130,8 @@ function renderNodeEnglish(node, options) {
3115
3130
  }
3116
3131
  return `${renderCharContent(node, options)}${latinScripts(node, options)}`;
3117
3132
  }
3118
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
3119
- return `${renderDivideOperatorLatex("english")}${latinScripts(node, options)}`;
3133
+ if (node.kind === "operator") {
3134
+ return `${renderRawOperatorLatex(node.expr, "english")}${latinScripts(node, options)}`;
3120
3135
  }
3121
3136
  return `${formatDigits(node.expr, selectedDigitForm(options))}${latinScripts(node, options)}`;
3122
3137
  }
@@ -3176,8 +3191,8 @@ function renderNodeArabic(node, options) {
3176
3191
  }
3177
3192
  return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
3178
3193
  }
3179
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
3180
- return arabicScripts(node, renderDivideOperatorLatex("arabic"), options);
3194
+ if (node.kind === "operator") {
3195
+ return arabicScripts(node, renderRawOperatorLatex(node.expr, "arabic"), options);
3181
3196
  }
3182
3197
  return arabicScripts(node, formatDigits(node.expr, selectedDigitForm(options)), options);
3183
3198
  }