@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.
@@ -3112,6 +3112,21 @@ function renderDivideOperatorLatex(side) {
3112
3112
  return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
3113
3113
  }
3114
3114
 
3115
+ // src/editor/rawOperatorPresentation.ts
3116
+ var RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE = {
3117
+ "<": ">",
3118
+ ">": "<"
3119
+ };
3120
+ function renderRawOperatorLatex(expr, side) {
3121
+ if (isDivideOperatorExpr(expr)) {
3122
+ return renderDivideOperatorLatex(side);
3123
+ }
3124
+ if (side === "arabic" && Object.prototype.hasOwnProperty.call(RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE, expr)) {
3125
+ return `\\butexmirror{${expr}}`;
3126
+ }
3127
+ return expr;
3128
+ }
3129
+
3115
3130
  // src/editor/render.ts
3116
3131
  function selectedDigitForm(options) {
3117
3132
  return options?.digitForm ?? "western";
@@ -3271,8 +3286,8 @@ function renderNodeEnglish(node, options) {
3271
3286
  }
3272
3287
  return `${renderCharContent(node, options)}${latinScripts(node, options)}`;
3273
3288
  }
3274
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
3275
- return `${renderDivideOperatorLatex("english")}${latinScripts(node, options)}`;
3289
+ if (node.kind === "operator") {
3290
+ return `${renderRawOperatorLatex(node.expr, "english")}${latinScripts(node, options)}`;
3276
3291
  }
3277
3292
  return `${formatDigits(node.expr, selectedDigitForm(options))}${latinScripts(node, options)}`;
3278
3293
  }
@@ -3332,8 +3347,8 @@ function renderNodeArabic(node, options) {
3332
3347
  }
3333
3348
  return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
3334
3349
  }
3335
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
3336
- return arabicScripts(node, renderDivideOperatorLatex("arabic"), options);
3350
+ if (node.kind === "operator") {
3351
+ return arabicScripts(node, renderRawOperatorLatex(node.expr, "arabic"), options);
3337
3352
  }
3338
3353
  return arabicScripts(node, formatDigits(node.expr, selectedDigitForm(options)), options);
3339
3354
  }