From: Alexander Ebert Date: Wed, 13 May 2015 16:38:48 +0000 (+0200) Subject: Fixed image parsing in Firefox X-Git-Tag: 2.1.4~12 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=406f9f647f9c966f3416bf782b64affae8fcbe44;p=GitHub%2FWoltLab%2FWCF.git Fixed image parsing in Firefox --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 3486a997c9..4cbfcc7110 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -670,7 +670,13 @@ RedactorPlugins.wbbcode = function() { }); // [img] - html = html.replace(/]*?src=(["'])([^"']+?)\1[^>]*?style="([^"]+)"[^>]*?>/gi, function(match, quotationMarks, source, style) { + html = html.replace(/]*)?src=(["'])([^"']+?)\2([^>]*)?>/gi, function(match, attributesBefore, quotationMarks, source, attributesAfter) { + var attrs = attributesBefore + " " + attributesAfter; + var style = ''; + if (attrs.match(/style="([^"]+)"/)) { + style = RegExp.$1; + } + var $float = 'none'; var $width = 0; @@ -695,8 +701,6 @@ RedactorPlugins.wbbcode = function() { return "[img]" + source + "[/img]"; }); - html = html.replace(/]*?src=(["'])([^"']+?)\1[^>]*?>/gi, '[img]$2[/img]'); - // [*] html = html.replace(/
  • /gi, '[*]'); html = html.replace(/<\/li>/gi, '\n');