Explorar el Código

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

Sander Mathijs van Veen hace 13 años
padre
commit
3a59c04eb9
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  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);
             }
         };