From: Alexander Ebert Date: Fri, 28 Nov 2014 00:23:54 +0000 (+0100) Subject: Fixed issue with quote detection in Opera 12.17 X-Git-Tag: 2.1.0_Beta_1~135 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff810213f114b5438e9b35e2e2044d0951a328a4;p=GitHub%2FWoltLab%2FWCF.git Fixed issue with quote detection in Opera 12.17 --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 2528d3855d..422306dd6d 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -193,6 +193,9 @@ RedactorPlugins.wbbcode = function() { convertFromHtml: function(html) { WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'beforeConvertFromHtml', { html: html }); + $('
').text(html).appendTo(document.body);
+			
+			console.debug(html);
 			// remove data-redactor-tag="" attribute
 			html = html.replace(/(<[^>]+?) data-redactor-tag="[^"]+"/g, '$1');
 			
@@ -281,17 +284,24 @@ RedactorPlugins.wbbcode = function() {
 			html = html.replace(/ /gi, " ");
 			
 			// [quote]
-			html = html.replace(/
]*?>\n?]+>\n?]*?>[\s\S]*?<\/header>/gi, function(match, link, author, innerContent) { + html = html.replace(/]+)>\n?]+>\n?]*?>[\s\S]*?<\/header>/gi, function(match, attributes, innerContent) { var $quote; + var $author = ''; + var $link = ''; - if (author) author = WCF.String.unescapeHTML(author); - if (link) link = WCF.String.unescapeHTML(link); + if (attributes.match(/data-author="([^"]+)"/)) { + $author = WCF.String.unescapeHTML(RegExp.$1); + } - if (link) { - $quote = "[quote='" + author + "','" + link + "']"; + if (attributes.match(/cite="([^"]+)"/)) { + $link = WCF.String.unescapeHTML(RegExp.$1); + } + + if ($link) { + $quote = "[quote='" + $author + "','" + $link + "']"; } else if (author) { - $quote = "[quote='" + author + "']"; + $quote = "[quote='" + $author + "']"; } else { $quote = "[quote]";