Incorrect handling of the default state of code blocks
authorAlexander Ebert <ebert@woltlab.com>
Wed, 4 Nov 2020 19:27:26 +0000 (20:27 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 4 Nov 2020 19:27:26 +0000 (20:27 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Redactor/Code.ts

index c486bafbdc85a7c7fa51410037ad9e7dbbcb6cb9..c18f8c7257f045b938667a703a2c7694acbb2630 100644 (file)
@@ -170,12 +170,12 @@ define(["require", "exports", "tslib", "../../Core", "../../Dom/Util", "../../Ev
                     onShow: () => {
                         const pre = this._pre;
                         const highlighter = document.getElementById(idHighlighter);
-                        highlighter.value = pre.dataset.highlighter;
+                        highlighter.value = pre.dataset.highlighter || "";
                         const line = ~~(pre.dataset.line || 1);
                         const lineInput = document.getElementById(idLine);
                         lineInput.value = line.toString();
                         const filename = document.getElementById(idFile);
-                        filename.value = pre.dataset.file;
+                        filename.value = pre.dataset.file || "";
                     },
                     title: Language.get("wcf.editor.code.edit"),
                 },
index 68c3e954ee2c9bc09432df2004ed7720cb062261..a2cb0fa107650be4a16cc34b358cbe66d1463106 100644 (file)
@@ -218,14 +218,14 @@ class UiRedactorCode implements DialogCallbackObject {
           const pre = this._pre!;
 
           const highlighter = document.getElementById(idHighlighter) as HTMLSelectElement;
-          highlighter.value = pre.dataset.highlighter!;
+          highlighter.value = pre.dataset.highlighter || "";
           const line = ~~(pre.dataset.line || 1);
 
           const lineInput = document.getElementById(idLine) as HTMLInputElement;
           lineInput.value = line.toString();
 
           const filename = document.getElementById(idFile) as HTMLInputElement;
-          filename.value = pre.dataset.file!;
+          filename.value = pre.dataset.file || "";
         },
 
         title: Language.get("wcf.editor.code.edit"),