MDL-19526 fixed inserting of < and >

This commit is contained in:
skodak 2009-06-16 10:28:56 +00:00
parent a26146d563
commit aeb0f2135e

View File

@ -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('<', '&lt;');
text = text.replace('>', '&gt;');
//
// Escape the expression
//
text = '$$' + text + '$$';
ed.execCommand('mceInsertContent', false, text);
tinyMCEPopup.close();
}
};
tinyMCEPopup.onInit.add(DragMathDialog.init, DragMathDialog);