Properly preserve smilies by adding a leading whitespace
authorAlexander Ebert <ebert@woltlab.com>
Wed, 24 Dec 2014 13:10:40 +0000 (14:10 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 24 Dec 2014 13:10:40 +0000 (14:10 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index edf53ac67d553c51634e0a81689ccf98569a73bf..0d428ca7ef95ef80c99154a379dd30d7291bc5c7 100644 (file)
@@ -473,8 +473,8 @@ RedactorPlugins.wbbcode = function() {
                        });
                        
                        // smileys
-                       html = html.replace(/<img [^>]*?alt="([^"]+?)" class="smiley".*?> ?/gi, '$1 '); // firefox
-                       html = html.replace(/<img [^>]*?class="smiley" alt="([^"]+?)".*?> ?/gi, '$1 '); // chrome, ie
+                       html = html.replace(/ ?<img [^>]*?alt="([^"]+?)" class="smiley".*?> ?/gi, ' $1 '); // firefox
+                       html = html.replace(/ ?<img [^>]*?class="smiley" alt="([^"]+?)".*?> ?/gi, ' $1 '); // chrome, ie
                        
                        // attachments
                        html = html.replace(/<img [^>]*?class="redactorEmbeddedAttachment[^"]*" data-attachment-id="(\d+)"( style="([^"]+)")?>/gi, function(match, attachmentID, styleTag, style) {