Fixed ampersands not being restored inside code tags
authorAlexander Ebert <ebert@woltlab.com>
Wed, 5 Oct 2016 15:25:52 +0000 (17:25 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 5 Oct 2016 15:25:52 +0000 (17:25 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js

index 2b8fc71d2004f8010ca6c3ce4de5b2d9f160f69e..4f287512bf181f581f13d03d343419dca8d484fd 100644 (file)
@@ -35,9 +35,6 @@ $.Redactor.prototype.WoltLabClean = function() {
                                var div = elCreate('div');
                                var replacements = {};
                                
-                               // fix ampersands being replaced
-                               html = html.replace(/&amp;/g, '@@@WCF_AMPERSAND@@@');
-                               
                                if (html.indexOf('<pre') !== -1) {
                                        div.innerHTML = html;
                                        
@@ -53,6 +50,9 @@ $.Redactor.prototype.WoltLabClean = function() {
                                
                                html = html.replace(/<p>\u200B<\/p>/g, '<p><br></p>');
                                
+                               // fix ampersands being replaced
+                               html = html.replace(/&amp;/g, '@@@WCF_AMPERSAND@@@');
+                               
                                html = mpOnSync.call(this, html);
                                
                                // restore ampersands