Fixed smiley replacement being too greedy
authorAlexander Ebert <ebert@woltlab.com>
Wed, 25 Feb 2015 09:51:52 +0000 (10:51 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 25 Feb 2015 09:51:52 +0000 (10:51 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index d4eb8e8cc7b04e8a67b9c20d225f34b8157992aa..959a85eab8e5411564e4f9762543e2a5855b617c 100644 (file)
@@ -554,8 +554,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[^"]*"(.*?)>/gi, function(match, attributesBefore, attributesAfter) {