From: Alexander Ebert Date: Thu, 4 Jan 2018 16:40:02 +0000 (+0100) Subject: Remove bogus `
` when outdenting a list in Firefox X-Git-Tag: 3.1.0_RC_1~16^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9974c367551418248e4b474f928decbc80512eed;p=GitHub%2FWoltLab%2FWCF.git Remove bogus `
` when outdenting a list in Firefox --- 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);