From 9974c367551418248e4b474f928decbc80512eed Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 4 Jan 2018 17:40:02 +0100 Subject: [PATCH] Remove bogus `
` when outdenting a list in Firefox --- .../js/3rdParty/redactor2/plugins/WoltLabIndent.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabIndent.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabIndent.js index 0b53bf752c..b1da114841 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabIndent.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabIndent.js @@ -103,6 +103,16 @@ $.Redactor.prototype.WoltLabIndent = function() { } this.indent.normalize = (function() { + // `document.execCommand('outdent')` can spawn a `
` if there is whitespace in the DOM + // see https://bugzilla.mozilla.org/show_bug.cgi?id=1428073 + if (this.detect.isFirefox()) { + var block = this.selection.block(); + if (block && block.nodeName === 'P') { + var br = block.previousElementSibling; + if (br && br.nodeName === 'BR') elRemove(br); + } + } + this.core.editor().find('li').each($.proxy(function (i, s) { var $el = $(s); -- 2.20.1