From 65f065b06871afa90743679532662e483a12f95c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 19 Dec 2016 17:29:54 +0100 Subject: [PATCH] Fixed some more glitches --- .../redactor2/plugins/WoltLabClean.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) 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); -- 2.20.1