@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/document2.js CHANGED
@@ -3276,6 +3276,21 @@ function renderDivideOperatorLatex(side) {
3276
3276
  return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
3277
3277
  }
3278
3278
 
3279
+ // src/editor/rawOperatorPresentation.ts
3280
+ var RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE = {
3281
+ "<": ">",
3282
+ ">": "<"
3283
+ };
3284
+ function renderRawOperatorLatex(expr, side) {
3285
+ if (isDivideOperatorExpr(expr)) {
3286
+ return renderDivideOperatorLatex(side);
3287
+ }
3288
+ if (side === "arabic" && Object.prototype.hasOwnProperty.call(RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE, expr)) {
3289
+ return `\\butexmirror{${expr}}`;
3290
+ }
3291
+ return expr;
3292
+ }
3293
+
3279
3294
  // src/editor/render.ts
3280
3295
  function selectedDigitForm(options) {
3281
3296
  return options?.digitForm ?? "western";
@@ -3435,8 +3450,8 @@ function renderNodeEnglish(node, options) {
3435
3450
  }
3436
3451
  return `${renderCharContent(node, options)}${latinScripts(node, options)}`;
3437
3452
  }
3438
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
3439
- return `${renderDivideOperatorLatex("english")}${latinScripts(node, options)}`;
3453
+ if (node.kind === "operator") {
3454
+ return `${renderRawOperatorLatex(node.expr, "english")}${latinScripts(node, options)}`;
3440
3455
  }
3441
3456
  return `${formatDigits(node.expr, selectedDigitForm(options))}${latinScripts(node, options)}`;
3442
3457
  }
@@ -3496,8 +3511,8 @@ function renderNodeArabic(node, options) {
3496
3511
  }
3497
3512
  return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
3498
3513
  }
3499
- if (node.kind === "operator" && isDivideOperatorExpr(node.expr)) {
3500
- return arabicScripts(node, renderDivideOperatorLatex("arabic"), options);
3514
+ if (node.kind === "operator") {
3515
+ return arabicScripts(node, renderRawOperatorLatex(node.expr, "arabic"), options);
3501
3516
  }
3502
3517
  return arabicScripts(node, formatDigits(node.expr, selectedDigitForm(options)), options);
3503
3518
  }