From c4ed173e4adbd7fe5d0320d599bb60aac27c8a73 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 30 Dec 2017 21:56:24 +0100 Subject: [PATCH] Backspacing inside quotes in Firefox failed for `
` --- .../redactor2/plugins/WoltLabKeydown.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js index c9ea6d1e6e..993903dd79 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js @@ -640,11 +640,24 @@ $.Redactor.prototype.WoltLabKeydown = function() { if (sibling.nodeName === 'P') { sibling.appendChild(this.marker.get()); + var node; while (block.childNodes.length) { - sibling.appendChild(block.childNodes[0]); + node = block.childNodes[0]; + + // avoid moving contents that follows a `
` + if (node.nodeName === 'BR') { + elRemove(node); + break; + } + + sibling.appendChild(node); + } + + // blocks may be non-empty if they contained a `
` somehwere after the original caret position + if (block.childNodes.length === 0) { + elRemove(block); } - elRemove(block); this.selection.restore(); } else { -- 2.20.1