From: Alexander Ebert Date: Wed, 4 Jan 2017 16:32:56 +0000 (+0100) Subject: Strip empty `` on backspace in Safari/Firefox X-Git-Tag: 3.0.0~53 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=00b838ddbd7c3e12738a026f3a5e3cefc7bbf82d;p=GitHub%2FWoltLab%2FWCF.git Strip empty `` on backspace in Safari/Firefox --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js index fd514ffce8..a8c10a0809 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js @@ -94,6 +94,13 @@ $.Redactor.prototype.WoltLabKeydown = function() { this.core.editor().find('*[style]').not('span, img, #redactor-image-box, #redactor-image-editter').removeAttr('style'); this.keydown.formatEmpty(e); + + // strip empty + var current = this.selection.current(); + if (current.nodeName === 'KBD' && current.innerHTML.length === 0) { + elRemove(current); + } + this.code.syncFire = true; }, this), 1);