From 72ce5a0f53b1bb08f589a1ee02203f664c5cda4a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 4 Sep 2017 13:56:34 +0200 Subject: [PATCH] Remove empty list when joining two successive lists --- .../js/3rdParty/redactor2/plugins/WoltLabList.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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); } }; }; -- 2.20.1