From a127ed94997e17e7917aa38a6789435e184d0411 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 11 Jan 2015 18:09:25 +0100 Subject: [PATCH] Improved detection of embedded attachment images --- .../install/files/js/3rdParty/redactor/plugins/wbbcode.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 58b10c5a5f..86fb2236f4 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -504,7 +504,7 @@ RedactorPlugins.wbbcode = function() { html = html.replace(/ ?]*?class="smiley" alt="([^"]+?)".*?> ?/gi, ' $1 '); // chrome, ie // attachments - html = html.replace(/]*?class="redactorEmbeddedAttachment[^"]*" data-attachment-id="(\d+)"( style="([^"]+)")?>/gi, function(match, attachmentID, styleTag, style) { + html = html.replace(/]*?class="redactorEmbeddedAttachment[^"]*" data-attachment-id="(\d+)".*?( style="([^"]+)")?.*?>/gi, function(match, attachmentID, styleTag, style) { var $float = 'none'; var $width = null; @@ -533,7 +533,7 @@ RedactorPlugins.wbbcode = function() { }); // [img] - html = html.replace(/]*?src=(["'])([^"']+?)\1 style="([^"]+)".*?>/gi, function(match, quotationMarks, source, style) { + html = html.replace(/]*?src=(["'])([^"']+?)\1.*?style="([^"]+)".*?>/gi, function(match, quotationMarks, source, style) { var $float = 'none'; var $width = 0; @@ -557,6 +557,7 @@ RedactorPlugins.wbbcode = function() { return "[img]" + source + "[/img]"; }); + html = html.replace(/]*?src=(["'])([^"']+?)\1.*?>/gi, '[img]$2[/img]'); // [*] -- 2.20.1