From: Alexander Ebert Date: Mon, 4 Sep 2017 11:56:34 +0000 (+0200) Subject: Remove empty list when joining two successive lists X-Git-Tag: 3.1.0_Alpha_3~4^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=72ce5a0f53b1bb08f589a1ee02203f664c5cda4a;p=GitHub%2FWoltLab%2FWCF.git Remove empty list when joining two successive lists --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js index 3c144576ef..66db75d53a 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js @@ -88,6 +88,20 @@ $.Redactor.prototype.WoltLabList = function() { this.selection.restore(); } }).bind(this); + + var mpCombineAfterAndBefore = this.list.combineAfterAndBefore; + this.list.combineAfterAndBefore = (function(block) { + var returnValue = mpCombineAfterAndBefore.call(this, block); + + if (returnValue) { + var list = block.nextElementSibling; + if ((list.nodeName === 'OL' || list.nodeName === 'UL') && list.childElementCount === 0) { + elRemove(list); + } + } + + return returnValue; + }).bind(this); } }; };