Incorrect removal of existing text formatting
authorAlexander Ebert <ebert@woltlab.com>
Sat, 8 May 2021 11:52:21 +0000 (13:52 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 8 May 2021 11:52:21 +0000 (13:52 +0200)
ts/WoltLabSuite/Core/Ui/Redactor/Format.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Format.js

index d4891a498fc52a10ae5ca3dc6921796c7f9a9fe7..7fc54ee4500eed1b319bda440cdecb117f0829aa 100644 (file)
@@ -423,9 +423,7 @@ export function removeFormat(editorElement: HTMLElement, property: string): void
   const selectionMarker = getSelectionMarker(editorElement, selection);
 
   document.execCommand(selectionMarker[1]);
-  if (selectionMarker[0] !== "strike") {
-    strikeElements = editorElement.querySelectorAll(selectionMarker[0]);
-  }
+  strikeElements = editorElement.querySelectorAll(selectionMarker[0]);
 
   // Safari 13 sometimes refuses to execute the `strikeThrough` command.
   if (rangeIsCollapsed && helperTextNode !== null && strikeElements.length === 0) {
index 56aacdb5290ffb0f51991e06590ca7e977ddfac9..deee3131ca2484181174575133cf6648b9d641fb 100644 (file)
@@ -356,9 +356,7 @@ define(["require", "exports", "tslib", "../../Dom/Util"], function (require, exp
         strikeElements.forEach((el) => Util_1.default.unwrapChildNodes(el));
         const selectionMarker = getSelectionMarker(editorElement, selection);
         document.execCommand(selectionMarker[1]);
-        if (selectionMarker[0] !== "strike") {
-            strikeElements = editorElement.querySelectorAll(selectionMarker[0]);
-        }
+        strikeElements = editorElement.querySelectorAll(selectionMarker[0]);
         // Safari 13 sometimes refuses to execute the `strikeThrough` command.
         if (rangeIsCollapsed && helperTextNode !== null && strikeElements.length === 0) {
             // Executing the command again will toggle off the previous command that had no