mirror of
https://github.com/moodle/moodle.git
synced 2025-04-18 06:58:08 +02:00
MDL-19526 fixed inserting of < and >
This commit is contained in:
parent
a26146d563
commit
aeb0f2135e
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user