From: Alexander Ebert Date: Tue, 30 Aug 2016 10:28:25 +0000 (+0200) Subject: Remove empty paragraph after quote insert into empty editor X-Git-Tag: 3.0.0_Beta_1~409 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d95435267463c770984d7baf75bdd38fbc3f1727;p=GitHub%2FWoltLab%2FWCF.git Remove empty paragraph after quote insert into empty editor --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInsert.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInsert.js index f28d1c5eee..53e3e6d7d2 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInsert.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInsert.js @@ -15,8 +15,14 @@ $.Redactor.prototype.WoltLabInsert = function() { /** @var Element */ var block = this.selection.block(); + var isEmptyEditor = (this.$editor[0].innerHTML.replace(/<\/?p>/g, '').replace(/
/g, '').replace(/\u200B/g, '').trim() === ''); + mpHtml.call(this, html, data); + if (isEmptyEditor) { + block = this.$editor[0].firstElementChild; + } + if (block && block.nodeName === 'P' && block.nextElementSibling) { var removeBlock = false; if (block.childElementCount === 0 && block.textContent.replace(/\u200B/g, '').trim() === '') {