From: skodak Date: Tue, 16 Jun 2009 10:28:56 +0000 (+0000) Subject: MDL-19526 fixed inserting of < and > X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=aeb0f2135e5cb680bb34846b1f244b32cee3b3ee;p=moodle.git MDL-19526 fixed inserting of < and > --- diff --git a/lib/editor/tinymce/plugins/dragmath/js/dragmath.js b/lib/editor/tinymce/plugins/dragmath/js/dragmath.js index 8526663544..c9c24f601c 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);