@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.
@@ -2853,6 +2853,21 @@ function renderDivideOperatorLatex(side) {
2853
2853
  return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
2854
2854
  }
2855
2855
 
2856
+ // src/editor/rawOperatorPresentation.ts
2857
+ var RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE = {
2858
+ "<": ">",
2859
+ ">": "<"
2860
+ };
2861
+ function renderRawOperatorLatex(expr, side) {
2862
+ if (isDivideOperatorExpr(expr)) {
2863
+ return renderDivideOperatorLatex(side);
2864
+ }
2865
+ if (side === "arabic" && Object.prototype.hasOwnProperty.call(RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE, expr)) {
2866
+ return `\\butexmirror{${expr}}`;
2867
+ }
2868
+ return expr;
2869
+ }
2870
+
2856
2871
  // src/editor/render.ts
2857
2872
  function selectedDigitForm(options) {
2858
2873
  return options?.digitForm ?? "western";
@@ -3012,8 +3027,8 @@ function renderNodeEnglish(node, options) {
3012
3027
  }
3013
3028
  return `${renderCharContent(node, options)}${latinScripts(node, options)}`;
3014
3029
  }
3015
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
3016
- return `${renderDivideOperatorLatex("english")}${latinScripts(node, options)}`;
3030
+ if (node.kind === "operator") {
3031
+ return `${renderRawOperatorLatex(node.expr, "english")}${latinScripts(node, options)}`;
3017
3032
  }
3018
3033
  return `${formatDigits(node.expr, selectedDigitForm(options))}${latinScripts(node, options)}`;
3019
3034
  }
@@ -3073,8 +3088,8 @@ function renderNodeArabic(node, options) {
3073
3088
  }
3074
3089
  return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
3075
3090
  }
3076
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
3077
- return arabicScripts(node, renderDivideOperatorLatex("arabic"), options);
3091
+ if (node.kind === "operator") {
3092
+ return arabicScripts(node, renderRawOperatorLatex(node.expr, "arabic"), options);
3078
3093
  }
3079
3094
  return arabicScripts(node, formatDigits(node.expr, selectedDigitForm(options)), options);
3080
3095
  }