From d95435267463c770984d7baf75bdd38fbc3f1727 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 30 Aug 2016 12:28:25 +0200 Subject: [PATCH] Remove empty paragraph after quote insert into empty editor --- .../files/js/3rdParty/redactor2/plugins/WoltLabInsert.js | 6 ++++++ 1 file changed, 6 insertions(+) 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() === '') { -- 2.20.1