From: Alexander Ebert Date: Sat, 30 Dec 2017 20:56:24 +0000 (+0100) Subject: Backspacing inside quotes in Firefox failed for `
` X-Git-Tag: 3.1.0_RC_1~27 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c4ed173e4adbd7fe5d0320d599bb60aac27c8a73;p=GitHub%2FWoltLab%2FWCF.git Backspacing inside quotes in Firefox failed for `
` --- 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 {