Browse Source

Make sure that 'xx' is not displayed as a cross.

Sander Mathijs van Veen 13 năm trước cách đây
mục cha
commit
3a59c04eb9
1 tập tin đã thay đổi với 9 bổ sung1 xóa
  1. 9 1
      src/frontend/js/editor.js

+ 9 - 1
src/frontend/js/editor.js

@@ -107,7 +107,15 @@
         window.update_math = function() {
             if (trigger_update) {
                 trigger_update = false;
-                update_math(input_textarea.val());
+
+                // Preprocess input to fix TRS-MathJax incompatibilities.
+                var input = input_textarea.val();
+
+                // Make sure that xx is not displayed as a cross.
+                while(/xx/.test(input))
+                    input = input.replace(/xx/, 'x x');
+
+                update_math(input);
             }
         };