From aeb0f2135e5cb680bb34846b1f244b32cee3b3ee Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 16 Jun 2009 10:28:56 +0000 Subject: [PATCH] MDL-19526 fixed inserting of < and > --- .../tinymce/plugins/dragmath/js/dragmath.js | 65 ++++++++++--------- 1 file changed, 34 insertions(+), 31 deletions(-) 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);