diff --git a/lib/editor/tinymce/plugins/dragmath/js/dragmath.js b/lib/editor/tinymce/plugins/dragmath/js/dragmath.js index 8526663544e..c9c24f601c7 100644 --- a/lib/editor/tinymce/plugins/dragmath/js/dragmath.js +++ b/lib/editor/tinymce/plugins/dragmath/js/dragmath.js @@ -1,31 +1,34 @@ -tinyMCEPopup.requireLangPack(); - -var DragMathDialog = { - init : function(ed) { - - }, - - - - insert : function(file, title) { - - var ed = tinyMCEPopup.editor; - var mathExpression = document.dragmath.getMathExpression(); - // - // TBD any massaging needed here? - // - var text = mathExpression; - // - // Escape the expression - // - var text = '$$' + text + '$$'; - ed.execCommand('mceInsertContent', false, text); - - tinyMCEPopup.close(); - } - - - -}; - -tinyMCEPopup.onInit.add(DragMathDialog.init, DragMathDialog); +tinyMCEPopup.requireLangPack(); + +var DragMathDialog = { + init : function(ed) { + + }, + + + + insert : function(file, title) { + + var ed = tinyMCEPopup.editor; + var mathExpression = document.dragmath.getMathExpression(); + // + // TBD any massaging needed here? + // + var text = mathExpression; + // convert < and > to entities + text = text.replace('<', '<'); + text = text.replace('>', '>'); + // + // Escape the expression + // + text = '$$' + text + '$$'; + ed.execCommand('mceInsertContent', false, text); + + tinyMCEPopup.close(); + } + + + +}; + +tinyMCEPopup.onInit.add(DragMathDialog.init, DragMathDialog);