From: Alexander Ebert Date: Mon, 19 Dec 2016 16:29:54 +0000 (+0100) Subject: Fixed some more glitches X-Git-Tag: 3.0.0_RC_2~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=65f065b06871afa90743679532662e483a12f95c;p=GitHub%2FWoltLab%2FWCF.git Fixed some more glitches --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js index abbb5bae0c..060c3b7616 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js @@ -160,6 +160,13 @@ $.Redactor.prototype.WoltLabClean = function() { elBySelAll('img', div, function (img) { img.removeAttribute('style'); + + if (img.hasAttribute('alt')) { + // The editor trips over `<`, causing the DOM to be seriously + // messed up. Until this is resolved, we're simply dropping it, + // at least for smilies it is later restored. + img.setAttribute('alt', img.getAttribute('alt').replace(/ elements + elBySelAll('*', p, function (element) { + if (element.nodeName !== 'SPAN') { + remove = false; + } + }); + } + + if (remove) { + elRemove(p); + } + }); + return div.innerHTML; }).bind(this);