From bba85152ff89fb0347449c287017b6c1e07f420c Mon Sep 17 00:00:00 2001
From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de>
Date: Mon, 31 Jul 2023 14:46:06 +0000
Subject: [PATCH] update DOM value property, not innerHTML, fixes #2948

Closes #2948

Merge request studip/studip!1984
---
 resources/assets/javascripts/lib/wysiwyg.js | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/resources/assets/javascripts/lib/wysiwyg.js b/resources/assets/javascripts/lib/wysiwyg.js
index 6b5f502ed7d..e36c2f70e32 100644
--- a/resources/assets/javascripts/lib/wysiwyg.js
+++ b/resources/assets/javascripts/lib/wysiwyg.js
@@ -213,10 +213,8 @@ function enhanceEditor($textarea, ckeditor) {
     // make sure HTML marker is always set, in
     // case contents are cut-off by the backend
     $textarea.closest('form').submit(() => {
-        const data = wysiwyg.markAsHtml(ckeditor.getData());
-        ckeditor.setData(data);
+        ckeditor.setData(wysiwyg.markAsHtml(ckeditor.getData()));
         ckeditor.updateSourceElement();
-        $textarea.get(0).value = data;
     });
 
     // focus the editor if requested
@@ -226,9 +224,7 @@ function enhanceEditor($textarea, ckeditor) {
 
     ckeditor.ui.focusTracker.on('change:isFocused', (evt, name, isFocused) => {
         if (!isFocused) {
-            const data = wysiwyg.markAsHtml(ckeditor.getData());
-            ckeditor.updateSourceElement(data);
-            $textarea.get(0).value = data;
+            ckeditor.sourceElement.value = wysiwyg.markAsHtml(ckeditor.getData());
         }
     });
 
-- 
GitLab