aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de>2023-03-24 11:21:05 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2023-03-24 11:21:05 +0000
commitd9e96bf9a51ec144b3b6ccdaf23a987790dd7c49 (patch)
treec3208baa2860649822facc6639f2d9a335d1c642
parent0ec620a8b069cc72d0c65b8fa23aef8fea1d9fa5 (diff)
Prevent MathJax from changing the CKEditor's content.
Closes #2418 Merge request studip/studip!1639
-rw-r--r--resources/assets/javascripts/lib/wysiwyg.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/resources/assets/javascripts/lib/wysiwyg.js b/resources/assets/javascripts/lib/wysiwyg.js
index a1972fc..eacd509 100644
--- a/resources/assets/javascripts/lib/wysiwyg.js
+++ b/resources/assets/javascripts/lib/wysiwyg.js
@@ -118,8 +118,7 @@ function replaceTextarea(textarea) {
}
return STUDIP.loadChunk('wysiwyg')
- // TODO: Zuerst muss #2481 behoben werden, bevor diese Zeile wieder funktionieren kann.
- // .then(loadMathJax)
+ .then(loadMathJax)
.then(createEditor)
.then(setEditorInstance)
.then(enhanceEditor)
@@ -193,10 +192,15 @@ function replaceTextarea(textarea) {
button.withText = false;
}
+ // Tell MathJax v2.7 to leave the editor alone
+ ckeditor.ui.element.classList.add('tex2jax_ignore');
+
// TODO: Kein updateSourceElement im SourceEditing-Modus
// $(ckeditor.container.$).on('blur', '.CodeMirror', function (event) {
// ckeditor.updateElement(); // also update in source mode
// });
+
+ return ckeditor;
}
function emitLoadEvent(ckeditor) {