From 406f9f647f9c966f3416bf782b64affae8fcbe44 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 13 May 2015 18:38:48 +0200 Subject: [PATCH] Fixed image parsing in Firefox --- .../files/js/3rdParty/redactor/plugins/wbbcode.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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'); -- 2.20.1