From 00b838ddbd7c3e12738a026f3a5e3cefc7bbf82d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 4 Jan 2017 17:32:56 +0100 Subject: [PATCH] Strip empty `` on backspace in Safari/Firefox --- .../files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.20.1