Preserve literal ` `
authorAlexander Ebert <ebert@woltlab.com>
Mon, 23 May 2016 10:49:28 +0000 (12:49 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 23 May 2016 10:49:28 +0000 (12:49 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index fc68b1fbe331666f88a017285085101bf836607b..3472b31dd1a6c65c0df9f603509788027a7f1df2 100644 (file)
@@ -433,7 +433,6 @@ RedactorPlugins.wbbcode = function() {
                        
                        // drop <br>, they are pointless because the editor already adds a newline after them
                        html = html.replace(/<br>/g, '');
-                       html = html.replace(/&nbsp;/gi, " ");
                        
                        // [quote]
                        html = html.replace(/<blockquote([^>]+)>\n?<header[^>]*?>[\s\S]*?<\/header>/gi, function(match, attributes, innerContent) {
@@ -1505,6 +1504,9 @@ RedactorPlugins.wbbcode = function() {
                        
                        WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'afterConvertToHtml', { data: data });
                        
+                       // double-encode the ampersand, otherwise Redactor removes it
+                       data = data.replace(/&amp;nbsp;/g, '&amp;amp;nbsp;');
+                       
                        return data;
                },